ASM2 - Documentation
  • 📚ASM2 - Documentation
  • Registers
  • Address Registers
  • Instructions
    • DISP
    • END
    • MOV
    • RET
  • Operators
    • ADD
    • SUB
    • MUL
    • DIV
  • Functions
  • Subroutines
  • Jump
    • Conditional Jump
      • Jump Equal (JE)
      • Jump Not Equal (JNE)
      • Jump Greater (JG)
      • Jump Greater or Equal (JGE)
      • Jump Less (JL)
      • Jump Less or Equal (JLE)
    • Unconditional Jump
Powered by GitBook
On this page
  1. Jump
  2. Conditional Jump

Jump Greater or Equal (JGE)

The Jump Greater or Equal (JGE) instruction in ASM2 assembly language is a control flow directive that causes the program to jump to a designated label or function if the first operand in a previous comparison is greater than or equal to the second. This decision is influenced by the sign flag (SF) and possibly the zero flag (ZF) in the status register.

Syntax for Using JGE: JGE <label/function_name> // JGE GREATER_OR_EQUAL_CASE

Where:

  • <label/function_name> indicates the label or function that the program will jump to if the first operand is greater than or equal to the second.

Technical Details:

  • Flag Consideration: JGE examines the sign flag (SF) and may consider the zero flag (ZF). The jump occurs if SF is set to indicate a positive result or if ZF is set (1), indicating equality.

  • Role in Control Flow: Used commonly after a CMP (compare) instruction, JGE allows for branching in scenarios where one value is either greater than or equal to another, supporting inclusive comparative logic.

PreviousJump Greater (JG)NextJump Less (JL)

Last updated 1 year ago