Motorola DSP56305 Bedienungsanleitung Seite 42

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 112
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 41
Program Control
PC Relative Instructions
MOTOROLA Optimizing DSP56300/DSP56600 Applications 3-13
add b,x1
bra _CONT
_TRUE
add b,x0
_CONT
.....
Using conditional instructions, the code can be written more
compactly, as listed below:
cmp Y0,a
add b,x0 IFeq
add b,x1 IFne
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 ;CCR is updated according to the
asr a IFcs.U ;value of A if the instruction
;was executed.
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 x:(r0),x1 ;test for X0<a. parallel field
;used to set X1 for next cmp
cmp X1,a IFgt.U ;test for X1<a only if the last
;condition was true.
add y0,a IFgt ;A=A+y0,B=B+y0 only if both
;conditions were true.
add y0,b IFgt
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”.
Seitenansicht 41
1 2 ... 37 38 39 40 41 42 43 44 45 46 47 ... 111 112

Kommentare zu diesen Handbüchern

Keine Kommentare