Samsung F8274X Computer Hardware User Manual


 
INSTRUCTION SET S3C8275X/F8275X/C8278X/F8278X/C8274X/F8274X
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 14 (internal stack) 2F
16 (internal stack)
Example: The diagram below shows one example of how to use an EXIT statement.
0050
IP
0022
SP
Address Data
0040
PC
Address Data
Memory
0052
IP
0022
SP
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