use register r25 instead of r26 (r26 is XL!)

This commit is contained in:
Martin Preuss
2026-01-18 14:25:48 +01:00
parent e9f1aec122
commit 276fd28782

View File

@@ -27,14 +27,14 @@
; @param R23:R22 16 bit value B
; @return R17:R16 16 bit result
; @return R19:R18 16 bit remainder
; @clobbers
; @clobbers R25
Utils_Divu16_16_16:
mov r16, r20 ; r17:r16=result (intitially: dividend)
mov r17, r21
clr r18 ; r19:r18=remainder
clr r19
ldi r26, 16 ; 16 bits to divide
ldi r25, 16 ; 16 bits to divide
Utils_Divu16_16_16_loop:
lsl r16 ; shift 0 bit into result
rol r17
@@ -51,7 +51,7 @@ Utils_Divu16_16_16_nofit:
adc r19, r23
; r17:r16=result
Utils_Divu16_16_16_loop_end:
dec r26
dec r25
brne Utils_Divu16_16_16_loop
ret
; @end