RST p

Operation

(SP-1) <- PCh, (SP-2) <- PCl, PCh <- $00, PCl <- p)

Mnemonic

RST

Operands

p

b7b6b5b4b3b2b1b0
1 1 t 1 1 1

Description

The current Program Counter (PC) contents are pushed onto the external memory stack, and the Page 0 memory location assigned by operand p is loaded to the PC. Program execution then begins with the op code in the address now pointed to by PC. The push is performed by first decrementing the contents of the Stack Pointer (SP), loading the high-order byte of PC to the memory address now pointed to by SP, decrementing SP again, and loading the low-order byte of PC to the address now pointed to by SP. The Restart instruction allows for a jump to one of eight addresses indicated in the following table. The operand p is assembled to the object code using the corresponding t state.

Because all addresses are stored in Page 0 of memory, the high-order byte of PC is loaded with $00. The number selected from the p column of the table is loaded to the low-order byte of PC.

ptHex
$00000$C7
$08001$CF
$10010$D7
$18011$DF
$20100$E7
$28101$EF
$30110$F7
$38111$FF

Example

If the Program Counter contains $15B3h , then upon the execution of

	RST	$18

(object code 1101111 ) instruction, the PC contains $0018 as the address of the next fetched op code.