5.1 Forward References in Macro Expressions

Asmc Macro Assembler

5.1 Forward References in Macro Expressions

Like Masm, JWasm usually evaluates expressions in preprocessor directives during the first pass only. However, due to different jump optimization strategies of Masm and JWasm, the results may differ. This is very unlikely to impose a problem, but it is mentioned here for completeness. An example (found in README.TXT of Masm v6.14):

 
      Label1:
           JMP Label2
      Label2:

      REPEAT Label2 - Label1
           INC AX
      ENDM

Masm will - incorrectly - repeat the loop 10 times, although the result of expression Label2 - Label1 is 2 only. OTOH, JWasm will repeat the loop 2 times only, because it's using an "optimistic" strategy concerning forward references.