Hey all, Overkill here.
So yeah, I scarfed down a bunch of food, and purchased snacks and energy drinks, I think I’m good to go finally.
So yeah, my idea for the Evolution theme, is probably a combo of that theme and the theme I wished actually won, Tunnels. The result? Evolving Tunnels. Since I’m hoping to make this on the Game Boy, I will probably stick to something really dumb and cheap and barely innovative, but hey whatever. Also, yeah, I have my work cut out for me.
The assembler needs some serious work before code-gen will actually work. Hopefully the thoughts I had last night to move the burden of optimizing jumps from the compiler (which might be impossible given circular label dependencies in jumps) to a syntactic burden on the user will be changes that pay off.
Instead of assuming a jump is absolute and trying to optimize appropriate labels into relative jumps (which takes an arbitrary number of semantic passes, and might never be possible to resolve without a fixed upper bound/some janky heuristic), I’m going to assume jumps are relative, and error if you try to jump too far. To do absolute jumps, you need to explicitly indicate that in your source code. This makes for a bit more work for the consumer of the language, but not too much, since the errors will go away as soon as you reduce your label distances or actually promote the jump into an absolute one.
Example, using low-level constructs:
goto! label // absolute jump (16-bit unsigned)
...
def label:
...
goto label // relative jump (8-bit signed PC-relative distance)
// 16-bit jump destination, but '!' is not needed, because
// 'hl' is a Z80 register, not an immediate value, so there is no ambiguity.
goto hl
// call absolute (16-bit unsigned), no '!' needed, because there is no relative 'call'.
call label
Example, using the high-level structured programming syntax:
compare a to b
if! < then // absolute jump to elseif when false.
...
elseif == then // relative jump to else when false.
...
else
...
end
repeat!
...
end
Anyway, uh, that’s all I’ve got for now. More code now.
— Overkill