Author Topic: excuse me,"ORG"directive's problem~  (Read 26639 times)

Offline Hack004

  • Jr. Member
  • *
  • Posts: 5
excuse me,"ORG"directive's problem~
« on: April 07, 2010, 04:19:24 PM »
Quote
ORG 0
; some boot sector code
TIMES 510-($-$$) DB 0
DW 0xAA55
======================================
this code compiler prompt error:
Quote
D:\Nasm>nasm 1.asm -o 1.bin
1.asm:1: error: unrecognised directive [org]
==========================================
please tell me about this is why?

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: excuse me,"ORG"directive's problem~
« Reply #1 on: April 07, 2010, 06:29:37 PM »
Well... "org" is recognized only in "-f bin" mode. You haven't specified "-f bin", but it's the default if no output format is specified, so I would expect it to work. It is possible to compile Nasm so that the default output format is other than "-f bin", but I don't think anybody does it. It would be possible to set an output format as part of the NASMENV environment variable... You'd probably know it if you'd done that...

I dunno. Does it work if you specify "-f bin"?

Best,
Frank


Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: excuse me,"ORG"directive's problem~
« Reply #2 on: April 08, 2010, 12:26:15 AM »
I was not aware of any issue, but I see hpa has just now made a change to the way directives are handled. If this continues to be a problem for you, it may be worth discussing "which version" and "try the latest snapshot".

Best,
Frank


Offline Hack004

  • Jr. Member
  • *
  • Posts: 5
Re: excuse me,"ORG"directive's problem~
« Reply #3 on: April 08, 2010, 10:51:45 AM »
excuse me,,,
   still not work,,will My "Nasm" version of the problem?
   still prompt "1.asm:8: error: unrecognised directive [org]"

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: excuse me,"ORG"directive's problem~
« Reply #4 on: April 08, 2010, 02:57:17 PM »
I can't duplicate this problem, Hack004! In fact, I don't think I've ever seen that particular error message. The only way I can get Nasm to complain about "org" is to use some output format other than "-f bin", and then it whines about "parser: instruction expected", not "unrecognised directive". I can see where the message is generated (nasm.c, line 1500), but I've never seen it triggered (that I remember).

So, yeah... if you would, tell us what version of Nasm ("nasm -v"). May be take a look at "nasm -hf" - this will generate a list of output formats, with a '*' in front of the default - should be "bin" (a "custom build" is unlikely, but possible). Might matter "which OS?", too. The exact command line you gave Nasm - I guess you've told us that... Anything you can think of that might be "different"...

"org 0" is the default if no "org" is given, so your code might assemble properly if you just comment out that line, but "something's wrong" here! Let's see if we can track it down, if we can. Thanks for the feedback!

Best,
Frank


Offline Hack004

  • Jr. Member
  • *
  • Posts: 5
Re: excuse me,"ORG"directive's problem~
« Reply #5 on: April 08, 2010, 06:12:19 PM »
First,Thanks for your reply, - -,
============================
problems've been solved,, the problem is version~

My firist download version is "nasm-2.08.01-20100406-installer.rar"
it doesn't seem to identify "Org" directives~
-------------------------------------------
after the download version is "nasm-2.08.01-win32.zip".
it seem to support the "Org" directive~^_^

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: excuse me,"ORG"directive's problem~
« Reply #6 on: April 08, 2010, 07:49:43 PM »
Okay, I guess I never tried that snapshot. (tries it) "unrecognised directive [org]"! Yup, that's a bug! Seems to be fixed again in nasm-2.08.01-20100407... Thanks for the feedback! (our users are our "test suite"... we do test it, but bugs show up when users start using it for their own projects - 2.08 only lasted about an hour before 2.08.01...)

Best,
Frank