FIX: .IF with Multiple Tests Adds a JMP Instruction (120067)



The information in this article applies to:

  • Microsoft Macro Assembler (MASM) 6.1

This article was previously published under Q120067

SYMPTOMS

If two or more values known at assembly time evaluate as TRUE, .IF (below) will add a JMP instruction. In this first example, only the NOP is assembled:
   .IF 1
      nop
   .ENDIF
				
In this second example, a JMP instruction is added:
   .IF 1 || 3
      nop
   .ENDIF
				
If you use a register, as in this third example, the result is a conditional JMP to the location following the .IF:
   .IF ax || 3
      nop
   .ENDIF
				
The code runs as expected, despite the extra instructions.

RESOLUTION

To eliminate the extra generated code, replace the "||" with an "OR".

STATUS

Microsoft has confirmed this to be a bug in MASM version 6.1. This problem was corrected in MASM version 6.11.

Modification Type:MinorLast Reviewed:2/11/2004
Keywords:kbfix KB120067