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 Not Equal (JNE)

The Jump Not Equal (JNE) instruction in the ASM2 assembly language is a control flow directive that causes the program to jump to a designated label or function if the zero flag (ZF) is cleared, suggesting that the result of the previous comparison or arithmetic operation was not equal (i.e., the comparison yielded a non-zero difference).

Syntax for Using JNE: JNE <label/function_name> // JNE NOT_EQUAL_CASE

Where:

  • <label/function_name> indicates the label or function that the program will jump to if the condition of inequality is met.

Technical Details:

  • Flag Utilization: JNE operates by examining the state of the zero flag (ZF) in the status register. If ZF is cleared (0), indicating non-equality, the program jumps to the given label or function.

  • Application in Decision Structures: Typically used after a CMP (compare) instruction, JNE enables divergent paths in program logic, allowing for execution of different code blocks based on the outcome of comparisons.

PreviousJump Equal (JE)NextJump Greater (JG)

Last updated 1 year ago