INSTRUCTION SET S3C84E5/C84E9/P84E9
6-42
EXIT Exit
EXIT
Operation: IP @SP
SP SP + 2
PC @IP
IP IP + 2
This instruction is useful when implementing threaded-code languages. The stack value is popped
and loaded into the instruction pointer. The program memory word that is pointed to by the
instruction pointer is then loaded into the program counter, and the instruction pointer is
incremented by two.
Flags: No flags are affected.
Format:
Bytes Cycles Opcode
(Hex)
opc 1 16 2F
Example: The diagram below shows an example of how to use an EXIT statement.
IP
Data
Address Data
50
51
Address Data
60
00
Memory
Stack
0050
Before
0022
0040PC
22
IPH
IPL
Data
IP
Address Data
60
Address Data
Memory
Stack
PCL old
PCH
Exit
0043
0020
0110PC
Main
140
20
21
22
After
00
50