Min Operation; Accumulator Sign Extend; Unsigned Load Of An Accumulator - Motorola DSP56800 Manual

16-bit digital signal processor
Table of Contents

Advertisement

8.1.4.2

MIN Operation

The MIN operation can be emulated as shown in the following code:
; MIN Operation
MIN
;
------ becomes ------
; MIN Operation
; Emulated at 4 Icyc
CMP
TLT
8.1.5

Accumulator Sign Extend

There are two versions of this operation. In the first, the accumulator only contains 16 bits of useful
information in A1 or B1, and it is necessary to sign extend into A2 or B2. In the second version, both A1
and A0 or B1 and B0 contain useful information. The following code shows both versions:
; Sign-Extension Operation of 16-bit Accumulator Data
; Emulated in 1 Icyc, 1 Instruction Words
MOVE
; Sign-Extension Operation of 32-bit Accumulator Data
; Emulated in 4 Icyc, 4 Instruction Words
PUSH
MOVE
POP
8.1.6

Unsigned Load of an Accumulator

The unsigned load of an accumulator, which zeros the LSP and extension register, can be exactly emulated
as shown in the following code:
; DSP56100 Family Unsigned Load
; Emulated at 2 Icyc
MOVE
ZERO
;
------ becomes ------
; DSP56800 Family Unsigned Load
; Emulated at 2 Icyc
CLR
MOVE
This operation is important for processing unsigned numbers when the CC bit in the operating mode
register (OMR) register is a 0, so that the condition codes are set using information at bit 35. This operation
is useful for performing unsigned additions and subtractions on 36-bit values.
Y0,A
Y0,A
Y0,A
; (can also use TLE if desired)
A1,A
; Sign extend into A2, clear A0 register
A0
; Save A0 register
A1,A
; Sign extend into A2, clear A0 register
A0
; Restore A0 register to correct contents
x:(R0),A
A
A
x:(R0),A1
Software Techniques
Useful Instruction Operations
8-7

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents