Files
prog8/examples/test.p8
2024-12-30 00:00:31 +01:00

76 lines
1.6 KiB
Lua

%import textio
%import floats
%zeropage basicsafe
%option no_sysinit
main {
sub start() {
bool derp
float @shared f1,f2
txt.nl()
cx16.r0 = $aaaa
cx16.r1 = $2222
f1 = 9999
cx16.r0=9999
txt.print_bool(f1 < 8000)
txt.spc()
txt.print_bool(f1 < 10000)
txt.spc()
txt.print_bool(f1 < 20000)
txt.nl()
txt.print_bool(cx16.r0 < 8000)
txt.spc()
txt.print_bool(cx16.r0 < 10000)
txt.spc()
txt.print_bool(cx16.r0 < 20000)
txt.nl()
cx16.r0L=0
derp=true
if cx16.r0L==0 and derp
txt.print("fl is 0\n")
else
txt.print("fl is not 0\n")
if cx16.r0L!=0 and derp
txt.print("fl is not 0\n")
else
txt.print("fl is 0\n")
cx16.r0L = 1
if cx16.r0L==0 and derp
txt.print("fl is 0\n")
else
txt.print("fl is not 0\n")
if cx16.r0L!=0 and derp
txt.print("fl is not 0\n")
else
txt.print("fl is 0\n")
cx16.r0L=99
derp=true
if cx16.r0L==99 and derp
txt.print("fl is 99\n")
else
txt.print("fl is not 99\n")
if cx16.r0L!=99 and derp
txt.print("fl is not 99\n")
else
txt.print("fl is 99\n")
cx16.r0L = 122
if cx16.r0L==99 and derp
txt.print("fl is 99\n")
else
txt.print("fl is not 99\n")
if cx16.r0L!=99 and derp
txt.print("fl is not 99\n")
else
txt.print("fl is 99\n")
}
}