Program Control
Conditional execution
- XC n, cond [, cond [, cond ]] ; 23 possible conditions
- Executes next n (1 or 2) words if conditions (cond) are met
- Takes one cycle to execute
xc 1,ALEQ ; test for accumulator a £ 0 mac *ar1+,*ar2+,a ; perform MAC only if a £ 0 add #12,a,a ; always perform add
- Repeat single instruction or block
- Overhead: 1 cycle for RPT/RPTZ and 4 cycles for RPTB
- Hardware loop counters count down
rptz a,#39 ; zero accumulator a ; repeat next instruction 40 times
mac *ar2+,*ar3+,a ; a += a(n) * x(n)