Individual Instruction Descriptions

4.14.57 RET

Return From Subroutine (CALL, Ccc)

 

 

 

 

 

 

 

 

 

 

 

 

Syntax

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

[label]

 

name

 

 

 

 

 

 

 

Clock, clk

Word, w

 

 

With RPT, clk

 

 

Class

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

RET

 

 

 

 

 

 

 

 

1

 

 

1

 

 

 

 

N/R

 

 

 

 

5

Execution

PC TOS

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

TOS

*R7

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

R7 R7 – 2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Flags Affected

None

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Opcode

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Instructions

 

16

15

 

14

13

12

11

 

10

9

8

7

6

 

5

 

4

3

2

 

1

 

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

RET

 

1

1

 

0

1

1

1

 

1

0

0

0

1

 

1

 

1

1

1

 

1

 

0

Description

Return from call or vectored call. Pop stack to program counter, continue

 

 

 

execution. Returns from subroutine calls (CALL, Ccc instructions) and

 

 

 

interrupts are different because of the way each process is handled. In order

 

 

 

to prevent execution pipeline problems the interrupt return (IRET) instruction

 

 

 

uses two cycles and the Return (RET) instruction cannot immediately follow

 

 

 

a CALL, i.e., RET followed by a RET should not be allowed.

 

 

 

 

 

 

See Also

CALL, Ccc, IRET

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Example 4.14.57.1

RET

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Returns from subroutine. A CALL or Ccc instruction must have executed before.

Assembly Language Instructions

4-153

Page 239
Image 239
Texas Instruments MSP50C6xx manual RET Return From Subroutine CALL, Ccc, Pc Tos, R7 R7 Flags Affected