![Maxim Integrated MAX31782 Скачать руководство пользователя страница 173](http://html1.mh-extra.com/html/maxim-integrated/max31782/max31782_user-manual_1744481173.webp)
MaximIntegrated 19-8
MAX31782 User’s Guide
Revision 0; 8/11
For this example, assume that all 16 accumulator registers are initially set to zero .
move
AP, #02h
; select A[2] as active accumulator
move
APC, #02h
; auto-increment AP[1:0] modulo 4
;
AP
A[0] A[1] A[2] A[3]
;
02
0000 0000 0000 0000
add
#01h
;
03
0000 0000 0001 0000
add
#02h
;
00
0000 0000 0001 0002
add
#03h
;
01
0003 0000 0001 0002
add
#04h
;
02
0003 0004 0001 0002
add
#05h
;
03
0003 0004 0006 0002
19.5.3ALUOperationsUsingtheActiveAccumulatorandaSource
The following arithmetic and logical operations can use any register or immediate value as a source . The active accu-
mulator Acc is always used as the second operand and the implicit destination . Also, Acc may not be used as the
source for any of these operations .
add
A[4]
; Acc = Acc + A[4]
addc
#32h
; Acc = Acc + 0032h + Carry
sub
A[15]
; Acc = Acc – A[15]
subb
A[1]
; Acc = Acc – A[1] – Carry
cmp
#00h
; If (Acc == 0000h), set Equals flag
and
A[0]
; Acc = Acc AND A[0]
or
#55h
;
Acc = Acc OR #0055h
xor
A[1]
;
Acc = Acc XOR A[1]
19.5.4ALUOperationsUsingOnlytheActiveAccumulator
The following arithmetic and logical operations operate only on the active accumulator .
cpl
; Acc = NOT Acc
neg
; Acc = (NOT Acc) + 1
rl
; Rotate accumulator left (not using Carry)
rlc
; Rotate accumulator left through Carry
rr
; Rotate accumulator right (not using Carry)
rrc
; Rotate accumulator right through Carry
sla
; Shift accumulator left arithmetically once
sla2
; Shift accumulator left arithmetically twice
sla4
; Shift accumulator left arithmetically four times
sr
; Shift accumulator right, set Carry to Acc.0,
; set Acc.15 to zero
sra
; Shift accumulator right arithmetically once
sra2
; Shift accumulator right arithmetically twice
sra4
; Shift accumulator right arithmetically four times
xchn
; Swap low and high nibbles of each Acc byte
xch
; Swap low byte and high byte of Acc