prog8/compiler/examples/test.p8

50 lines
1.2 KiB
Plaintext
Raw Normal View History

%import c64utils
2018-10-16 00:26:35 +00:00
~ main {
2018-11-11 17:19:08 +00:00
ubyte[3] ubarray = [11,55,222]
byte[3] barray = [-11,-22,-33]
uword[3] uwarray = [111,2222,55555]
word[3] warray = [-111,-222,-555]
str text = "hello\n"
sub start() {
c64scr.print_ub(X)
c64.CHROUT('\n')
2018-12-18 00:43:04 +00:00
c64scr.print("loop str\n")
for ubyte c in text {
c64scr.print(" c ")
c64scr.print_ub(c)
c64.CHROUT('\n')
}
c64scr.print("loop ub\n")
for ubyte ub in ubarray{
c64scr.print(" ub ")
c64scr.print_ub(ub)
c64.CHROUT('\n')
}
2018-12-12 00:13:13 +00:00
; c64scr.print("loop b\n") ; @todo allow signed loopvars
; for byte b in barray { ; @todo loop doesn't end because of register clobbering??
; c64scr.print(" b ")
; c64scr.print_b(b)
; c64.CHROUT('\n')
; }
errorloop:
c64scr.print("loop uw\n")
for uword uw in uwarray { ; @todo loop doesn't end because of register clobbering
c64scr.print(" uw ")
c64scr.print_uw(uw)
c64.CHROUT('\n')
}
ending:
c64scr.print("\nending\n")
c64scr.print_ub(X)
c64.CHROUT('\n')
}
2018-12-26 03:51:21 +00:00
}