correct branch instruction, fixes #137

This commit is contained in:
Irmen de Jong 2024-05-24 20:54:40 +02:00
parent 3ea0f0cbaa
commit fd1e6796ef
2 changed files with 6 additions and 21 deletions

View File

@ -2323,7 +2323,7 @@ internal class AssignmentAsmGen(private val program: PtProgram,
asmgen.out(""" asmgen.out("""
clc clc
adc #$constIndex adc #$constIndex
bne + bcc +
iny iny
+""") +""")
} }
@ -2348,7 +2348,7 @@ internal class AssignmentAsmGen(private val program: PtProgram,
asmgen.out(""" asmgen.out("""
clc clc
adc P8ZP_SCRATCH_REG adc P8ZP_SCRATCH_REG
bne + bcc +
iny iny
+""") +""")
} }
@ -2358,7 +2358,7 @@ internal class AssignmentAsmGen(private val program: PtProgram,
ldy #>$sourceName ldy #>$sourceName
clc clc
adc #<$sourceName adc #<$sourceName
bne + bcc +
iny iny
+""") +""")
} }

View File

@ -1,25 +1,10 @@
%import diskio
%import textio
%zeropage basicsafe %zeropage basicsafe
main { main {
sub start() { sub start() {
if diskio.f_open("tehtriz.asm") { uword @shared curr_sequence
repeat 10 { ubyte @shared sequence_curr_step
void diskio.f_read($6000, 9999)
}
uword pl, ph, sl, sh
pl, ph, sl, sh = diskio.f_tell()
txt.print("\npos: ") uword @shared sequence_offset = &curr_sequence[sequence_curr_step]
txt.print_uwhex(ph, true)
txt.print_uwhex(pl, false)
txt.print("\nsize: ")
txt.print_uwhex(sh, true)
txt.print_uwhex(sl, false)
txt.nl()
diskio.f_close()
}
} }
} }