SUBCUL ACC,loc32
6-349
Example 4
; Calculate signed: Quot64 = Num364Den32, Rem32 = Num64%Den32
MOVL ACC,@Num64+2
; Load ACC:P with 64-bit numerator
MOVL P,@Num64+0
TBIT @AH,#15
; TC = sign of numerator
SBF $10,NTC
; Take absolute value of numerator
NEG64 ACC:P
$10:
MOVL @XAR3,P
; Temp save numerator low in XAR3
MOVL P,@ACC
; Load P register with numerator high
MOVL ACC,@Den32
; Load ACC with contents of Den32
ABSTC ACC
; Take absolute value, TC = sign ^ TC
MOVL XT,@ACC
; Temp save denominator in XT register
MOVB ACC,#0
; Zero ACC
RPT #31
; Repeat operation 32 times
||SUBCUL ACC,@XT
; Conditional subtract with denominator
MOVL @XAR4,P
; Store high quotient in XAR4
MOVL P,@XAR3
; Load P with low numerator
RPT #31
; Repeat operation 32 times
||SUBCUL ACC,@XT
; Conditional subtract with denominator
MOVL @Rem32,ACC
; Store remainder in Rem32
MOVL ACC,@XAR4
; Load ACC with high quotient from XAR4
SBF $20,NTC
; Take absolute value of quotient
NEG64 ACC:P
$20:
MOVL @0,P
; Store low quotient into Quot64
MOVL @2,ACC
; Store high quotient into Quot64
Summary of Contents for TMS320C28x
Page 30: ...1 12...
Page 80: ...This page intentionally left blank 2 50 This page intentionally left blank...
Page 269: ...IN loc16 PA 6 112 MOV AL 0 AL 0 UOUT IORegC AL IOspace IORegC AL 10...
Page 308: ...MAXCUL P loc32 6 151 Saturate MOVL Var64 2 ACC Store result into Var64 MOVL Var64 P...
Page 509: ...SUBL ACC P PM 6 352 SUBL ACC P PM ACC S B 11 M X 4 MOVH Y ACC 5 Store Q15 result into Y...
Page 585: ...This page intentionally left blank 7 32 This page intentionally left blank...