2018-12-11 23:15:05 +00:00
|
|
|
%import c64utils
|
2018-12-29 15:25:20 +00:00
|
|
|
%option enable_floats
|
2018-10-16 00:26:35 +00:00
|
|
|
|
2018-12-04 21:30:35 +00:00
|
|
|
~ main {
|
2018-11-11 17:19:08 +00:00
|
|
|
|
2018-12-28 01:08:39 +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]
|
2018-12-29 15:25:20 +00:00
|
|
|
float[3] farray = [1.11, 2.22, -3.33]
|
2018-12-28 01:08:39 +00:00
|
|
|
str text = "hello\n"
|
2018-12-22 00:07:43 +00:00
|
|
|
|
2018-12-28 01:08:39 +00:00
|
|
|
sub start() {
|
2018-12-18 00:43:04 +00:00
|
|
|
|
2018-12-29 16:02:48 +00:00
|
|
|
|
|
|
|
rpt:
|
|
|
|
vm_write_str("\nregular for loop byte\n")
|
|
|
|
for ubyte x in 10 to 15 {
|
|
|
|
vm_write_num(x)
|
|
|
|
vm_write_char(',')
|
|
|
|
}
|
|
|
|
vm_write_str("\nregular for loop word\n")
|
|
|
|
for uword y in 500 to 505 {
|
|
|
|
vm_write_num(y)
|
|
|
|
vm_write_char(',')
|
|
|
|
}
|
|
|
|
|
|
|
|
vm_write_str("\nloop str\n")
|
2018-12-28 01:08:39 +00:00
|
|
|
for ubyte c in text {
|
2018-12-29 16:02:48 +00:00
|
|
|
vm_write_num(c)
|
|
|
|
vm_write_char(',')
|
2018-12-28 01:08:39 +00:00
|
|
|
}
|
|
|
|
|
2018-12-29 16:02:48 +00:00
|
|
|
vm_write_str("\nloop ub\n")
|
2018-12-28 01:08:39 +00:00
|
|
|
for ubyte ub in ubarray{
|
2018-12-29 16:02:48 +00:00
|
|
|
vm_write_num(ub)
|
|
|
|
vm_write_char(',')
|
2018-12-28 01:08:39 +00:00
|
|
|
}
|
2018-12-12 00:13:13 +00:00
|
|
|
|
2018-12-29 16:02:48 +00:00
|
|
|
vm_write_str("\nloop b\n")
|
2018-12-29 15:25:20 +00:00
|
|
|
for byte b in barray {
|
2018-12-29 16:02:48 +00:00
|
|
|
vm_write_num(b)
|
|
|
|
vm_write_char(',')
|
2018-12-29 15:25:20 +00:00
|
|
|
}
|
|
|
|
|
2018-12-29 16:02:48 +00:00
|
|
|
vm_write_str("\nloop uw\n")
|
2018-12-29 15:25:20 +00:00
|
|
|
for uword uw in uwarray {
|
2018-12-29 16:02:48 +00:00
|
|
|
vm_write_num(uw)
|
|
|
|
vm_write_char(',')
|
2018-12-29 15:25:20 +00:00
|
|
|
}
|
|
|
|
|
2018-12-29 16:02:48 +00:00
|
|
|
vm_write_str("\nloop w\n")
|
2018-12-29 15:25:20 +00:00
|
|
|
for word w in warray {
|
2018-12-29 16:02:48 +00:00
|
|
|
vm_write_num(w)
|
|
|
|
vm_write_char(',')
|
2018-12-28 01:08:39 +00:00
|
|
|
}
|
|
|
|
|
2018-12-29 16:02:48 +00:00
|
|
|
vm_write_str("\nloop f\n")
|
2018-12-29 15:25:20 +00:00
|
|
|
for float f in farray {
|
2018-12-29 16:02:48 +00:00
|
|
|
vm_write_num(f)
|
|
|
|
vm_write_char(',')
|
2018-12-29 15:25:20 +00:00
|
|
|
}
|
|
|
|
|
2018-12-29 16:02:48 +00:00
|
|
|
goto rpt
|
|
|
|
|
2018-12-29 15:25:20 +00:00
|
|
|
|
2018-12-28 01:08:39 +00:00
|
|
|
ending:
|
2018-12-29 16:02:48 +00:00
|
|
|
vm_write_str("\nending\n")
|
2018-12-28 01:08:39 +00:00
|
|
|
}
|
2018-12-26 03:51:21 +00:00
|
|
|
}
|