Nov 22, 2009

Can't Compile Assembly Programs.

free web hosting
Open Discussion > MODERATED AREA > Computers > Programming Languages > C/C++ Programming

Can't Compile Assembly Programs.

Nicolas
Hi, I'm trying to learn assembly but I can't compile any "hello world" programs... And I don'n know what I'm doing wrong... I downloaded NASM ,NASMW and TASM32. The program is like this:

EXAMP1.ASM:


;title Hello World Program
; This program displays "Hello, World!"

dosseg
.model small
.stack 100h

.data
hello_message db 'Hello, World!',0dh,0ah,'$'

.code
main proc
mov ax,@data
mov ds,ax

mov ah,9
mov dx,offset hello_message
int 21h

mov ax,4C00h
int 21h
main endp
end main




And when I compile this occurs:


C:\>CD NICKS

C:\Nicks>nasm EXAMP1.ASM
EXAMP1.ASM:5: error: parser: instruction expected
EXAMP1.ASM:6: error: parser: instruction expected
EXAMP1.ASM:12: error: parser: instruction expected
EXAMP1.ASM:17: error: comma or end of line expected
EXAMP1.ASM:22: error: parser: instruction expected
EXAMP1.ASM:23: error: parser: instruction expected

C:\Nicks>

 

 

 


Comment/Reply (w/o sign-up)

True2Earn
this would be assembled into a .COM and not an executable (.EXE). what command line switches are you using? also, which assembler are you using? this should compile under TASM v5 without any problems. just don't leave "EXAMP1.ASM:" in the source code unless you put a semicolon in front of it (wink.gif.

Comment/Reply (w/o sign-up)

WindAndWater
Also, make sure that you're using the right assembly for your processor: IA-32, IA-64, x86-32, and x86-64 are all different. I'm not sure how much some assemblers can compensate for the discrepencies as I've only ever used ASM embedded in C with gcc.

Comment/Reply (w/o sign-up)



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Similar Topics

Keywords : compile, assembly, programs

  1. Mouse Input In C Programs
    using checkbox etc (5)
  2. C++ Programmers
    So Post your C++ programs here (1)
    Hi any C++ programmer want to share C++ programs,then post the code here.But it would be good if the
    programs are not too long.So only short programs. But post that code in bbcodes-don't forget
    that. Anyone who doesn't understand any programs that are posted can take any help here in
    this thread. Heres one : This is a program using class: CODE #include class sum { private:
    int a,b,c; public: sum() { a=5,b=6; } sum(int x,int y) { a=x,b=y; } void get() { cin>>a>>b; } void
    calc() { c=a+b; cout } }; void main() { sum s1,s2(2,3),s3; s1.calc(); s2.calc(); s....
  3. Simple C++ Programs.
    simple programs for beginners. (17)
    if you want to start c++ programing read and train this simple programs. CODE 1."using ?
    command." #include #include int main(){ clrscr(); float a,b,c,d; cin >>a>>b>>c>>d;
    a=(a>c+d)?(a*c) : (b*d); cout getch(); return 0; } 2."using of while loop command." #include
    #include int main(){ clrscr(); float a,b,c,d; cin >>a>>b>>c>>d; a=(a>c+d)?(a*c) : (b*d); cout
    getch(); return 0; } 3."using of for loop" #include #include int main(){ clrscr(); float
    a,b,c,d; cin >>a>>b>>c>>d; a=(a>c+d)?(a*c) : (b*d); cout getch(); return 0; } 4."conwerting a....
  4. Programs
    for games (4)
    first off i would like to announce this is my first time on here, i would like to know what kind of
    programs i need to edit my Pc games. i have been learning how to edit with just texts but i would
    like to know what i need for the text scripts i can't read? any information can help
    --thanks....
  5. Buffer Overflow In Action Tutorial
    Learn how to buffer overflow programs to change the program flow... (0)
    This tutorial will show you how to buffer overflow programs in order to change the flow of the
    application , even if this means executing your own code. A very well explained tutorial of buffer
    overflows ( not theory but practise ) + a 20 min video tutorial/demonstration + all the files needed
    for the tutorial.. Buffer Overflow In Action Tutorial LINK ....
  6. C/c++ Programming Experince
    How long does it take before programming useful programs? (3)
    I've been teaching my self C++, slowly but surely. Everything I try to program is just mediocre,
    and much simplier to use something already made. How long does it take before I can start
    programming useful decent programs?....
  7. Can A Windows Compiler Compile For Linux?
    (6)
    A friend of me, is working on a mod for a tournament where I am a co admin off... The problem is...
    My friend uses Windows. Are there any Windows programs that can ccompile .so's to use on a linux
    server / box? Thanks for any reply's....
  8. Simple C++ Programs
    programming C++ (16)
    what simple programs would a beginner should code in order to get some understanding the c++ along
    with leaning as well....

    1. Looking for compile, assembly, programs

Searching Video's for compile, assembly, programs
See Also,
advertisement


Can't Compile Assembly Programs.

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com