From Learn @ Cemetech
Revision as of 17:57, 5 February 2016 by Maintenance script (talk | contribs) (Initial automated import)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Absolute jumps to the address. Can be conditional or unconditional. JP takes one more byte than JR, but is also slightly faster, so decide whether speed or size is more important before choosing JP or JR. JP (HL), JP (IX), and JP (IY) are unconditional and are the fastest jumps, and do not take more bytes than other jumps.


   JP NN			;unconditional jump
   JP cond.,NN		;conditional jump
   JP (reg16)            ;HL, IX and IY only

Allowed Instructions

   JP NN		;no condition
   JP C,NN		;jumps if C is set
   JP NC,NN		;jumps if C is reset
   JP Z,NN		;jumps if Z is set
   JP NZ,NN	;jumps if Z is reset
   JP M,NN		;jumps if S is set
   JP P,NN		;jumps if S is reset
   JP PE,NN	;jumps if P/V is set
   JP PO,NN	;jumps if P/V is reset
   ;HL points to address
   JP (HL)
   ;IX points to address
   JP (IX)
   ;IY points to address
   JP (IY)


All flags preserved.



cc is condition: NZ, Z, NC, C, PO, PE, P, M

XX 10
cc,XX 10
(hl) 4
(ix) 8
(iy) 8

See Also