Enter Enter - Samsung S3C80A5B User Manual

8-bit cmos
Table of Contents

Advertisement

S3C80A5B
ENTER
— Enter
ENTER
SP ← SP – 2
Operation:
@SP
IP ← PC
PC ← @IP
IP ← IP + 2
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
0050
IP
PC
0040
0022
SP
22
Data
Stack
← IP
Before
Address
40
Enter
41
Address H
42
Address L
43
Address H
Memory
Bytes
1
Address
0043
IP
Data
1F
PC
0110
01
10
0020
SP
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

Advertisement

Table of Contents
loading

Table of Contents