2023-05-16 22:40:47 +00:00
|
|
|
%import floats
|
2023-05-16 21:10:33 +00:00
|
|
|
%import textio
|
2023-04-29 15:14:50 +00:00
|
|
|
%zeropage basicsafe
|
2023-05-28 21:19:01 +00:00
|
|
|
%option no_sysinit
|
2023-04-10 14:59:08 +00:00
|
|
|
|
2022-10-22 11:33:35 +00:00
|
|
|
main {
|
2023-05-07 21:49:02 +00:00
|
|
|
|
2023-05-07 23:03:54 +00:00
|
|
|
sub start() {
|
2023-05-28 12:53:53 +00:00
|
|
|
uword[] @split split_uwords = [12345, 60000, 4096]
|
2023-05-28 21:19:01 +00:00
|
|
|
txt.print_ub(len(split_uwords))
|
|
|
|
txt.nl()
|
2023-05-28 12:53:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
sub start22() {
|
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()
|
2023-05-28 12:53:53 +00:00
|
|
|
; split_uwords[1] |= 4095 ; TODO fix this in 6502 codegen
|
|
|
|
; split_words[1] |= 127 ; TODO fix this in 6502 codegen
|
|
|
|
;
|
|
|
|
; print_arrays()
|
|
|
|
; txt.nl()
|
|
|
|
; txt.nl()
|
2023-05-22 18:31:28 +00:00
|
|
|
|
2023-05-28 12:53:53 +00:00
|
|
|
cx16.r0 = split_uwords[1]
|
|
|
|
cx16.r1s = split_words[1]
|
|
|
|
ww = 6655
|
|
|
|
split_uwords[1] = xx
|
|
|
|
split_words[1] = xx as word
|
|
|
|
txt.print_uw(split_uwords[1])
|
|
|
|
txt.spc()
|
|
|
|
txt.print_w(split_words[1])
|
|
|
|
txt.nl()
|
|
|
|
ww=7788
|
|
|
|
split_uwords[xx] = ww
|
|
|
|
split_words[xx] = ww as word
|
|
|
|
txt.print_uw(split_uwords[1])
|
|
|
|
txt.spc()
|
|
|
|
txt.print_w(split_words[1])
|
2023-05-26 20:56:12 +00:00
|
|
|
txt.nl()
|
2023-05-28 12:53:53 +00:00
|
|
|
|
2023-03-18 23:24:05 +00:00
|
|
|
}
|
2022-12-04 15:02:58 +00:00
|
|
|
}
|
2023-04-29 15:14:50 +00:00
|
|
|
|