prog8/examples/test.p8

44 lines
855 B
Plaintext
Raw Normal View History

%import textio
%zeropage basicsafe
2021-10-30 13:15:11 +00:00
main {
ubyte mainglobal1 = 10
ubyte mainglobal2 = 20
ubyte mainglobal3 = 30
ubyte mainglobal4 = 40
sub start() {
ubyte startval1 = 100
ubyte startval2 = 110
ubyte startval3 = 120
ubyte startval4 = 130
txt.print_ub(mainglobal1)
txt.nl()
txt.print_ub(startval1)
txt.nl()
2022-02-06 03:29:36 +00:00
derp()
derp()
foobar()
startval1++
mainglobal1++
2022-02-06 16:07:03 +00:00
start2()
sub start2() {
uword @shared startval1 = 2002
ubyte[2] @shared barr
uword[2] @shared warr
uword[] @shared warr2 = [1,2]
}
}
2022-02-06 03:29:36 +00:00
asmsub derp() {
}
sub foobar() {
2022-02-06 16:07:03 +00:00
uword @shared startval1 = 2002
uword @shared mainglobal1 = 2002
2022-02-06 03:29:36 +00:00
txt.print("foobar\n")
}
}