Conditional Jumps (Cont.)


Jumps Based on Unsigned Comparisons
The table on the right shows a list of jumps based on comparisons of unsigned integers.
Mnemonic Description
JA Jump if above (if leftOp > rightOp)
JNBE Jump if not below or equal (same as )
JAE Jump if above or equal (if leftOp ≥ rightOp)
JNB Jump if not below (same as )
JB Jump if below (if leftOp < rightOp)
JNAE Jump if not above or equal (same as )
JBE Jump if below or equal (if leftOp ≤ rightOp)
JNA Jump if not above (same as )

Jumps Based on Signed Comparisons

The table on the right shows a list of jumps based on comparisons of signed integers.
Mnemonic Description
JG Jump if greater (if leftOp > rightOp)
JNLE Jump if not less than or equal (same as )
JGE Jump if greater than or equal (if leftOp ≥ rightOp)
JNL Jump if not less (same as )
JL Jump if less (if leftOp < rightOp)
JNGE Jump if not greater than or equal (same as )
JLE Jump if less than or equal (if leftOp ≤ rightOp)
JNG Jump if not greater (same as )

jecxz ja jg

 INCLUDE Irvine32.inc
 .data
  X  DWORD  12345678h
 .code
 main PROC
     mov    eax, 0
     mov    ecx, 10
 L1: add    eax, ecx
     dec    ecx
     jecxz  L2
     jmp    L1
 L2: call   WriteDec
     exit
 main ENDP
 END main

 INCLUDE Irvine32.inc
 .data
  X  DWORD  12345678h
 .code
 main PROC
     mov   al, -128
     cmp   al, 1
     ja    L1
     call  WaitMsg
 L1: exit
 main ENDP
 END main
 INCLUDE Irvine32.inc
 .data
  X  DWORD  12345678h
 .code
 main PROC
     mov   al, -128
     cmp   al, 1
     jg    L1
     call  WaitMsg
 L1: exit
 main ENDP
 END main
Output Output Output

 

 

 

 

 

 






      “I’m not arguing, I’m just explaining why I’m right.”    
      ― Unknown