Instruction Manual

3-7 ___________________________________________________________________________________________________________
MAXQ7667 Users Guide
3.5.2 Enabling Autoincrement and Autodecrement
The accumulator pointer AP can be set to automatically increment or decrement after each arithmetic or logical operation. This is use-
ful for operations involving a number of accumulator registers, such as adding or subtracting two multibyte integers.
If autoincrement/decrement is enabled, the AP register increments or decrements after any of the following operations:
ADD src (Add source to active accumulator)
ADDC src (Add source to active accumulator with carry)
SUB src (Subtract source from active accumulator)
SUBB src (Subtract source from active accumulator with borrow)
AND src (Logical AND active accumulator with source)
OR src (Logical OR active accumulator with source)
XOR src (Logical XOR active accumulator with source)
CPL (Bit-wise complement active accumulator)
NEG (Negate active accumulator)
SLA (Arithmetic shift left on active accumulator)
SLA2 (Arithmetic shift left active accumulator two bit positions)
SLA4 (Arithmetic shift left active accumulator four bit positions)
SRA (Arithmetic shift right on active accumulator)
SRA2 (Arithmetic shift right active accumulator two bit positions)
SRA4 (Arithmetic shift right active accumulator four bit positions)
RL (Rotate active accumulator left)
RLC (Rotate active accumulator left through Carry flag)
RR (Rotate active accumulator right)
RRC (Rotate active accumulator right through Carry flag)
SR (Logical shift active accumulator right)
MOVE Acc, src (Copy data from source to active accumulator)
MOVE dst, Acc (Copy data from active accumulator to destination)
MOVE Acc, Acc (Recirculation of active accumulator contents)
XCHN (Exchange nibbles within each byte of active accumulator)
XCH (Exchange active accumulator bytes)
The active accumulator may not be the source in any instruction where it is also the implicit destination.
There is an additional notation that can be used to refer to the active accumulator for the instruction "MOVE dst, Acc." If the instruction
is instead written as "MOVE dst, A[AP]," the source value is still the active accumulator, but no AP autoincrement or autodecrement
function will take place, even if this function is enabled. Note that the active accumulator may not be the destination for the MOVE dst,
A[AP] instruction (i.e., MOVE Acc, A[AP] is prohibited).
So, the two instructions
move A[7], Acc
move A[7], A[AP]
are equivalent, except that the first instruction triggers autoinc/dec (if it is enabled), while the second one will never do so.