.IF
directive is expanded into assembly language instructions including the CMP
.
Assume val1
and result
are 32-bit unsigned integers:
mov eax, 6
|
⇒ |
mov eax, 6
|
Memory Comparison | Unsigned Comparison | Signed Comparison |
---|---|---|
.data opnd1 BYTE 1 opnd2 BYTE 2 .code .IF ( opnd1 < opnd2 ) call WaitMsg .ENDIF |
.data opnd BYTE -1 .code .IF ( opnd < 0 ) call WaitMsg .ENDIF |
.data opnd SBYTE -1 .code .IF ( opnd < 0 ) call WaitMsg .ENDIF |
Output | Output | Output |
Memory & Register | Register Comparison | Constant Comparison |
.data opnd SBYTE -1 .code mov al, 0 .IF ( opnd < al ) call WaitMsg .ENDIF |
.code mov eax, -4 .IF ( eax < 0 ) call WaitMsg .ENDIF |
.code mov eax, -4 .IF ( 0 > eax ) call WaitMsg .ENDIF |
Output | Output | Output |