Motorola DSP96002 User Manual page 568

32-bit digital signal processor
Table of Contents

Advertisement

The following code assumes a rotating model of the form:
In this model, the carry does not participate in the rotations. The carry assumes the value of the bit that was
rotated around the end of the register.
1.
Static rotate left 0-32 bits. The 32 bit integer to be rotated is in d0.l. The number of bits to rotate
is N. The resulting carry is the value of bit 32-N of the register. For example, if N=3 (three bit
rotate left), then the resulting carry will be the value of bit 29 of the register. The resulting carry
is the value of the least significant bit of the register after rotation.
In the special case of a zero shift count, the resulting carry is the most significant bit. In the
special case of a 32 shift count, the resulting carry is the least significant bit. In both cases, the
register shifted is unchanged.
move
#32-N,d0
;shift other part
bits together
Totals:
2.
Static rotate right 0-32 bits. The 32 bit integer to be rotated is in d0.l. The number of bits to
rotate is N. The resulting carry is the value of bit N-1 of the register. For example, if N=3 (three
bit rotate right), then the resulting carry will be the value of bit 2 of the register. The resulting
carry is the value of the most significant bit of the register after rotation.
In the special case of a zero shift count, the resulting carry is the least significant bit. In the
special case of a 32 shift count, the resulting carry is the most significant bit. In both cases, the
register shifted is unchanged.
move
#32-N,d0
MOTOROLA
31
d0.l,d1.l
;shift first part
1
1
1
4
4
d0.l,d1.l
;shift first part
DSP96002 USER'S MANUAL
C
;copy input
1
1
1
or
d1,d0
---
---
;copy input
1
1
Totals:
10
10
0
Program
ICycles
Words
1
1
lsl
#N,d1
Program
ICycles
Words
1
1
lsr
#N,d1
lsr
;merge
lsl
B-49

Advertisement

Table of Contents
loading

Table of Contents