diff --git a/compiler/res/prog8lib/diskio.p8 b/compiler/res/prog8lib/diskio.p8 index 2617f4466..af22c62be 100644 --- a/compiler/res/prog8lib/diskio.p8 +++ b/compiler/res/prog8lib/diskio.p8 @@ -353,11 +353,15 @@ _end rts messageptr++ } -io_error: @(messageptr) = 0 +done: c64.CLRCHN() ; restore default i/o devices c64.CLOSE(15) return filename + +io_error: + filename = "?disk error" + goto done } diff --git a/compiler/src/prog8/compiler/target/cpu6502/codegen/AsmGen.kt b/compiler/src/prog8/compiler/target/cpu6502/codegen/AsmGen.kt index 11ee8feaf..5c66c2502 100644 --- a/compiler/src/prog8/compiler/target/cpu6502/codegen/AsmGen.kt +++ b/compiler/src/prog8/compiler/target/cpu6502/codegen/AsmGen.kt @@ -128,7 +128,7 @@ internal class AsmGen(private val program: Program, out("* = ${program.actualLoadAddress.toHex()}") val year = LocalDate.now().year out(" .word (+), $year") - out(" .null $9e, format(' %d ', _prog8_entrypoint), $3a, $8f, ' prog8 by idj'") + out(" .null $9e, format(' %d ', _prog8_entrypoint), $3a, $8f, ' prog8'") out("+\t.word 0") out("_prog8_entrypoint\t; assembly code starts here\n") if(!options.noSysInit) diff --git a/examples/test.p8 b/examples/test.p8 index 9972ba874..cde5dbacc 100644 --- a/examples/test.p8 +++ b/examples/test.p8 @@ -1,10 +1,20 @@ %import textio +%import diskio %zeropage basicsafe main { sub start() { + txt.print(diskio.status(8)) + txt.nl() + txt.print(diskio.status(9)) + txt.nl() +; txt.print(diskio.status(10)) +; txt.nl() +; txt.print(diskio.status(11)) +; txt.nl() + uword x=22 x*=320 txt.print_uw(x)