mirror of
https://github.com/irmen/prog8.git
synced 2025-01-13 10:29:52 +00:00
fix repeat loop for variables when var == 0
This commit is contained in:
parent
85e3c2c5a2
commit
8bb3b3be20
@ -960,7 +960,11 @@ _prog8_regsaveY .byte 0""") // TODO only generate these bytes if the
|
||||
// note: A/Y must have been loaded with the number of iterations already!
|
||||
val counterVar = makeLabel("repeatcounter")
|
||||
out("""
|
||||
sta $counterVar
|
||||
bne +
|
||||
cpy #0
|
||||
bne +
|
||||
beq $endLabel
|
||||
+ sta $counterVar
|
||||
sty $counterVar+1
|
||||
$repeatLabel lda $counterVar
|
||||
bne +
|
||||
@ -989,6 +993,7 @@ $counterVar .word 0""")
|
||||
// note: A must have been loaded with the number of iterations already!
|
||||
val counterVar = makeLabel("repeatcounter")
|
||||
out("""
|
||||
beq $endLabel
|
||||
sta $counterVar
|
||||
$repeatLabel""")
|
||||
translate(body)
|
||||
|
Loading…
x
Reference in New Issue
Block a user