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?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
How is this supposed to work? Isn't NEAR an operator that can't be tested like this?
The Samples\movd64.inc uses similar expression:
I wasn't able to understand how exactly this works because JWASM seems to return unexpected values on "type near".
NEAR is a type, not an operator, that's why this syntax works - IIRC, for both jwasm and masm.
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.
Thank you for the clarification, japheth!