Stereo System User Manual
MOTOROLA DSP96002 USER’S MANUAL B-71
Four 8 Bit Packs Program ICycles
Words
joinb d0,d1 ;d1 = xxAB 1 1
joinb d2,d3 ;d3 = xxCD 1 1
join d1,d3 ;d3 = ABCD 1 1
--- ---
Totals: 3 3
B.1.38.2 Pack Two 16 Bit Words Into a 32 Bit Word
The following packs two 16 bit words into a single 32 bit word. The words to be packed are right justified in
two separate registers:
d0 = xY d1 = xZ
Two 16 Bit Packs Program ICycles
Words
join d0,d1 ;d1 = YZ 1 1
--- ---
Totals: 1 1
B.1.38.3 Unpack a 32 Bit Word Into Four Sign-extended Bytes
The following unpacks a 32 bit word into four 8 bit sign-extended bytes in separate registers.
Four 8 Bit Unpacks Program ICycles
Words
move #data,d3.l ;get data
split d3,d1 ;d1=ssAB, d3=ABCD 1 1
splitb d1,d0 ;d0=sssA, d1=ssAB 1 1
extb d1 ;d1=sssB 1 1
splitb d3,d2 ;d2=sssC 1 1
extb d3 ;d3=sssD 1 1
--- ---
Totals: 5 5
B.1.38.4 Unpack a 32 Bit Word Into Two Sign-extended 16 Bit Words
The following unpacks a 32 bit word into two 16 bit sign-extended 16 bit words.
Two 16 Bit Unpacks Program ICycles
Words
move #data,d0.l ;get data
split d0,d1 ;d1=sX, d0=XY 1 1
ext d1 ;d1=sY 1 1
--- ---
Totals: 2 2