S3C84E5/C84E9/P84E9

INSTRUCTION SET

 

 

ENTER — Enter

ENTER

 

Operation:

SP SP – 2

 

@SP IP

 

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:

Bytes Cycles Opcode (Hex)

opc

1 141F

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

 

 

Before

 

 

 

 

After

 

 

Address

 

Data

 

 

Address

 

Data

 

 

IP

0050

 

 

 

IP

0043

 

 

 

 

 

Address

 

Data

 

 

Address

 

Data

PC

0040

40

Enter

1F

PC

0110

40

Enter

1F

 

 

41

Address H

01

 

 

41

Address H

01

 

 

42

Address L

10

 

 

42

Address L

10

 

0022

43

Address H

 

 

0020

43

Address H

 

 

 

 

 

 

20

IPH

110

Routine

 

 

 

 

 

 

00

 

 

 

 

 

Memory

 

21

IPL

50

Memory

 

22

Data

 

 

22

Data

 

 

 

 

 

 

 

 

 

Stack

 

 

 

 

Stack

 

 

 

6-41

Page 168
Image 168
Samsung S3C84E5 user manual Enter Enter