The JL/JNGE instructions

Jump if less (for signed numbers).

Format of the JL/JNGE instructions

InstructionDescription
JL rel8 / JNGE rel8Short jump if less/not greater or equal (SF ≠ OF).
JL rel16 / JNGE rel16Near jump if less/not greater or equal (SF ≠ OF).

JL (Jump if Less) and JNGE (Jump if Not Greater or Equal) are synonyms. They are used for jumps after comparing signed numbers. The condition for the jump is: the sign flag (SF) is not equal to the overflow flag (OF). In other words, the jump is performed if the first operand (in CMP) is less than the second.

Usage example

title Author: Evgeny Sergeevich Dovgopolov

.model small
.stack 100h

code segment public        ; Start of the code segment
    assume cs:code

    main proc              ; Start of the main procedure
        mov     ax, 3      ; Copy the value 3 into the ax register
        cmp     ax, 6      ; Compare the value in ax with 6
        jl      Skip_1     ; If SF≠OF, jump to the Skip_1 label

        mov     bx, 2
        imul    bx

    Skip_1:
        mov     ax, 8      ; Copy the value 8 into the ax register
        cmp     ax, 6      ; Compare the value in ax with 6
        jl      Skip_2     ; If SF≠OF, jump (here the condition is false)

        mov     bx, 2
        imul    bx         ; Perform signed multiplication of ax by bx

    Skip_2:
        mov     ax, 4C00h  ; Copy the process termination function number into ah and the value into al
        int     21h        ; Call the interrupt
    main endp              ; End of the main procedure

code ends                  ; End of the code segment
end main                   ; End of file. The main procedure is the entry point

Example taken from the textbook "HANDYFAR - MASM (Evgeny Sergeevich Dovgopolov)".

Processor status flags

CF
No
PF
No
AF
No
ZF
No
SF
No
TF
No
IF
No
DF
No
OF
No