Download DSP56303EVM Users Manual

Transcript
Freescale Semiconductor, Inc.
Structured Control Statements
Example C-82. .BREAK Statement
.WHILE
.
.
.
.IF
.BREAK
.ENDI
.
.
.
.ENDW
x:(r1)+ <GT> #0;loop until zero is found
<cs>
;causes exit from WHILE loop
;any instructions here are skipped
Freescale Semiconductor, Inc...
;execution resumes here after .BREAK
C.4.2.2 .CONTINUE Statement
.CONTINUE
The .CONTINUE statement causes the next iteration of a looping construct (“.WHILE”,
“.REPEAT”, “.FOR”, “.LOOP”) to begin. This means that the loop expression or operand
comparison is performed immediately, bypassing any subsequent instructions. If a
.CONTINUE is encountered with no loop statement active, a warning is issued.
Note:
.CONTINUE should be used with care near .ENDL directives or near the end of DO
loops. It generates a jump instruction which is illegal in those contexts. One or more
.CONTINUE directives inside a .LOOP construct will generate a NOP instruction just
before the loop address.
Example C-83. .CONTINUE Statement
.REPEAT
.
.
.
.IF
.CONTINUE
.ENDI
.
.
.
.UNTIL
<cs>
;causes immediate jump to .UNTIL
;any instructions here are skipped
x:(r1)+ <EQ> #0;evaluation here after .CONTINUE
C.4.2.3 .FOR Statement
.FOR <op1> = <op2>
<stmtlist>
.ENDF
{TO | DOWNTO} <op3> [BY <op4>] [DO]
Initialize <op1> to <op2> and perform <stmtlist> until <op1> is greater (TO) or less than
(DOWNTO) <op3>. Makes use of a user-defined operand, <op1>, to serve as a loop
counter. .FOR-TO allows counting upward, while .FOR-DOWNTO allows counting
DSP56303EVM User’s Manual
For More Information On This Product,
Go to: www.freescale.com