simple test

This commit is contained in:
Irmen de Jong 2023-01-22 17:10:36 +01:00
parent b2cb125bd4
commit 9b209823f6

View File

@ -1,52 +1,26 @@
%import textio %import textio
%zeropage basicsafe
%option no_sysinit %option no_sysinit
%zeropage basicsafe
main { main {
ubyte @requirezp zpvar = 10
ubyte @zp zpvar2 = 20
uword empty
ubyte[10] bssarray
uword[10] bsswordarray
ubyte[10] nonbssarray = 99
str name="irmen"
sub start() { sub start() {
txt.print("= 10 ") ubyte @shared ub = asmfoo(42)
txt.print_ub(zpvar) ub = normalfoo(42)
txt.nl() somelabel:
zpvar++ ub++
txt.print_ub(ub)
}
txt.print("= 20 ") asmsub asmfoo(ubyte arg @Y) -> ubyte @Y {
txt.print_ub(zpvar2) %asm {{
txt.nl() iny
zpvar2++ rts
}}
}
txt.print("= 0 ") sub normalfoo(ubyte arg) -> ubyte {
txt.print_uw(empty) arg++
txt.nl() return 42
empty++
txt.print("+ 0 ")
txt.print_ub(bssarray[1])
txt.nl()
bssarray[1]++
txt.print("+ 0 ")
txt.print_uw(bsswordarray[1])
txt.nl()
bsswordarray[1]++
txt.print("+ 99 ")
txt.print_ub(nonbssarray[1])
txt.nl()
nonbssarray[1]++
txt.print("+ r ")
txt.chrout(name[1])
txt.nl()
name[1] = (name[1] as ubyte +1)
txt.print("try running again.\n")
} }
} }