Author Topic: hi.asm:4:parser:instruction expected  (Read 43769 times)

nobody

  • Guest
hi.asm:4:parser:instruction expected
« on: September 22, 2004, 07:46:43 PM »
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?

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: hi.asm:4:parser:instruction expected
« Reply #1 on: September 22, 2004, 09:07:30 PM »
I think you bleeped up the syntax. Kinda hard to know *how* you bleeped up the syntax without seeing line 4...

Best,
Frank

nobody

  • Guest
Re: hi.asm:4:parser:instruction expected
« Reply #2 on: September 23, 2004, 08:03:53 PM »
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?

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: hi.asm:4:parser:instruction expected
« Reply #3 on: September 24, 2004, 01:47:57 AM »
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