MOTOROLA
DSP96002 USER’S MANUAL
B-51
Program
ICycles
Words
move #32,d1.l ;get 32 1 1 sub
d2,d1 d2.l,d1.h ;32-shift, move shift 1 1 move
d1.l,d0.h ;move other shift 1 1 lsl d0,d0 d0.l,d1.l
;shift, copy input 1 1 lsr d1,d1 ;shift
other part 1 1 or d1,d0 ;merge bits
together 1 1
--- ---
Totals: 6 6
B.1.28 Bit Field Extraction/Insertion
The process of bit field extraction is performed on a 32 bit integer in the lower part of a register. A bit field
of length FSIZE starting at bit position FOFF is extracted and right justified with zero or sign extension. The
value of FSIZE ranges from 1-32 and the field offset ranges from 0-31. Bit field extraction and insertion
operations are used in high level languages such as "structures" in C. Both the static case (extraction
based on fixed constants) and the dynamic case (extraction based on the values in registers) are given. In
the examples, the field to be extracted is in d0.l.
The process of bit field insertion is performed on two 32 bit integer registers. A bit field of length FSIZE
from one register is shifted left by an offset FOFF and the field is then inserted into the second register.
The field size FSIZE ranges from 1-32 and the field offset from the right of the register ranges from 0-31.
For meaningful results, FSIZE+FOFF is less than or equal to 32. The bit field to insert is right justified in
the register with zero extension to 32 bits. Both the static case (extraction based on fixed constants) and
the dynamic case (extraction based on the values in registers) are given. In the examples, the field in d1.l
is inserted into d0.l.
1. Static bit field extraction, zero extend.
Program
ICycles
Words
lsl #32-(foff+fsize),d0 ;shift off upper bits 1 1 lsr
#32-fsize,d0 ;right justify 1 1
--- ---
Totals: 2 2
2. Static bit field extraction, sign extend.
Program
ICycles
Words
lsl #32-(foff+fsize),d0 ;shift off upper bits 1 1
asr #32-fsize,d0 ;right justify, sign ext 1 1
--- ---
Totals: 2 2
Summary of Contents for DSP96002
Page 3: ...1 2 DSP96002 USER S MANUAL MOTOROLA ...
Page 38: ...MOTOROLA DSP96002 USER S MANUAL 3 15 Figure 3 4 Modulo Arithmetic Unit Block Diagram ...
Page 39: ...3 16 DSP96002 USER S MANUAL MOTOROLA ...
Page 53: ...4 14 DSP96002 USER S MANUAL MOTOROLA ...
Page 76: ...MOTOROLA DSP96002 USER S MANUAL 5 23 Figure 5 8 Address Modifier Summary ...
Page 86: ...6 10 DSP96002 USER S MANUAL MOTOROLA ...
Page 101: ...MOTOROLA DSP96002 USER S MANUAL 7 15 Figure 7 9 HI Block Diagram One Port ...
Page 140: ...7 54 DSP96002 USER S MANUAL MOTOROLA ...
Page 166: ...9 10 DSP96002 USER S MANUAL MOTOROLA ...
Page 181: ...MOTOROLA DSP96002 USER S MANUAL 10 15 Figure 10 8 Program Address Bus FIFO ...
Page 337: ...MOTOROLA DSP96002 USER S MANUAL A 149 ...
Page 404: ...A 216 DSP96002 USER S MANUAL MOTOROLA PC xxxx D ...
Page 460: ...A 272 DSP96002 USER S MANUAL MOTOROLA SIOP Not affected ...
Page 484: ...A 296 DSP96002 USER S MANUAL MOTOROLA SSH PC SSL SR SP 1 SP ...
Page 519: ...MOTOROLA DSP96002 USER S MANUAL A 331 ...
Page 718: ...MOTOROLA DSP96002 USER S MANUAL B 199 ...
Page 871: ... MOTOROLA INC 1994 MOTOROLA TECHNICAL DATA SEMICONDUCTOR M Addendum ...
Page 888: ...MOTOROLA INDEX 1 INDEX ...
Page 889: ......