Menu

winasm.inc: strange "if near eq 0ff08h"

MazeGen
2013-05-15
2013-05-16
  • MazeGen

    MazeGen - 2013-05-15

    I've been searching for a symbol defined by JWASM that distunguishes between 32-bit and 64-bit source code. I looked into winasm.inc and found the strange line

    if near eq 0ff08h   ;64-bit enabled?
    

    How is this supposed to work? Isn't NEAR an operator that can't be tested like this?

     
  • MazeGen

    MazeGen - 2013-05-15

    The Samples\movd64.inc uses similar expression:

    .errnz (type near) - 0FF08h, <movd64 can be used in 64-bit code only>
    

    I wasn't able to understand how exactly this works because JWASM seems to return unexpected values on "type near".

     
  • japheth

    japheth - 2013-05-15

    Isn't NEAR an operator that can't be tested like this?

    NEAR is a type, not an operator, that's why this syntax works - IIRC, for both jwasm and masm.

    I wasn't able to understand how exactly this works because JWASM seems to return
    unexpected values on "type near".

    Jwasm is not supposed to return "unexpected values" for "TYPE near" or simply "near". In 16-bit, "TYPE near" should return 0FF02h, in 32-bit 0FF04h and in 64-bit 0FF08h.

     
  • MazeGen

    MazeGen - 2013-05-16

    Thank you for the clarification, japheth!

     

Log in to post a comment.