prog8/examples/test.p8

43 lines
899 B
Plaintext
Raw Normal View History

%import test_stack
%import textio
2021-01-10 04:04:56 +00:00
%import diskio
%import string
%zeropage basicsafe
2020-12-08 00:02:38 +00:00
%option no_sysinit
main {
sub start() {
2021-01-10 04:04:56 +00:00
if diskio.f_open(8, "romdis.asm") {
uword buffer = memory("diskbuffer", $1000)
2021-01-08 21:43:01 +00:00
2021-01-10 04:04:56 +00:00
uword linenr = 0
c64.SETTIM(0,0,0)
2021-01-08 21:43:01 +00:00
2021-01-10 04:04:56 +00:00
while not c64.READST() {
ubyte length = diskio.f_readline(buffer)
if length {
linenr++
if not lsb(linenr)
txt.chrout('.')
} else
goto io_error
}
2021-01-10 04:04:56 +00:00
io_error:
txt.print("\n\n\n\n\n\n\nnumber of lines: ")
txt.print_uw(linenr)
txt.nl()
diskio.f_close()
}
2021-01-10 04:04:56 +00:00
txt.print(diskio.status(8))
2021-01-08 15:56:17 +00:00
txt.nl()
2021-01-10 04:04:56 +00:00
txt.print("\ntime: ")
txt.print_uw(c64.RDTIM16())
2021-01-08 15:56:17 +00:00
txt.nl()
}
2021-01-10 04:04:56 +00:00
2020-08-27 17:47:50 +00:00
}