<< Previous | Next >>

CALL (HL)
CALL (IX)
CALL (IY)
    Call Subroutine
    Rabbit 4000/5000 Instruction

Opcode
Instruction
Operation
ED EA CALL (HL) (SP - 1) = PChigh
(SP - 2) = PClow
PC = HL; SP = SP - 2
DD EA CALL (IX) (SP - 1) = PChigh
(SP - 2) = PClow
PC = IX; SP = SP - 2
FD EA CALL (IY) (SP - 1) = PChigh
(SP - 2) = PClow
PC = IY; SP = SP - 2

8-Bit Access
16-Bit Unaligned
16-Bit Aligned
Rabbit 4000
12
n/a
n/a
Rabbit 5000
13
13
11

Flags ALTD IOI/IOE
S
Z
L/V
C
F
R
SP
S
D
-
-
-
-

Description

This instruction is used to call a subroutine. First PC is pushed onto the stack. The high-order byte of PC is pushed first, then the low-order byte. PC is then loaded with the value in HL, IX or IY, the 16-bit address of the first instruction of the subroutine. SP is updated to reflect the two bytes pushed onto the stack.


Rabbit Instructions << Previous | Next >> rabbit.com