mirror of
https://github.com/irmen/prog8.git
synced 2024-11-04 04:05:00 +00:00
103 lines
3.2 KiB
Lua
103 lines
3.2 KiB
Lua
%option enable_floats
|
|
%import mathlib
|
|
%import c64lib
|
|
%import c64utils
|
|
|
|
~ main {
|
|
|
|
sub start() {
|
|
|
|
ubyte v1
|
|
ubyte v2
|
|
float f2
|
|
uword address
|
|
memory uword memaddr = $c000
|
|
uword[2] wordarray
|
|
ubyte[2] ubytearray
|
|
byte b1
|
|
memory byte mb1 = $c991
|
|
memory ubyte mub1 = $c992
|
|
|
|
|
|
str stringvar = "??????????\n\n\nnext line\r\r\rnext line after carriagereturn"
|
|
ubyte secretnumber = 0
|
|
memory uword freadstr_arg = $22 ; argument for FREADSTR
|
|
uword testword
|
|
ubyte char1 = "@" ; @todo don't put this on the heap
|
|
ubyte char2 = "\n"; @todo don't put this on the heap
|
|
ubyte char3 = "\r"; @todo don't put this on the heap
|
|
ubyte char1b = '@'
|
|
ubyte char2b = '\n'
|
|
ubyte char3b = '\r'
|
|
|
|
testword = '@'
|
|
testword = '\n'
|
|
freadstr_arg = '@'
|
|
freadstr_arg = '\n'
|
|
secretnumber = '@'
|
|
secretnumber = '\r'
|
|
|
|
testword = stringvar
|
|
testword = wordarray
|
|
freadstr_arg = stringvar
|
|
freadstr_arg = wordarray
|
|
wordarray[1] = stringvar
|
|
wordarray[1] = wordarray
|
|
wordarray[b1] = stringvar
|
|
wordarray[b1] = wordarray
|
|
wordarray[mb1] = stringvar
|
|
wordarray[mb1] = wordarray
|
|
testword = "stringstring" ; @todo asmgen for this
|
|
freadstr_arg = "stringstring" ; @todo asmgen for this
|
|
freadstr_arg = "stringstring2222" ; @todo asmgen for this
|
|
wordarray[1] = "stringstring" ; @todo asmgen for this
|
|
wordarray[b1] = "stringstring" ; @todo asmgen for this
|
|
wordarray[mb1] = "stringstring" ; @todo asmgen for this
|
|
|
|
|
|
|
|
; address =c64.MEMBOT(1, 40000.w) ; ok!
|
|
; address =c64.MEMBOT(1, address) ; ok!
|
|
; address =c64.MEMBOT(1, memaddr) ; ok!
|
|
;
|
|
; A, Y =c64.GETADR() ; ok!
|
|
; Y, A =c64.GETADR() ; ok!
|
|
; address = c64flt.GETADRAY() ; ok!
|
|
; memaddr = c64flt.GETADRAY() ; ok!
|
|
; wordarray[1] = c64flt.GETADRAY() ; ok!
|
|
; v1, v2 =c64.GETADR() ; ok!
|
|
; address =c64.IOBASE() ; ok!
|
|
; A = c64.CHRIN() ; ok !
|
|
; X = c64.CHRIN() ; ok !
|
|
; Y = c64.CHRIN() ; ok!
|
|
; v1 = c64.CHRIN() ; ok !
|
|
|
|
|
|
c64.CHROUT(X)
|
|
c64.CHROUT(b1) ; @todo fix compiler crash expression identifierref should be a vardef, not null
|
|
c64.CHROUT(char1) ; @todo fix compiler crash "
|
|
c64.CHROUT(mb1) ; @todo fix compiler crash "
|
|
c64.CHROUT(mub1) ; @todo fix compiler crash "
|
|
c64.CHROUT(ubytearray[1]) ; @todo fix compiler crash null cannot be cast to non-null type prog8.ast.VarDecl
|
|
c64.CHROUT(ubytearray[X]) ; @todo fix compiler crash "
|
|
c64.CHROUT(wordarray[1]) ; @todo fix compiler crash "
|
|
|
|
testsub(X) ; @todo fix compiler crash
|
|
testsub(b1) ; @todo fix compiler crash
|
|
testsub(char1) ; @todo fix compiler crash
|
|
testsub(mb1) ; @todo fix compiler crash
|
|
testsub(mub1) ; @todo fix compiler crash
|
|
testsub(ubytearray[1]) ; @todo fix compiler crash
|
|
testsub(ubytearray[X]) ; @todo fix compiler crash
|
|
testsub(wordarray[1]) ; @todo fix compiler crash
|
|
|
|
return
|
|
}
|
|
|
|
|
|
sub testsub(arg: ubyte) {
|
|
return
|
|
}
|
|
|
|
}
|