3 ras rules, 4 loop rules, Ras rules -43 – Freescale Semiconductor StarCore SC140 User Manual

Page 293: Loop rules -43, Illegal use of ras value -43

Advertising
background image

Dynamic Programming Rules

SC140 DSP Core Reference Manual

7-43

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
rts move.l d7,(sp-$c)

; not allowed since RAS may be valid

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.

Advertising