Texas Instruments MSP50C614 manual RET Return From Subroutine CALL, Ccc, Pc Tos

Models: MSP50C614

1 414
Download 414 pages 24.44 Kb
Page 243
Image 243

Individual Instruction Descriptions

4.14.56 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

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

R7 R7 ± 2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

TOS

*R7

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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.56.1

RET

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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

Assembly Language Instructions

4-151

Page 243
Image 243
Texas Instruments MSP50C614 manual RET Return From Subroutine CALL, Ccc, Pc Tos, See Also CALL, Ccc, Iret Example