Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

documentation of Nasm.. ?

Website
2007-10-12
2013-06-04
  • 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...

     
    • 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. :)

      <http://home.comcast.net/~fbkotler/nasmdocb.html#section-B.4.130>

      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

       
    • thanks,
      as for instructions, i'm using the Intel manual. btw, does nasm accept ALL the instruction listed by intel?

       
      • 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

         
    • > http://nasm.sourceforge.net/doc/nasmdoc0.html
      > is the NASM Manual.
      > i can't find nothing about jumps !!

      It documents NASM only, not the instructions ;-)

      > http://sourceforge.net/forum/forum.php?thread_id=1809963&forum_id=167168

      Here you find jumps also ;-)

      > using the Intel manual. btw, does nasm accept ALL the instruction listed by intel?

      For a beginner a 8086 manual (for 16-bit code) or 80386 manual (for 32-bit code) might be the best choice.

      > 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.

      > There are a slew of new instructions added since then - sse3, ssse3

      SSSSSE5 is out - the race will never end :-D