reintroduced system reset at program exit if zeropage is clobbered

This commit is contained in:
Irmen de Jong 2020-09-27 22:00:36 +02:00
parent 6f75413c09
commit b6f85d10b0

View File

@ -136,6 +136,15 @@ internal class AsmGen(private val program: Program,
}
}
if(options.zeropage !in setOf(ZeropageType.BASICSAFE, ZeropageType.DONTUSE)) {
out("""
; zeropage is clobbered so we need to reset the machine at exit
lda #>${CompilationTarget.instance.name}.reset_system
pha
lda #<${CompilationTarget.instance.name}.reset_system
pha""")
}
out(" jmp main.start ; start program / force start proc to be included")
}