English
Language : 

S3C852B Datasheet, PDF (180/383 Pages) Samsung semiconductor – 8-BIT CMOS MICROCONTROLLERS
INSTRUCTION SET
S3C852B/P852B (Preliminary Spec)
EXIT — Exit
EXIT
Operation:
IP
←
SP ←
PC ←
IP
←
@SP
SP + 2
@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:
Format:
No flags are affected.
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.
Before
Address
1P
PC
SP
0050
0040
0022
Data
Address
50 PCL old
51 PCH
Data
60
00
20 IPH 00
21 IPL 50
22 Data
140 Exit
2F
Memory
Stack
After
Address
Data
1P 0052
PC 0060
Address
60 Main
SP 0022
Data
22 Data
Stack
Memory
6-42