Author Topic: documentation of Nasm.. ?  (Read 5616 times)

nobody

  • Guest
documentation of Nasm.. ?
« on: October 12, 2007, 10:47:26 PM »
i believe this,
http://nasm.sourceforge.net/doc/nasmdoc0.html
is the NASM Manual.
i can't find nothing about jumps !! when to use it with near, short, etc...

nobody

  • Guest
Re: documentation of Nasm.. ?
« Reply #1 on: October 13, 2007, 12:04:10 AM »
Short jumps are +127/-128 bytes, near for anything else, as a "short" answer. :)

Nasm defaults to "near" for unconditional jumps, to "short" for conditional jumps. Nasm will advise you if "short" won't work.

Since, as you've observed, the instruction set reference has been removed from the Nasm Manual... I guess you'll have to consult manufacturers docs for instruction information.

Or you could look at the *old* manual. :)



Far jumps reload the cs register, and are probably not what you want unless you're writing an OS or a large dos program - the latter would be silly, these days.

For a really easy solution, give Nasm the "-O" switch, and let it determine whether "near" is needed, or if "short" will reach.

Best,
Frank

nobody

  • Guest
Re: documentation of Nasm.. ?
« Reply #2 on: October 13, 2007, 11:20:49 AM »
thanks,
as for instructions, i'm using the Intel manual. btw, does nasm accept ALL the instruction listed by intel?

nobody

  • Guest
Re: documentation of Nasm.. ?
« Reply #3 on: October 15, 2007, 12:04:06 AM »
Can't say "all" - they keep inventin' new ones. As a rule, Nasm tries to support "all" instructions available at the time of a release. The latest *stable* release is 0.98.39 (0.98.40 at Apple). There are a slew of new instructions added since then - sse3, ssse3, the whole 64-bit thing... Available in 0.99.xx - 2.0 when it's stable. But right now it's quite wobbly - don't try any floating-point with 0.99.04 available here! We double floating-point constants - oops.

Keeping up with documenting these new instructions has proven a problem - which is why that section of the manual is gone.

If you discover an instruction you need that Nasm doesn't support, let us know and it'll be added... well, when it happens... volunteer effort, y'know...

Best,
Frank