NASM Forum > Using NASM

hi.asm:4:parser:instruction expected

(1/1)

nobody:
this is the message i get,when i try to compile a program hi.asm like this nasm -f elf hi.asm.what do u think?

Frank Kotler:
I think you bleeped up the syntax. Kinda hard to know *how* you bleeped up the syntax without seeing line 4...

Best,
Frank

nobody:
thanks frank...here is the source of the program.....is downloaded from the net...

; hi.asm - simple "hello world" program
; assemble with "nasm -f bin -o hi.com hi.asm"

org 100h         ; inform Nasm this is a .com file
                     ; int 21h is going to want...
mov dx,msg     ; the address of or message in dx
mov ah,9        : ah=9 - "print string" sub-function
int 21h           ; call dos services
mov ah,4Ch     ; "terminate program" sub-function
int 21h           ; call dos services

msg db 'Hello, World!',0Dh,0Ah,'$'  ; $-terminated message

as i sad,it's downloaded from the net...and from what i remeber i get this error at other programs too...Can u help me,please?

Frank Kotler:
The syntax looks okay to me (in fact, it looks like it might be my code - I see I misspelled "our"... :)

That is, it's okay in "-f bin" mode (or "-f ieee", but I doubt like hell you're using that!). "org" is one of those "format specific" things that is known (or useful) *only* in "-f bin". If you tried to assemble this with "-f obj" (or, God forbid, "-f win32"), it would generate that error. Could that be the problem?

Best,
Frank

Navigation

[0] Message Index

Go to full version