prog8/examples/test.p8

89 lines
1.9 KiB
Plaintext
Raw Normal View History

%import floats
2023-05-16 21:10:33 +00:00
%import textio
%zeropage basicsafe
main {
2023-05-07 21:49:02 +00:00
2023-05-07 23:03:54 +00:00
sub start() {
2023-05-22 18:31:28 +00:00
uword[] @split split_uwords = [12345, 60000, 4096]
word[] @split split_words = [-12345, -2222, 22222]
uword[256] @split @shared split2
word[256] @split @shared split3
2023-05-26 20:56:12 +00:00
ubyte[200] @shared dummy
uword[256] @split split_large = 1000 to 1255
2023-05-22 18:31:28 +00:00
print_arrays()
2023-05-26 20:56:12 +00:00
txt.nl()
uword ww
for ww in split_large {
txt.print_uw(ww)
txt.spc()
}
txt.nl()
txt.nl()
ubyte xx=1
split_uwords[1] = 0
txt.print_uw(split_uwords[1])
txt.spc()
txt.print_w(split_words[1])
txt.spc()
split_words[1] = -9999
txt.print_w(split_words[1])
txt.spc()
txt.print_uw(split_uwords[xx])
txt.spc()
txt.print_w(split_words[xx])
txt.spc()
split_words[1]=-1111
txt.print_w(split_words[xx])
txt.nl()
txt.nl()
2023-05-22 18:31:28 +00:00
sub print_arrays() {
2023-05-26 20:56:12 +00:00
ubyte[200] @shared dummy2 = 22
2023-05-22 18:31:28 +00:00
for cx16.r0 in split_uwords {
txt.print_uw(cx16.r0)
txt.spc()
}
txt.nl()
for cx16.r0s in split_words {
txt.print_w(cx16.r0s)
txt.spc()
}
txt.nl()
}
ubyte idx
2023-05-26 20:56:12 +00:00
for idx in 0 to len(split_uwords)-1 {
2023-05-22 18:31:28 +00:00
cx16.r0 = split_uwords[idx]
cx16.r1s = split_words[idx]
txt.print_uw(cx16.r0)
txt.spc()
txt.print_w(cx16.r1s)
txt.nl()
}
2023-05-26 20:56:12 +00:00
txt.nl()
2023-05-22 18:31:28 +00:00
split_uwords[1] = 9999
split_words[1] = -9999
print_arrays()
2023-05-26 20:56:12 +00:00
txt.nl()
2023-05-22 18:31:28 +00:00
split_uwords[1]++
2023-05-27 12:43:09 +00:00
split_words[1]++
print_arrays()
txt.nl()
split_uwords[1] |= 4095
split_words[1] |= 127
2023-05-22 18:31:28 +00:00
print_arrays()
2023-05-26 20:56:12 +00:00
txt.nl()
2023-03-18 23:24:05 +00:00
}
}