This commit is contained in:
Irmen de Jong 2021-02-25 00:52:27 +01:00
parent 1bd32c0f19
commit cd500fee8c
3 changed files with 3 additions and 12 deletions

View File

@ -174,7 +174,7 @@ internal class AstChecker(private val program: Program,
else -> false
}
if (!ok) {
errors.err("statement occurs in a block, where it will never be executed. Use it in a subroutine instead.", statement.position)
errors.err("non-declarative statement occurs in block scope, where it will never be executed. Move it to a subroutine instead.", statement.position)
break
}
}

View File

@ -2,8 +2,6 @@
TODO
====
- alllow uword xx=memory() initialization in block scope.
- hoist all variable declarations up to the subroutine scope *before* even the constant folding takes place (to avoid undefined symbol errors when referring to a variable from another nested scope in the subroutine)
- optimize swap of two memread values with index, using the same pointer expression/variable, like swap(@(ptr+1), @(ptr+2))
- optimize several inner loops in gfx2 (highres 4 color mode)

View File

@ -1,16 +1,9 @@
%import textio
%zeropage basicsafe
main {
; $1F9C0 - $1F9FF PSG registers
sub start() {
txt.print("tone")
uword freq = 1181
cx16.vpoke(1, $f9c0, lsb(freq))
cx16.vpoke(1, $f9c1, msb(freq))
cx16.vpoke(1, $f9c2, %11111111) ; volume
cx16.vpoke(1, $f9c3, %11000000) ; triangle waveform
txt.print("done\n")
}
}