2021-10-24 18:57:10 +00:00
|
|
|
%import string
|
|
|
|
%import textio
|
|
|
|
%zeropage basicsafe
|
|
|
|
|
2021-06-01 20:21:50 +00:00
|
|
|
main {
|
2021-10-14 22:28:23 +00:00
|
|
|
sub start() {
|
2021-10-24 18:57:10 +00:00
|
|
|
str text = "variable"
|
|
|
|
|
|
|
|
@($2000) = 'a'
|
|
|
|
@($2001) = 'b'
|
|
|
|
@($2002) = 'c'
|
|
|
|
@($2003) = 0
|
|
|
|
|
2021-10-21 20:06:21 +00:00
|
|
|
asmfunc("text")
|
2021-10-24 18:57:10 +00:00
|
|
|
asmfunc(text)
|
|
|
|
asmfunc($2000)
|
2021-10-21 20:06:21 +00:00
|
|
|
func("text")
|
2021-10-24 18:57:10 +00:00
|
|
|
func(text)
|
|
|
|
func($2000)
|
2021-10-20 20:16:26 +00:00
|
|
|
}
|
2021-10-13 16:55:56 +00:00
|
|
|
|
2021-10-21 20:06:21 +00:00
|
|
|
asmsub asmfunc(str thing @AY) {
|
|
|
|
%asm {{
|
2021-10-24 18:57:10 +00:00
|
|
|
sta func.thing
|
|
|
|
sty func.thing+1
|
|
|
|
jmp func
|
2021-10-21 20:06:21 +00:00
|
|
|
}}
|
|
|
|
}
|
|
|
|
|
2021-10-24 18:57:10 +00:00
|
|
|
; TODO fix asmgen when using 'str' type
|
|
|
|
sub func(uword thing) {
|
|
|
|
uword t2 = thing as uword
|
|
|
|
ubyte length = string.length(thing)
|
|
|
|
txt.print_ub(length)
|
|
|
|
txt.nl()
|
|
|
|
txt.print(thing)
|
|
|
|
txt.nl()
|
2021-10-14 22:28:23 +00:00
|
|
|
}
|
2021-05-12 22:35:22 +00:00
|
|
|
}
|