NASM Problems on Ubuntu (Debian(Linux))

Reply

Join Date: Jul 2007
Posts: 5
Reputation: someb0dy is an unknown quantity at this point 
Solved Threads: 1
someb0dy someb0dy is offline Offline
Newbie Poster

NASM Problems on Ubuntu (Debian(Linux))

 
0
  #1
Jul 24th, 2007
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:

DATEN SEGMENT

Meldung db "Assemler blablabla"
db "$"

DATEN ENDS

CODE SEGMENT

ASSUME CS:CODE,DSATEN

Anfang: mov ax,DATEN
mov ds,ax

mov dx,offset Meldung

mov ah,9

int 21h

mov ah,4Ch

int 21h

CODE ENDS

END Anfang

Can anybody tell me, what was wrong ?
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 199
Reputation: Tight_Coder_Ex is an unknown quantity at this point 
Solved Threads: 14
Tight_Coder_Ex's Avatar
Tight_Coder_Ex Tight_Coder_Ex is offline Offline
Junior Poster

Re: NASM Problems on Ubuntu (Debian(Linux))

 
0
  #2
Jul 24th, 2007
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
Last edited by Tight_Coder_Ex; Jul 24th, 2007 at 8:05 pm. Reason: Clarification
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 5
Reputation: someb0dy is an unknown quantity at this point 
Solved Threads: 1
someb0dy someb0dy is offline Offline
Newbie Poster

Re: NASM Problems on Ubuntu (Debian(Linux))

 
0
  #3
Jul 25th, 2007
Alright, thank you
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Assembly Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC