Samsung S3F80P5X User Manual page 163

S3f80p5 microcontrollers
Table of Contents

Advertisement

S3F80P5_UM_ REV1.00
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
0040
PC
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
0110
1F
PC
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