From 9b209823f60acbffd5f61ce5c5ad9860b8f93a66 Mon Sep 17 00:00:00 2001 From: Irmen de Jong Date: Sun, 22 Jan 2023 17:10:36 +0100 Subject: [PATCH] simple test --- examples/test.p8 | 58 +++++++++++++----------------------------------- 1 file changed, 16 insertions(+), 42 deletions(-) diff --git a/examples/test.p8 b/examples/test.p8 index b1cadbd5f..168bb6bee 100644 --- a/examples/test.p8 +++ b/examples/test.p8 @@ -1,52 +1,26 @@ %import textio -%zeropage basicsafe %option no_sysinit +%zeropage basicsafe 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() { - txt.print("= 10 ") - txt.print_ub(zpvar) - txt.nl() - zpvar++ + ubyte @shared ub = asmfoo(42) + ub = normalfoo(42) +somelabel: + ub++ + txt.print_ub(ub) + } - txt.print("= 20 ") - txt.print_ub(zpvar2) - txt.nl() - zpvar2++ + asmsub asmfoo(ubyte arg @Y) -> ubyte @Y { + %asm {{ + iny + rts + }} + } - txt.print("= 0 ") - txt.print_uw(empty) - txt.nl() - 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") + sub normalfoo(ubyte arg) -> ubyte { + arg++ + return 42 } }