Jump to content
xisto Community
Sign in to follow this  
Nicolas

Can't Compile Assembly Programs.

Recommended Posts

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.datahello_message db 'Hello, World!',0dh,0ah,'$'.codemain proc mov ax,@data mov ds,ax mov ah,9 mov dx,offset hello_message int 21h mov ax,4C00h int 21hmain endpend main And when I compile this occurs:C:\>CD NICKSC:\Nicks>nasm EXAMP1.ASMEXAMP1.ASM:5: error: parser: instruction expectedEXAMP1.ASM:6: error: parser: instruction expectedEXAMP1.ASM:12: error: parser: instruction expectedEXAMP1.ASM:17: error: comma or end of line expectedEXAMP1.ASM:22: error: parser: instruction expectedEXAMP1.ASM:23: error: parser: instruction expectedC:\Nicks>

Edited by Nicolas (see edit history)

Share this post


Link to post
Share on other sites

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 (<_<.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
Carbage is coming out as output when executed under tasmCan't Compile Assembly Programs.

Hi!

I am beginning to execute 8086 assembler programs with Tasm .The following program when executed does not give output except some carbages.Please tell me what to do.

.Model small

.Stack

.Data

sum db ?

.Code

movax,@data

mov ds,ax

mov ss,ax

movax,0009h

add ax,00009

mov sum,ax

mov ah,09h

lea dx,sum

int 21h

mov ah,4ch

int 21h

end

 

-question by gtrajan

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.