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.
Used in
- jp, jr and the conditionsZ80 assembly
- call, ret and passing valuesZ80 assembly
- The screen, keyboard and mouse through portsZ80 assembly
- The largest elementZ80 assembly
- A subroutine with its arguments in registersZ80 assembly
- Stack arguments and a stack frameZ80 assembly
- Recursion: factorial and FibonacciZ80 assembly
- A jump tableZ80 assembly
- A bouncing ballZ80 assembly
- Move a square with the keyboardZ80 assembly
SZHP/VNC ––––––
- Changes no flag
Forms
jp3 bytes · 10 cyclesnnnnis copied to PC.-
If the condition
ccis true,nnnnis copied to PC. jp (hl)1 byte · 4 cyclesLoads the value of HL into PC.
-
Loads the value of IX into PC.
Pseudo-instructions
Other spellings the assembler accepts; each form shows the instruction it becomes.
-
Loads the value of HL into PC.
-
If the condition
ccis true,nnnnis copied to PC. -
Loads the value of IX into PC.
Operands
nnnn- A 16-bit value or address,
0to65535, 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 forpo,P/V = 0) orv(alias forpe,P/V = 1). Herectests the carry flag; it does not name thecregister. More ix- The
ixindex register. You can also useiy, with the same instruction size and timing. More
.org 0x8000
jp nz, target
target: halt