| | |
NASM Problems on Ubuntu (Debian(Linux))
![]() |
•
•
Join Date: Jul 2007
Posts: 5
Reputation:
Solved Threads: 1
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,DS
ATEN
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 ?
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,DS
ATENAnfang: 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 ?
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
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
![]() |
Similar Threads
- Problems with ubuntu (Window and Desktop Managers)
- Complete Debian Linux Server Setup Tutorials (*nix Hardware Configuration)
- Complete Debian Linux Server Setup Tutorial (*nix Software)
- Debian linux c++ development (*nix Software)
- i want to try linux (Getting Started and Choosing a Distro)
- Tutorial: Installing Debian Linux (3.1) (Getting Started and Choosing a Distro)
- Debian Linux xserver configuration (Window and Desktop Managers)
Other Threads in the Assembly Forum
- Previous Thread: convert uppercase into lower case
- Next Thread: p2p chat using NASM help needed.
| Thread Tools | Search this Thread |





