INSTRUCTION SET

S3C84E5/C84E9/P84E9

 

 

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 162F

Example: The diagram below shows an example of how to use an EXIT statement.

 

 

Before

 

 

After

 

Address

 

Data

 

Address

Data

 

IP

0050

 

 

IP

0043

 

 

 

Address

 

Data

Address

Data

PC

0040

 

 

PC

0110

 

 

 

50

PCL old

60

60

Main

 

0020

51

PCH

00

0022

 

 

 

 

 

 

20

IPH

140

Exit

 

 

 

00

 

 

 

 

21

IPL

50

Memory

 

 

Memory

22

Data

 

22

Data

 

 

 

 

Stack

 

 

 

Stack

 

6-42

Page 169
Image 169
Samsung S3C84E5 user manual Exit Exit, Operation IP ← @SP