SUBCUL ACC,loc32
6-347
SUBCUL ACC,loc32
Subtract Conditional 32 Bits
SYNTAX OPTIONS
OPCODE
OBJMODE
RPT
CYC
SUBCUL ACC,loc32
0101 0110 0001 0111
0000 0000 LLLL LLLL
1
Y
N+1
Operands
ACC
Accumulator register
loc32
Addressing mode (see Chapter 5)
Description
Perform 32-bit conditional subtraction, which can be used for unsigned
modulus division:
temp(32:0) = ACC << 1 + P(31) − [loc32];
if( temp(32:0) >= 0 )
ACC = temp(31:0);
P = (P << 1) + 1;
else
ACC:P = ACC:P << 1;
To perform 32-bit unsigned modulus division, the ACC register is zeroed and
the P register is loaded with the ”Numerator” value prior to executing the
SUBCUL instruction. The value pointed to be the ”loc32” addressing mode
contains the ”Denominator” value. After executing the SUBCUL instruction
32 times, the ACC register will contain the ”Remainder” and the P register will
contain the ”Quotient” results. To perform signed modulus division, the
”Numerator” and ”Denominator” values must be converted to unsigned
quantities, before executing the SUBCUL instruction. The final ”Quotient”
result must be negated if the ”Numerator” and ”Denominator” values were of
different sign else the quotient is left unchanged.
Flags and
Modes
Z
At the end of the operation, the Z flag is set if the ACC value is zero, else Z is
cleared. The calculation of temp(32:0) has no effect on the Z bit.
N
At the end of the operation, the N flag is set if bit 31 of the ACC is 1, else N is
cleared. The calculation of temp(32:0) has no effect on the N bit.
C
If the calculation of temp(32:0) generates a borrow, C is cleared; otherwise C
is set.
Note:
The V and OVC flags are not affected by the operation.
Repeat
If this operation is repeated, then the instruction will be executed N+1 times.
The state of the Z, N, C flags will reflect the final result. The V flag will be set if
an intermediate overflow occurs. The OVC flag will count intermediate
overflows, if overflow mode is disabled.
Содержание 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...