ADDCL ACC,loc32
6-34
ADDCL ACC,loc32 Add 32-bit Value Plus Carry to Accumulator
SYNTAX OPTIONS OPCODE OBJMODE RPT CYC
ADDCL ACC,loc32
0101 0110 0100 0000
xxxx xxxx LLLL LLLL
1 − 1
Operands ACC Accumulator register
loc32 Addressing mode (see Chapter 5)
Description Add to the ACC register the 32-bit content of the location pointed to by the
“loc32” addressing mode:
ACC = ACC + [loc32] + C;
Flags and
Z
After the addition, the Z flag is set if the ACC is zero, else Z is cleared.
Modes
N
After the addition, the N flag is set if bit 31 of the ACC is 1, else N is cleared.
C
The state of the carry bit before execution is included in the addition. If the
addition generates a carry, C is set; otherwise C is cleared.
V
If an overflow occurs, V is set; otherwise V is not affected.
OVC
If (OVM = 0, disabled) then if the operation generates a positive overflow,
then the counter is incremented and if the operation generates a negative
overflow, then the counter is decremented. If (OVM = 1, enabled) then the
counter is not affected by the operation.
OVM
If overflow mode bit is set; then the ACC value will saturate maximum
positive (0x7FFFFFFF) or maximum negative (0x80000000) if the operation
overflows.
Repeat This instruction is not repeatable. If this instruction follows the RPT
instruction, it resets the repeat counter (RPTC) and executes only once.
Example
; Add two 64-bit values (VarA and VarB) and store result in VarC:
MOVL ACC,@VarA+0 ; Load ACC with contents of the low
; 32 bits of VarA
ADDUL ACC,@VarB+0 ; Add to ACC the contents of the low
; 32 bits of VarB
MOVL @VarC+0,ACC ; Store low 32-bit result into VarC
MOVL ACC,@VarA+2 ; Load ACC with contents of the high
; 32 bits of VarA
ADDCL ACC,@VarB+2 ; Add to ACC the contents of the high
; 32 bits of VarB with carry
MOVL @VarC+2,ACC ; Store high 32-bit result into VarC