Incrementing And Decrementing Operations; Division - Motorola DSP56800 Manual

16-bit digital signal processor
Table of Contents

Advertisement

8.3

Incrementing and Decrementing Operations

Almost any piece of data can be incremented or decremented. This section summarizes the different
increments and decrements available to both registers and memory locations. It is important to note the
LEA instruction, which is used to increment or decrement AGU pointer registers. The TSTW instruction is
also used for decrementing AGU pointer registers. This instruction is similar to LEA but also sets the
condition codes, making it useful for program looping and other tasks. The LEA and TSTW instructions do
not cause a pipeline dependency in the AGU (see Section 4.4, "Pipeline Dependencies," on page 4-33).
The TSTW instruction is not available for incrementing an AGU pointer or for decrementing the SP
register.
; Different ways to increment on the DSP56800 core
INCW
INCW
LEA
INCW
INCW
INCW
; Different ways to decrement on the DSP56800 core
DECW
DECW
LEA
TSTW
DECW
DECW
DECW
The many different techniques available help to prevent registers from being destroyed. Otherwise, as
found on other architectures, it is necessary to first move data to an accumulator to perform an increment.
8.4

Division

It is possible to perform fractional or integer division on the DSP56800 core. There are several questions to
consider when implementing division on the DSP core:
Are both operands always guaranteed to be positive?
Are operands fractional or integer?
Is only the quotient needed, or is the remainder needed as well?
Will the calculated quotient fit in 16 bits in integer division?
Are the operands signed or unsigned?
How many bits of precision are in the dividend?
What about overflow in fractional and integer division?
Will there be "integer division" effects?
In a division equation, the "dividend" is the numerator, the "divisor" is the
denominator, and the "quotient" is the result.
A
; on a Data ALU Accumulator
X0
; on a Data ALU Input Register
(Rn)+
; on an AGU pointer register (R0-R3 or SP)
X:$0
; on anywhere within the first 64 locations
; of X data memory
X:$C200
; on anywhere within the entire 64K locations
; of X data memory
X:(SP-37)
; on a value located on the stack
A
; on a Data ALU Accumulator
X0
; on a Data ALU Input Register
(Rn)-
; on an AGU pointer register (R0-R3 or SP)
(Rn)-
; on an AGU pointer register (R0-R3)
X:$0
; on anywhere within the first 64 locations
; of X data memory
X:$C200
; on anywhere within the entire 64K locations
; of X data memory
X:(SP-37)
; on a value located on the stack
Software Techniques
Incrementing and Decrementing Operations
NOTE:
8-13

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents