Maxim-integrated MAX31782 Manual do Utilizador Página 173

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 223
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 172
Maxim Integrated 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.3 ALU Operations Using the Active Accumulator and a Source
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.4 ALU Operations Using Only the Active Accumulator
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
Vista de página 172
1 2 ... 168 169 170 171 172 173 174 175 176 177 178 ... 222 223

Comentários a estes Manuais

Sem comentários