3 INSTRUCTION SET

 

 

 

 

RET

 

Return from subroutine

 

Source Format:

RET

 

 

 

 

 

 

 

 

Operation:

PCSL M(SP), PCSH

M(SP+1), PCP

M(SP+2), SP SP + 3

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

OP-Code:

 

1

 

1

1

1

1

1

0

1

1

1

1

1

 

FDFH

 

 

MSB

 

 

 

 

LSB

 

 

Type:

VI

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Clock Cycles:

7

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Flag:

 

C – Not affected

 

 

 

 

 

 

 

 

 

 

Z – Not affected

 

 

 

 

 

 

 

 

 

 

D – Not affected

 

 

 

 

 

 

 

 

 

 

I

– Not affected

 

 

 

 

 

 

 

Description: Jumps to the return address that was pushed onto the stack when the subroutine was called.

Example:

 

 

RET

 

PCP

1101

 

0010

 

PCS

1000 1101

 

0010 1101

 

SP

BD

 

C0

 

Memory (SP)

1101

 

1101

 

Memory (SP+1)

0010

 

0010

 

Memory (SP+2)

0010

 

0010

RETD e

Load immediate data e to memory, and increment X by 2, then return

Source Format:

RETD e

 

 

 

 

 

 

 

Operation:

PCSL

M(SP), PCSH

M(SP+1), PCP

M(SP+2), SP SP + 3,

 

M(X)

e3 to e0, M(X+1)

e7 to e4, X

X + 2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

OP-Code:

0

0

0

1

e7

e6

e5

e4

e3

e2

e1

e0

 

100H to 1FFH

 

MSB

 

 

 

 

 

 

 

 

 

 

LSB

 

Type:

I

 

 

 

 

 

 

 

 

 

 

 

 

 

Clock Cycles:

12

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Flag:

C – Not affected

 

 

 

 

 

 

 

Z– Not affected D – Not affected I – Not affected

Description: Loads 8-bit immediate data e into the data memory location addressed by IX and executes the RET command. X is incremented by 2.

Example:

 

RETD F5H

 

PCP

0000

0010

 

PCS

1010 1011

0010 1101

 

SP

BD

C0

 

Memory (SP)

1101

1101

 

Memory (SP+1)

0010

0010

 

Memory (SP+2)

0010

0010

 

X register

0010 1010

0010 1100

 

Memory (2AH)

0000

0101

 

Memory (2BH)

0000

1111

S1C6200/6200A CORE CPU MANUAL

EPSON

73