beautypg.com

Maxq610 user’s guide – Maxim Integrated MAXQ610 User Manual

Page 43

background image

3-8

MAXQ610 User’s Guide

• SRA4

(Arithmetic shift right active accumulator 4 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 cannot 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 takes place, even if this function is enabled . Note that the active accumulator
cannot be the destination for the MOVE dst, A[AP] instruction (i .e ., MOVE Acc, A[AP] is prohibited) .
So, the following two instructions are equivalent, except that the first instruction triggers autoincrement/decrement (if it
is enabled), while the second one would never do so .

move A[7], Acc
move A[7], A[AP]

The accumulator pointer control register (APC) is used to control the automatic increment/decrement mode as well as
select the range of bits (modulo) in the AP register that are to be incremented or decremented . There are 10 unique
settings for the APC register, as listed in Table 3-1 .

For the modulo increment or decrement operation, the selected range of bits in AP are incremented or decremented .
However, if these bits roll over or under, they simply wrap around without affecting the remaining bits in the accumulator
pointer . So, the operations can be defined as follows:
• Increment modulo 2: AP = AP[3:1] + ((AP[0] + 1) mod 2)
• Decrement modulo 2: AP = AP[3:1] + ((AP[0] - 1) mod 2)
• Increment modulo 4: AP = AP[3:2] + ((AP[1:0] + 1) mod 4)
• Decrement modulo 4: AP = AP[3:2] + ((AP[1:0] - 1) mod 4)

Table 3-1. Accumulator Pointer Control Register Settings

APC.2

(MOD2)

APC.1

(MOD1)

APC.0

(MOD0)

APC.6

(IDS)

APC

AUTOINCREMENT/DECREMENT SETTING

0

0

0

0

00h

No autoincrement/decrement (default mode)

0

0

1

0

01h

Increment bit 0 of AP (modulo 2)

0

0

1

1

41h

Decrement bit 0 of AP (modulo 2)

0

1

0

0

02h

Increment bits [1:0] of AP (modulo 4)

0

1

0

1

42h

Decrement bits [1:0] of AP (modulo 4)

0

1

1

0

03h

Increment bits [2:0] of AP (modulo 8)

0

1

1

1

43h

Decrement bits [2:0] of AP (modulo 8)

1

0

0

0

04h

Increment all 4 bits of AP (modulo 16)

1

0

0

1

44h

Decrement all 4 bits of AP (modulo 16)