S3C8275X/F8275X/C8278X/F8278X/C8274X/F8274X
ENTER
— Enter
ENTER
Operation:
SP
@SP
IP
PC
IP
This instruction is useful when implementing threaded-code languages. The contents of the
instruction pointer are pushed to the stack. The program counter (PC) value is then written to the
instruction pointer. The program memory word that is pointed to by the instruction pointer is
loaded into the PC, and the instruction pointer is incremented by two.
Flags:
No flags are affected.
Format:
opc
Example:
The diagram below shows one example of how to use an ENTER statement.
Address
Data
IP
0050
0040
PC
SP
0022
22
Data
Stack
←
SP – 2
←
IP
←
PC
←
@IP
←
IP + 2
Before
Address
40
Enter
41
Address H
42
Address L
43
Address H
Memory
Bytes
1
Address
IP
0043
Data
0110
1F
PC
01
10
SP
0020
20
IPH
21
IPL
22
Data
Stack
INSTRUCTION SET
Cycles
Opcode
(Hex)
14
1F
After
Data
Address
40
Enter
41
Address H
42
Address L
43
Address H
00
110
Routine
50
Memory
Data
1F
01
10
6-41