EasyManuals Logo

Texas Instruments TMS320C28x User Manual

Texas Instruments TMS320C28x
695 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #178 background imageLoading...
Page #178 background image
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

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments TMS320C28x and is the answer not in the manual?

Texas Instruments TMS320C28x Specifications

General IconGeneral
BrandTexas Instruments
ModelTMS320C28x
CategoryProcessor
LanguageEnglish

Related product manuals