Pc Relative Instructions - Motorola DSP56600 Manual

Application optimization for digital signal processors
Table of Contents

Advertisement

add
bra
_TRUE
add
_CONT
.....
Using conditional instructions, the code can be written more
compactly, as listed below:
cmp
Y0,a
add
b,x0
add
b,x1
The only difference between the two codes is that the Status
Register in the later option is not updated according to the
calculation result. Conditional execution with CCR update may in
some cases solve the problem, as in the following example:
btst
#0,a0
asr
a
Another example of using the CCR update is setting a complex
condition by accumulating simple comparison results. For example,
consider the high-level code line and its translation in assembly
listed below:
if (X0 < A && X1 < A) then {A=A+y0; b=b+y0}
cmp
X0,a
cmp
X1,a
add
y0,a
add
y0,b
3.6

PC RELATIVE INSTRUCTIONS

Many of the DSP56300 control instructions require a program
location as one of their arguments. The most obvious example is a
jump instruction, which needs the jump address. A strong feature of
the DSP56300 instruction set is the ability to reference program
locations relative to the Program Counter. Almost all instructions
that need program location arguments can be given both PC relative
and an absolute address. In the DSP56300 Family Manual , using
traditional mnemonic convention, jumps using PC relative
addressing are referred to as "branches", while those using absolute
addressing are referred to as "jumps".
MOTOROLA
Optimizing DSP56300/DSP56600 Applications
b,x1
_CONT
b,x0
IFeq
IFne
;CCR is updated according to the
IFcs.U
;value of A if the instruction
;was executed.
x:(r0),x1
;test for X0<a. parallel field
;used to set X1 for next cmp
IFgt.U
;test for X1<a only if the last
;condition was true.
IFgt
;A=A+y0,B=B+y0 only if both
;conditions were true.
IFgt
Program Control
PC Relative Instructions
3-13

Advertisement

Table of Contents
loading

This manual is also suitable for:

Dsp56300

Table of Contents