Skip to content

Commit 0008956

Browse files
committed
use the pointer as the loop counter
1 parent 41fa42d commit 0008956

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/crt/crt0.S

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -291,12 +291,11 @@ ___libload_libs_ret:
291291

292292
; Set the counter to zero
293293
.errif (ti.mpTmr1Counter & 0xFFFF) != 0
294-
ld l, h ; ld hl, ti.mpTmr1Counter
295-
ld b, 4
294+
ld l, (ti.mpTmr1Counter + 4) & 0xFF
296295
.L.zeroize_counter:
296+
dec l
297297
ld (hl), h
298-
inc hl
299-
djnz .L.zeroize_counter
298+
jr nz, .L.zeroize_counter
300299

301300
ld l, ti.mpTmrCtrl & 0xFF
302301
set ti.bTmr1Enable, (hl) ; Enable the timer

0 commit comments

Comments
 (0)