Dynamic Programming Rules

7.6.3 RAS Rules

Rule J.4

Upon execution of the RTS or RTSD instruction, if the RAS is valid, the value of the RAS (used to restore the PC) must be equal to the value in the stack, pointed to by the SP, that would have been used if the RAS was not valid.

The following case manipulates the SP and builds on the return address using RAS:

Example 7-81. Illegal use of RAS value

move.l d6,(sp-8) adda #<8,sp

; not allowed since RAS may be valid

rts move.l d7,(sp-$c)

7.6.4 Loop Rules

The loop COF instructions produce undefined results if all loops are disabled. Since the assembler cannot know the LFn state when these instructions execute, the simulator detects this programming rule. Good loop programming practices can ensure that rule L.N.6 is enforced.

Rule L.N.6

Loop COF instructions (BREAK, CONT, CONTD, and SKIPLS) cannot be used if all loops are disabled.

SC140 DSP Core Reference Manual

7-43

Page 293
Image 293
Freescale Semiconductor SC140 RAS Rules, Loop Rules, Rule J.4, Rule L.N.6, Example 7-81. Illegal use of RAS value