MOTOROLA
DSP96002 USER’S MANUAL
B-185
abig sub d5,d6 ;c(r0) exponent is greater
cmp d6,d7 #31,d7.l ;is |r0(exp)-r1(exp)| > 63?
jmi aequala ;yes, then c(r0) + c(r1) = c(r0)
cmp d6,d7 #32,d7.l ;is |r0(exp)-r1(exp)| > 31?
jge dshiftx ;no, shift both c(r1) words
sub d7,d6 d2.l,d3.l ;yes, shift ms to ls
clr d2.l d6.l,d0.h ;# of shifts to be performed
lsr d0.h,d3 ;align the mantissas
;
; Add the two mantissas together
;
addmant move x:(r0+sign),d6.l ;get c(r0) sign
move x:(r1+sign),d7.l ;get c(r1) sign
cmp d7,d6 ;are the signs the same?
jmi apos ;c(r0) > 0 and c(r1) < 0
jeq signseq ;c(r0) and X have the same sign
;
; Calculate the result assuming that c(r1) > 0 and c(r0) < 0
;
aneg cmp d2,d0 ;compare mantissas
jne decid ;if ms’s are equal, test ls’s
cmp d3,d1 #0,d7.l ;compare ls of mantissas
jeq dp_clr ;clear reg_a if same magnitude
decid jcc r1fromr0 ;if c(r0) > c(r1), c(r0) - c(r1)
r0fromr1 move d7.l,x:(r0+sign) ;make sign positive
sub d1,d3 ;subtract c(r0) from c(r1)
subc d0,d2 d3.l,d1.l ;calculate c(r0)_ms
move d2.l,d0.l ;put result in c(r0) register
;
; Normalize the result
;
subnorm jeq msis0 ;test ms word
bfind d0,d0 ;find out how many zeros in ms
lsl d0.h,d0 d1.l,d2.l ;shift c(r0)_ms
lsl d0.h,d1 #32,d7.l ;shift c(r0)_ls
move d0.h,d3.l ;copy # of shifts
sub d3,d7 ;# of opposite dir. shifts
move d7.l,d0.h ;move # of shifts to .h reg.
lsr d0.h,d2 ;get bits to go from ls to ms
or d2,d0 ;shift in bits from ls to ms
sub d3,d4 ;decrement the exponent
jmp leave ;make sure the exp is valid
msis0 tst d1.l #32,d3.l ;test if ls is zero
jeq dp_clr ;zero reg_a if yes
bfind d1,d0 d1.l,d0.l ;find out how many zeros in ls
lsl d0.h,d0 d0.h,d2.l ;get bits to go from ls to ms
add d2,d3 ;include shifts from ms
sub d3,d4 #0,d1.l ;decrement the exponent
jmp leave ;make sure the exp is valid
signseq add d3,d1 ;add lower words
addc d2,d0 ;add upper words
addnorm jcc leave ;test for carry
ror d0.l ;normalize the sum
ror d1.l ;shift ms and ls
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: ......