Samsung S3F80JB manual Exit Exit, Operation IP, @Sp, Format Bytes

Models: S3F80JB

1 346
Download 346 pages 34.13 Kb
Page 170
Image 170

INSTRUCTION SETS3F80JB

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

14 (internal stack)

2F

 

 

 

 

 

16 (internal stack)

 

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

Address

 

 

 

 

 

 

IP

0050

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PC

0040

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

SP

0022

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

20

 

 

 

 

 

IPH

 

 

 

 

21

IPL

 

 

 

 

22

Data

 

 

 

 

 

 

 

Stack

Before

Data

Address

50 PCL old

51 PCH

140 Exit

00

50

Memory

Data

60

00

2F

Address

IP 0052

PC 0060

SP 0022

22Data Stack

After

Data

Address

60

Data

Main

Memory

6-42

Page 170
Image 170
Samsung S3F80JB manual Exit Exit, Operation IP, @Sp, Format Bytes