Texas Instruments TMS320C28x Reference Manual page 312

Dsp cpu and instruction set
Table of Contents

Advertisement

MINL ACC,loc32
SYNTAX OPTIONS
MINL ACC,loc32
Operands
ACC
loc32
Description
Flags and
Z
Modes
N
C
V
Repeat
Example
; Saturate VarA as follows:
; if(VarA > MaxPos) VarA = MaxPos
; if(VarA < MaxNeg) VarA = MaxNeg
MOVL
MINL
MAXL
MOVL
0101 0110 0101 0000
0000 0000 LLLL LLLL
Accumulator register
Addressing mode (see Chapter 5)
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 = unchanged;
if(ACC > [loc32]), ACC = [loc32];
If ACC is equal to the contents of the addressed location (ACC = [loc32]), set
Z; otherwise clear Z.
If ACC is less then the contents of the addressed location, (ACC < [loc32]),
set N; otherwise clear N. The MINL 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 MINL instruction assumes
infinite precision, it would set N to indicate that 0x8000 0000 − 0x0000 0001
actually results in a negative number.
If (ACC − [loc32]) generates a borrow, clear the C bit; otherwise set C.
If ACC is less then the contents of the addressed location (ACC < [loc32]),
set V. This instruction cannot clear the V flag.
This instruction is repeatable. If the operation follows a RPT instruction, then
the MINL 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.
ACC,@VarA
ACC,@MaxPos
ACC,@MaxNeg
@VarA,ACC
Find the 32-bit Minimum
OPCODE
OBJMODE
; ACC = VarA
; if(ACC > MaxPos) ACC = MaxPos
; if(ACC < MaxNeg) ACC = MaxNeg
; Store result into VarA
MINL ACC,loc32
RPT
CYC
1
Y
N+1
6-155

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Subscribe to Our Youtube Channel

Table of Contents

Save PDF