jp

Jump

Jumps to a 16-bit address, or to the address held in HL, IX or IY, either always or only when a flag condition is met.

SZHP/VNC ––––––
  • Leaves every flag unchanged

Forms

  • jp 3 bytes10 cycles

    Jumps to nnnn.

  • If the condition cc is true, jumps to nnnn.

  • jp (hl) 1 byte4 cycles

    Jumps to the address in HL.

  • Jumps to the address in IX.

Pseudo-instructions

The assembler also accepts these forms, which are other ways to write Z80 instructions. Open a row to see what each form becomes.

  • Jumps to the address in HL.

  • If the condition cc is true, jumps to nnnn.

  • Jumps to the address in IX.

Operands

nnnn
A 16-bit value or address, 0 to 65535, written as a number or label. (nnnn) accesses memory at that address. More
cc
A flag condition: nz (zero flag clear, Z = 0), z (zero flag set, Z = 1), nc (carry flag clear, C = 0), c (carry flag set, C = 1), po (parity/overflow flag clear, P/V = 0), pe (parity/overflow flag set, P/V = 1), p (sign flag clear, S = 0), m (sign flag set, S = 1), nv (alias for po, P/V = 0) or v (alias for pe, P/V = 1). Here c tests the carry flag; it does not name the c register. More
ix
The ix index register. You can also use iy, with the same instruction size and timing. More
        .org 0x8000
        jp nz, target
target: halt