Hello guys !

I've just started to learn Assembler and I needed an assembler. My choice was nasm, because of the same syntax as masm and tasm (at least that's what i heard ^^)

I used apt-get to install nasm, everything ok until here.

I wrote my first script (copied it from a book)

Then i wanted to use nasm to assemble (?) it, but it didn't work that well.

This is what the terminal told me

# nasm asm1.asm
asm1.asm:1: error: parser: instruction expected
asm1.asm:6: error: symbol `DATEN' redefined
asm1.asm:6: error: parser: instruction expected
asm1.asm:8: error: parser: instruction expected
asm1.asm:10: error: parser: instruction expected
asm1.asm:15: error: comma or end of line expected
asm1.asm:25: error: symbol `CODE' redefined
asm1.asm:25: error: parser: instruction expected
asm1.asm:27: error: parser: instruction expected

alright, doesn't look too good

this is my script:


Meldung db "Assemler blablabla"
db "$"




Anfang: mov ax,DATEN
mov ds,ax

mov dx,offset Meldung

mov ah,9

int 21h

mov ah,4Ch

int 21h


END Anfang

Can anybody tell me, what was wrong ?

Your assumption that NASM has the same syntax as ML (Masm) or TASM. Yes, for the most part opcodes are similar. An example would be.

ML: mov eax, Data
mov eax, offset Data

NASM: mov eax, [Data] the contents of location Data
mov eax, Data the address of data

If your going to use NASM you'll have to read the manual.

Biggest difference is NASM does not have segmented memory models and therefore ASSUMES nothing

This article has been dead for over six months. Start a new discussion instead.