CMPL ACC,loc32
6-80
CMPL ACC,loc32
Compare 32-bit Value
SYNTAX OPTIONS
OPCODE
OBJMODE
RPT
CYC
CMPL ACC,loc32
0000 1111 LLLL LLLL
X
−
1
Operands
ACC
Accumulator register
loc32
Addressing mode (see Chapter 5)
Description
The content of the ACC register is compared with the 32-bit location pointed to
by the “loc32” addressing mode. The status flag bits are set according to the
result of (ACC
−
[loc32]). The ACC register and the contents of the location
pointed to by “loc32” are left unchanged:
Modify flags on (ACC − [loc32]);
Flags
and
Modes
N
If the result of the operation is negative, then N is set; otherwise it is cleared.
The CMPL 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 CMPL instruction assumes infinite precision, it would
set N to indicate that 0x8000 0000
−
0x0000 0001 actually results in a
negative number.
Z
The comparison is tested for a zero condition. The zero flag bit is set if the
operation (AX
−
[loc32]) = 0, otherwise it is cleared.
C
If the subtraction generates a borrow, C is cleared; otherwise C is set.
Repeat
This instruction is not repeatable. If this instruction follows the RPT
instruction, it resets the repeat counter (RPTC) and executes only once.
Example
; Swap the contents of 32-bit VarA and VarB if VarB is higher:
MOVL ACC,@VarB
; ACC = VarB
MOVL P,@VarA
; P = VarA
CMPL ACC,@P
; Set flags on (VarB - VarA)
MOVL @VarA,ACC,HI
; VarA = ACC if higher
MOVL @P,ACC,HI
; P = ACC if higher
MOVL @VarA,P
; VarA = P
Содержание 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...