Freescale Semiconductor SC140 specifications Example rtstkd, Instruction Words Cycles1 Type

Models: SC140

1 760
Download 760 pages 48.94 Kb
Page 691
Image 691

RTSTKD

Example rtstkd

Instruction

Comment

 

- - -

Jump to subroutine at SUB. Push the PC and SR onto the

 

jsr SUB

 

stack.

 

- - -

Skip over these instructions.

SUB

MOVE.w #$16,d4

Execute the subroutine here.

 

- - -

Change the original value in the stack for PC to lbl.

 

move.w #lbl,(SP-8)

 

rtstk move.l #$35,d1Restore the new value lbl to PC. Load $35 into d1. Incre-

 

inc d1

ment d1 to $36, the delay slot instruction.

 

move.l #$16,d5

This instruction skipped.

lbl

move.l #$16,d6

Continue executing here.

Instruction Formats and Opcodes

Instruction

Words

Cycles1

Type

RTSTKD

1

5/6

4

Opcode

15

 

 

 

 

 

 

8

7

 

 

 

 

 

 

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1

0

0

1

1

1

1

1

0

1

1

1

0

1

0

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Note 1: RTSTKD uses 5 cycles if shadow SP is valid. RTSTKD uses 6 cycles if the shadow SP is not valid. To get the correct cycle count for this instruction, subtract the execution time used by the execution set in the delay slot. The cycle count for this instruction cannot be less than 2 cycles.

SC140 DSP Core Reference Manual

A-377

Page 691
Image 691
Freescale Semiconductor SC140 specifications Example rtstkd, Instruction Words Cycles1 Type