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 #309 background imageLoading...
Page #309 background image
MAXL ACC,loc32
6-152
MAXL ACC,loc32 Find the 32-bit Maximum
SYNTAX OPTIONS OPCODE OBJMODE RPT CYC
MAXL ACC,loc32
0101 0110 0110 0001
0000 0000 LLLL LLLL
1 Y N+1
Operands ACC Accumulator register
loc32 Addressing mode (see Chapter 5)
Description Compare the content of the ACC register with the location pointed to by the
“loc32” addressing mode and load the ACC register with the larger of these
two values:
if(ACC < [loc32]), ACC = [loc32];
if(ACC >= [loc32]), ACC = unchanged;
Flags and
Modes
Z If ACC is equal to the contents of the addressed location (ACC = [loc32]), set
Z; otherwise, clear Z.
N If ACC is less then the contents of the addressed location, (ACC < [loc32]),
set N; otherwise clear N. The MAXL instruction assumes infinite precision
when it determines the sign of the result. For example, consider the
subtraction 0x8000 0000 0x0000 0001. If the precision were limited to 32
bits, the result would cause an overflow to the positive number 0x7FFF FFFF
and N would be cleared. However, because the MAXL instruction assumes
infinite precision, it would set N to indicate that 0x8000 0000 0x0000 0001
actually results in a negative number.
C If (ACC [loc32]) generates a borrow, clear the C bit; otherwise set C.
V If ACC is less then the contents of the addressed location (ACC < [loc32]),
set V. This instruction cannot clear the V flag.
Repeat This instruction is repeatable. If the operation follows a RPT instruction, then
the MAXL instruction will be executed N+1 times. The state of the Z, N, and C
flags will reflect the final result. The V flag will be set if an intermediate
overflow occurs.
Example
; Saturate VarA as follows:
; if(VarA > MaxPos) VarA = MaxPos
; if(VarA < MaxNeg) VarA = MaxNeg
MOVL ACC,@VarA ; ACC = VarA
MINL ACC,@MaxPos ; if(ACC > MaxPos) ACC = MaxPos
MAXL ACC,@MaxNeg ; if(ACC < MaxNeg) ACC = MaxNeg
MOVL @VarA,ACC ; Store result into VarA

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