Maxim-integrated MAX31782 Manual de usuario Pagina 171

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 223
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 170
19-6
MAX31782 User’s Guide
Revision 0; 8/11
19.5 Using the Arithmetic and Logic Unit
The MAX31782 provides a 16-bit ALU, which allows operations to be performed between the active accumulator and
any other register. The MAX31782 provides 16 accumulator registers, of which any one may be selected as the active
accumulator.
19.5.1 Selecting the Active Accumulator
Any of the 16 accumulator registers A[0] through A[15] may be selected as the active accumulator by setting the low
four bits of the
Accumulator Pointer Register (AP) to the index of the accumulator register you want to select.
move AP,#01h ;selectA[1]astheactiveaccumulator
move AP,#0Fh ;selectA[15]astheactiveaccumulator
The current active accumulator can be accessed as the Acc register, which is also the register used as the implicit
destination for all arithmetic and logical operations.
move A[0],#55h ;setA[0]
; =0055hex
move AP,#00h ;selectA[0]asactiveaccumulator
move Acc,#55h ;setA[0]
; =0055hex
19.5.2 Enabling Auto-Increment and Auto-Decrement
The accumulator pointer AP can be set to automatically increment or decrement after each arithmetic or logical opera-
tion. This is useful for operations involving a number of accumulator registers, such as adding or subtracting two mul-
tibyte integers.
If auto-increment/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)
Vista de pagina 170
1 2 ... 166 167 168 169 170 171 172 173 174 175 176 ... 222 223

Comentarios a estos manuales

Sin comentarios