Utils: Dixed Utils_IncrementCounter32, added Utils_IncrementCounter16.
This commit is contained in:
@@ -79,8 +79,9 @@ Utils_IncrementCounter32:
|
|||||||
ld r19, x+
|
ld r19, x+
|
||||||
ld r20, x+
|
ld r20, x+
|
||||||
ld r21, x
|
ld r21, x
|
||||||
clr r22
|
ldi r22, 1
|
||||||
inc r18
|
add r18, r22
|
||||||
|
clr r22 ; doesn't affect carry flag
|
||||||
adc r19, r22
|
adc r19, r22
|
||||||
adc r20, r22
|
adc r20, r22
|
||||||
adc r21, r22
|
adc r21, r22
|
||||||
@@ -92,6 +93,27 @@ Utils_IncrementCounter32:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; ***************************************************************************
|
||||||
|
; Increment a 16 bit counter at the address given by X.
|
||||||
|
; IN:
|
||||||
|
; - X: Address of the 2 byte counter (1. byte is LSB)
|
||||||
|
; OUT:
|
||||||
|
; - nothing
|
||||||
|
; MODIFIED REGISTERS: r18, r19, 22
|
||||||
|
|
||||||
|
Utils_IncrementCounter16:
|
||||||
|
ld r18, x+
|
||||||
|
ld r19, x
|
||||||
|
ldi r22, 1
|
||||||
|
add r18, r22
|
||||||
|
clr r22 ; doesn't affect carry flag
|
||||||
|
adc r19, r22
|
||||||
|
st x, r19
|
||||||
|
st -x, r18
|
||||||
|
ret
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; ***************************************************************************
|
; ***************************************************************************
|
||||||
; Utils_ReadEeprom
|
; Utils_ReadEeprom
|
||||||
|
|||||||
Reference in New Issue
Block a user