Static Programming Rules

Rule D.2

Core or ISAP instructions that read or write the SR register, affect status bits in SR, or are affected by status bits in SR are not allowed in a RTED delay slot.

This rule applies to instructions that use the stack pointer SP (implicitly or explicitly) and other stack pointer OSP, since SR affects which stack pointer is used (EXP status bit).

Example 7-31. Instructions in a RTED Delay Slot

rted

 

;not allowed

move.l d0,sr

rted

 

;not allowed

move.l sr,d0

rted

 

;not allowed

bmset #1,sr.l

rted

d0

;not allowed, affected by SR[C]

rol

rted

d0

;not allowed, affected by SR[EXP]

push

rted

 

;not allowed, affected by SR[EXP]

bmclr.w #64,(sp-8)

rted

 

;not allowed, affects SR[T]

bmtsts.w #64,(r0)

rted

r0,osp

;not allowed, affected by SR[EXP]

tfra

rted

sp,r0

;not allowed, affected by SR[EXP]

tfra

rted

clr d0

;not allowed, affected by SR[T]

ift

rted

r0,r1

;allowed

tfra

rted

 

;changes T bit based on ISAP register - not allowed

{tsteq k0}

rted

 

;allowed

bmclr.w #64,(r0)

Rule D.3

Core or ISAP instructions that write the SR register or affect status bits in SR cannot be grouped in a VLES with a RTE/RTED instruction.

Example 7-32.

RTE/D with SR Updates

 

rte

add d0,d1,d2

;not allowed - affects the carry bit in SR

rte

{tsteq k0}

;not allowed - affects the T bit in SR

7-20

SC140 DSP Core Reference Manual

Page 270
Image 270
Freescale Semiconductor SC140 specifications Rule D.2, Rule D.3, Example 7-31. Instructions in a Rted Delay Slot