# `jae`

[x86-64 Documentation](https://asm-editor.specy.app/documentation/x86.md) › [Instructions](https://asm-editor.specy.app/documentation/x86/instruction.md)

Web page: https://asm-editor.specy.app/documentation/x86/instruction/jae

**Jump if above or equal (CF == 0)**

Category: Control flow

Jumps to the target when the last comparison found above or equal (CF is 0).

8086 and later

Also written as: `jnb`, `jnc`

[Intel's reference: Jcc](https://intel.github.io/SDM/instruction/Jcc.html)

Used in: [Loops](https://asm-editor.specy.app/learn/courses/x86/think-in-assembly/loops.md) (x86-64 assembly), [Arrays, strings and the string instructions](https://asm-editor.specy.app/learn/courses/x86/think-in-assembly/arrays-strings-and-the-string-instructions.md) (x86-64 assembly), [syscall and the Linux x86-64 ABI](https://asm-editor.specy.app/learn/courses/x86/talking-to-the-outside-world/syscall-and-the-linux-abi.md) (x86-64 assembly), [Ports, memory-mapped devices, and kernel access](https://asm-editor.specy.app/learn/courses/x86/talking-to-the-outside-world/ports-devices-and-the-kernel.md) (x86-64 assembly), [The largest element](https://asm-editor.specy.app/learn/courses/x86/examples/max-of-an-array.md) (x86-64 assembly), [Length of a string](https://asm-editor.specy.app/learn/courses/x86/examples/string-length.md) (x86-64 assembly), [Reverse a string in place](https://asm-editor.specy.app/learn/courses/x86/examples/reverse-a-string.md) (x86-64 assembly), [A jump table](https://asm-editor.specy.app/learn/courses/x86/examples/jump-table.md) (x86-64 assembly), [Binary search](https://asm-editor.specy.app/learn/courses/x86/examples/binary-search.md) (x86-64 assembly), [Drawing shapes on the screen](https://asm-editor.specy.app/learn/courses/x86/examples/drawing-on-the-screen.md) (x86-64 assembly)

## Flags

| Flag | Effect |
| --- | --- |
| CF | not changed |
| PF | not changed |
| AF | not changed |
| ZF | not changed |
| SF | not changed |
| DF | not changed |
| OF | not changed |

Reads: CF

## Forms

- `jae short imm8`
- `jae imm`
- `jae near imm32` · 386 and later

## Operands

- `imm8`: A branch target, written as a label or address. NASM calculates the displacement from the end of the instruction. The displacement must fit a signed byte, `-128` to `127`.
- `imm`: A branch target, written as a label or address. NASM calculates the displacement from the end of the instruction. NASM selects a short or near encoding according to the target’s reach and any size constraint.
- `imm32`: A branch target, written as a label or address. NASM calculates the displacement from the end of the instruction. In 64-bit mode the encoded displacement is signed 32-bit, `-2147483648` to `2147483647`, even though the target address is 64-bit.

## Description

The condition reads the current flags, commonly set by `cmp` or `test`. Signed comparisons use SF and OF; unsigned comparisons use CF. The [condition-code table](https://asm-editor.specy.app/documentation/x86/registers/condition-codes.md) lists the flag tests and synonymous mnemonics.

Write the target label or address, such as `jne retry`. NASM calculates a displacement from the end of the jump. The short form reaches −128 through 127 bytes from that point; the longer near form in 64-bit mode uses a signed 32-bit displacement (about ±2 GiB). NASM normally selects the short form when possible. `short` requires the short range, while `strict near` keeps the longer form.

Conditional jumps have no register or memory-indirect target form. To conditionally reach an arbitrary 64-bit address, branch around an indirect `jmp`.

## Example

```x86
global _start

section .text
_start:
        mov rax, 12
        cmp rax, 12         ; sets the flags the condition reads
        jae taken
        mov rbx, 1          ; runs when the condition is false
        jmp done
taken:
        mov rbx, 2          ; runs when it is true
done:

        mov rax, 60         ; syscall 60: exit
        xor rdi, rdi
        syscall
```
