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
Содержание TMS320C28x
Страница 30: ...1 12...
Страница 80: ...This page intentionally left blank 2 50 This page intentionally left blank...
Страница 269: ...IN loc16 PA 6 112 MOV AL 0 AL 0 UOUT IORegC AL IOspace IORegC AL 10...
Страница 308: ...MAXCUL P loc32 6 151 Saturate MOVL Var64 2 ACC Store result into Var64 MOVL Var64 P...
Страница 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...
Страница 585: ...This page intentionally left blank 7 32 This page intentionally left blank...