2020-09-20 21:49:36 +00:00
|
|
|
%import textio
|
|
|
|
%import floats
|
2019-07-28 19:03:09 +00:00
|
|
|
%zeropage basicsafe
|
|
|
|
|
2020-09-20 21:49:36 +00:00
|
|
|
; Note: this program is compatible with C64 and CX16.
|
|
|
|
|
2019-07-29 21:11:13 +00:00
|
|
|
main {
|
2019-07-28 19:03:09 +00:00
|
|
|
|
2020-02-07 00:22:07 +00:00
|
|
|
; this is only a parser/compiler test, there's no actual working program
|
|
|
|
|
2019-07-28 19:03:09 +00:00
|
|
|
sub start() {
|
2020-08-27 16:10:22 +00:00
|
|
|
txt.print("this is only a parser/compiler test\n")
|
2020-02-07 00:22:07 +00:00
|
|
|
return
|
2019-07-28 19:03:09 +00:00
|
|
|
|
2020-02-07 19:47:38 +00:00
|
|
|
str s1 = "hello"
|
2020-03-12 00:10:19 +00:00
|
|
|
str s2 = @"screencodes"
|
2020-02-07 19:47:38 +00:00
|
|
|
|
2020-10-06 23:35:23 +00:00
|
|
|
&str ms1 = $c000
|
2019-07-28 19:03:09 +00:00
|
|
|
|
|
|
|
byte[4] barray
|
|
|
|
ubyte[4] ubarray
|
|
|
|
word[4] warray
|
|
|
|
uword[4] uwarray
|
|
|
|
float[4] flarray
|
|
|
|
|
|
|
|
&byte[4] mbarray = $c000
|
|
|
|
&ubyte[4] mubarray = $c000
|
|
|
|
&word[4] mwarray = $c000
|
|
|
|
&uword[4] muwarray = $c000
|
|
|
|
&float[4] mflarray = $c000
|
|
|
|
|
2020-12-21 22:45:26 +00:00
|
|
|
ubyte a
|
2019-07-28 19:03:09 +00:00
|
|
|
byte bb
|
|
|
|
ubyte ub
|
|
|
|
word ww
|
|
|
|
uword uw
|
|
|
|
float fl
|
|
|
|
|
|
|
|
; read array
|
2020-12-21 22:45:26 +00:00
|
|
|
a=s1[2]
|
2019-07-28 19:03:09 +00:00
|
|
|
ub=s1[2]
|
|
|
|
bb=barray[2]
|
|
|
|
ub=ubarray[2]
|
|
|
|
ww=warray[2]
|
|
|
|
uw=uwarray[2]
|
|
|
|
fl=flarray[2]
|
2020-12-21 22:45:26 +00:00
|
|
|
a=ms1[2]
|
2019-07-28 19:03:09 +00:00
|
|
|
ub=ms1[2]
|
|
|
|
bb=mbarray[2]
|
|
|
|
ub=mubarray[2]
|
|
|
|
ww=mwarray[2]
|
|
|
|
uw=muwarray[2]
|
|
|
|
fl=mflarray[2]
|
|
|
|
|
2020-12-21 22:45:26 +00:00
|
|
|
a=s1[a]
|
|
|
|
ub=s1[a]
|
|
|
|
bb=barray[a]
|
|
|
|
ub=ubarray[a]
|
|
|
|
ww=warray[a]
|
|
|
|
uw=uwarray[a]
|
|
|
|
fl=flarray[a]
|
|
|
|
a=ms1[a]
|
|
|
|
ub=ms1[a]
|
|
|
|
bb=mbarray[a]
|
|
|
|
ub=mubarray[a]
|
|
|
|
ww=mwarray[a]
|
|
|
|
uw=muwarray[a]
|
|
|
|
fl=mflarray[a]
|
|
|
|
|
|
|
|
a=s1[bb]
|
2019-07-28 19:03:09 +00:00
|
|
|
ub=s1[bb]
|
|
|
|
bb=barray[bb]
|
|
|
|
ub=ubarray[bb]
|
|
|
|
ww=warray[bb]
|
|
|
|
uw=uwarray[bb]
|
|
|
|
fl=flarray[bb]
|
2020-12-21 22:45:26 +00:00
|
|
|
a=ms1[bb]
|
2019-07-28 19:03:09 +00:00
|
|
|
ub=ms1[bb]
|
|
|
|
bb=mbarray[bb]
|
|
|
|
ub=mubarray[bb]
|
|
|
|
ww=mwarray[bb]
|
|
|
|
uw=muwarray[bb]
|
|
|
|
fl=mflarray[bb]
|
|
|
|
|
2020-12-21 22:45:26 +00:00
|
|
|
; a=s1[bb*3]
|
2020-10-17 14:09:14 +00:00
|
|
|
; ub=s1[bb*3]
|
|
|
|
; bb=barray[bb*3]
|
|
|
|
; ub=ubarray[bb*3]
|
|
|
|
; ww=warray[bb*3]
|
|
|
|
; uw=uwarray[bb*3]
|
|
|
|
; fl=flarray[bb*3]
|
2020-12-21 22:45:26 +00:00
|
|
|
; a=ms1[bb*3]
|
2020-10-17 14:09:14 +00:00
|
|
|
; ub=ms1[bb*3]
|
|
|
|
; bb=mbarray[bb*3]
|
|
|
|
; ub=mubarray[bb*3]
|
|
|
|
; ww=mwarray[bb*3]
|
|
|
|
; uw=muwarray[bb*3]
|
|
|
|
; fl=mflarray[bb*3]
|
2019-07-28 19:03:09 +00:00
|
|
|
|
|
|
|
; write array
|
|
|
|
barray[2]++
|
|
|
|
barray[2]--
|
2020-12-21 22:45:26 +00:00
|
|
|
s1[2] = a
|
2019-07-28 19:03:09 +00:00
|
|
|
s1[2] = ub
|
|
|
|
barray[2] = bb
|
|
|
|
ubarray[2] = ub
|
|
|
|
warray[2] = ww
|
|
|
|
uwarray[2] = uw
|
|
|
|
flarray[2] = fl
|
2020-12-21 22:45:26 +00:00
|
|
|
ms1[2] = a
|
2019-07-28 19:03:09 +00:00
|
|
|
ms1[2] = ub
|
|
|
|
mbarray[2]++
|
|
|
|
mbarray[2] = bb
|
|
|
|
mbarray[2] = bb
|
|
|
|
mubarray[2] = ub
|
|
|
|
mwarray[2] = ww
|
|
|
|
muwarray[2] = uw
|
|
|
|
mflarray[2] = fl
|
|
|
|
|
2020-12-21 22:45:26 +00:00
|
|
|
s1[a] = ub
|
|
|
|
barray[a] = bb
|
|
|
|
ubarray[a] = ub
|
|
|
|
warray[a] = ww
|
|
|
|
uwarray[a] = uw
|
|
|
|
flarray[a] = fl
|
2019-08-09 00:15:31 +00:00
|
|
|
|
|
|
|
s1[bb] = ub
|
|
|
|
barray[bb] = bb
|
|
|
|
ubarray[bb] = ub
|
|
|
|
warray[bb] = ww
|
|
|
|
uwarray[bb] = uw
|
|
|
|
flarray[bb] = fl
|
|
|
|
|
2020-10-17 14:09:14 +00:00
|
|
|
; s1[bb*3] = ub
|
|
|
|
; barray[bb*3] = bb
|
|
|
|
; ubarray[bb*3] = ub
|
|
|
|
; warray[bb*3] = ww
|
|
|
|
; uwarray[bb*3] = uw
|
|
|
|
; flarray[bb*3] = fl
|
2019-07-28 19:03:09 +00:00
|
|
|
}
|
|
|
|
}
|