Motorola DSP56800 Manual page 8

16-bit digital signal processor
Table of Contents

Advertisement

8.1.1.5
Other Jumps and Branches on Condition Codes . . . . . . . . . . . . . . . . . . . . 8-4
8.1.2
Negation Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-4
8.1.2.1
NEGW Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-4
8.1.2.2
Negating the X0, Y0, or Y1 Data ALU registers . . . . . . . . . . . . . . . . . . . . 8-5
8.1.2.3
Negating an AGU register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-5
8.1.2.4
Negating a Memory Location . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-5
8.1.3
Register Exchanges. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-6
8.1.4
Minimum and Maximum Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-6
8.1.4.1
MAX Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-6
8.1.4.2
MIN Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-7
8.1.5
Accumulator Sign Extend . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-7
8.1.6
Unsigned Load of an Accumulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-7
8.2
16- and 32-Bit Shift Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-8
8.2.1
Small Immediate 16- or 32-Bit Shifts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-8
8.2.2
General 16-Bit Shifts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-8
8.2.3
General 32-Bit Arithmetic Right Shifts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-9
8.2.4
General 32-Bit Logical Right Shifts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-9
8.2.5
Arithmetic Shifts by a Fixed Amount. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-10
8.2.5.1
8.2.5.2
8.3
Incrementing and Decrementing Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-13
8.4
Division. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-13
8.4.1
Positive Dividend and Divisor with Remainder . . . . . . . . . . . . . . . . . . . . . . . 8-14
8.4.2
Signed Dividend and Divisor with No Remainder . . . . . . . . . . . . . . . . . . . . . 8-15
8.4.3
Signed Dividend and Divisor with Remainder . . . . . . . . . . . . . . . . . . . . . . . . 8-16
8.4.4
Algorithm Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-18
8.4.5
Overflow Cases. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-19
8.5
Multiple Value Pushes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-19
8.6
Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-20
8.6.1
Large Loops (Count Greater Than 63) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-20
8.6.2
Variable Count Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-21
8.6.3
Software Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-21
8.6.4
Nested Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-22
8.6.4.1
Recommendations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-22
8.6.4.2
Nested Hardware DO and REP Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-23
8.6.4.3
Comparison of Outer Looping Techniques . . . . . . . . . . . . . . . . . . . . . . . 8-24
8.6.5
Hardware DO Looping in Interrupt Service Routines . . . . . . . . . . . . . . . . . . 8-25
8.6.6
Early Termination of a DO Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-25
8.7
Array Indexes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-26
8.7.1
Global or Fixed Array with a Constant. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-26
8.7.2
Global or Fixed Array with a Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-27
8.7.3
Local Array with a Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-27
8.7.4
Local Array with a Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-27
8.7.5
Array with an Incrementing Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-27
8.8
Parameters and Local Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-28
8.9
Time-Critical DO Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-29
8.10
Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-30
viii
DSP56800 Family Manual

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents