started changing libs to typed pointers

This commit is contained in:
Irmen de Jong
2025-07-20 23:59:59 +02:00
parent 720988ae72
commit 2f90c53ad0
2 changed files with 22 additions and 9 deletions

View File

@@ -1,6 +1,8 @@
TODO TODO
==== ====
BUG: fix ZP variables no longer getting initialized to 0 (see test.p8)
STRUCTS: are being developed in their own separate branch for now, called "structs". STRUCTS: are being developed in their own separate branch for now, called "structs".
Idea is to make it feature complete in the IR/Virtual target, then merge it to master?, and then start building the 6502 code generation for it. Idea is to make it feature complete in the IR/Virtual target, then merge it to master?, and then start building the 6502 code generation for it.

View File

@@ -1,16 +1,27 @@
%option no_sysinit %option no_sysinit
%zeropage basicsafe %zeropage kernalsafe
%import textio %import textio
%zpallowed 224,255
main { main {
sub start() { uword @shared @requirezp var1 = 0
word @shared ww = 2222 uword @shared @requirezp var2 = 0
uword @shared @requirezp var3 = 0
uword @shared @requirezp var4 = 0
uword @shared @requirezp var5 = 0
abs(ww) sub start() {
sgn(ww) txt.print_uw(var1)
sqrt(ww) txt.spc()
min(ww, 0) txt.print_uw(var2)
max(ww, 0) txt.spc()
clamp(ww, 0, 319) txt.print_uw(var3)
txt.spc()
txt.print_uw(var4)
txt.spc()
txt.print_uw(var5)
txt.nl()
repeat {}
} }
} }