S3F80JBINSTRUCTION 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 14 1F

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

Address

IP

PC

SP

22

0050

0040

0022

Data

Stack

Before

 

 

 

 

 

After

 

 

Data

 

 

Address

 

Data

 

 

 

 

 

IP

0043

 

 

 

 

Address

 

Data

 

 

 

Address

 

Data

40

Enter

1F

PC

0110

 

40

Enter

1F

41

Address H

01

 

 

 

41

Address H

01

42

Address L

10

 

 

 

42

Address L

10

43

Address H

 

SP

0020

 

43

Address H

 

 

 

 

20

IPH

00

110

Routine

 

 

Memory

 

21

IPL

50

 

Memory

 

 

 

22

Data

 

 

 

 

 

 

 

Stack

 

 

 

 

6-41

Page 169
Image 169
Samsung S3F80JB manual Enter Enter, Operation SP, @Sp @Ip, Format Bytes Cycles Opcode Hex