ABSTC ACC
6-21
Example
; Calculate signed: Quot16 = Num16/Den16, Rem16 = Num16%Den16
CLRC TC
; Clear TC flag, used as sign flag
MOV ACC,@Den16 << 16
; AH = Den16, AL = 0
ABSTC ACC
; Take abs value, TC = sign ^ TC
MOV T,@AH
; Temp save Den16 in T register
MOV ACC,@Num16 << 16
; AH = Num16, AL = 0
ABSTC ACC
; Take abs value, TC = sign ^ TC
MOVU ACC,@AH
; AH = 0, AL = Num16
RPT #15
; Repeat operation 16 times
||SUBCU ACC,@T
; Conditional subtract with Den16
MOV @Rem16,AH
; Store remainder in Rem16
MOV ACC,@AL << 16
; AH = Quot16, AL = 0
NEGTC ACC
; Negate if TC = 1
MOV @Quot16,AH
; Store quotient in Quot16
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...