beautypg.com

Texas Instruments MSC1210 User Manual

Page 305

background image

8052 Instruction Set

E-21

8052 Instruction Set

RET

Return from Subroutine

Syntax

RET

Instructions

OpCode

Bytes

Cycles

Flags

RET

0x22

1

2

None

RET is used to return from a subroutine previously called by LCALL or ACALL.
Program execution continues at the address that is calculated by POPping the
top-most two bytes off the stack. The most-significant byte is POPped off the
stack first, followed by the least-significant byte.

See also: LCALL, ACALL, RETI

RETI

Return from Interrupt

Syntax

RETI

Instructions

OpCode

Bytes

Cycles

Flags

RETI

0x32

1

2

None

RETI is used to return from an interrupt service routine. RETI first enables in-
terrupts of equal and lower priorities to the interrupt that is terminating. Pro-
gram execution continues at the address that is calculated by POPping the
top−most 2 bytes off the stack. The most-significant byte is POPped off the
stack first, followed by the least-significant byte.

RETI functions identically to RET if it is executed outside of an interrupt service
routine.

See also: RET

RL

Rotate Accumulator Left

Syntax

RL A

Instructions

OpCode

Bytes

Cycles

Flags

RL A

0x23

1

1

C

RL shifts the bits of the accumulator to the left. The left-most bit (bit 7) of the
accumulator is loaded into bit 0.

See also: RLC, RR, RRC