INSTRUCTION SET S3C8245/P8245/C8249/P8249
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 114 (internal stack) 2F
16 (internal stack)
Example: The diagram below shows one example of how to use an EXIT statement.
0050
IP
0022SP
Address Data
0040
PC
Address Data
Memory
0052
IP
0022SP
Address Data
0060
PC
Address Data
Memory
Stack Stack
Before After
22 Data
20
21
22
IPH
IPL
Data
00
50
50
51
140
PCL old
PCH
Exit
60
00
2F
60 Main