Closed erkyrath closed 9 months ago
Going farther, we might want symbols (object or function values or whatever) in the list. This is a bit tricky because now we're specifying words as well as bytes. Maybe
@@ 1 2 3 (Kitchen) 4 5;
Another possibility:
@ -> 1 2 3;
@ --> Kitchen;
@ -> 4 5;
There's also labels and branch offsets to think about. I haven't come up with a complete plan.
This offers the tempting idea of data blocks inside a Glulx function. (Perhaps a branch lookup table for a truly efficient switch statement?) We'd have to think of a way to get a label address into an expression. Also a way to suppress dead code elimination.
Finished with PR merge.
I'd left this open as I believe that the idea of being able to reference symbols isn't done?
Symbols work.
It was referencing labels that I didn't do. But I didn't mention that in this issue, aside from the side comment "There's also labels and branch offsets to think about." So let's leave that for a future discussion.
The
@"asm"
statement is pretty flexible. But for really radical game file generation, you might want to throw some literal bytes into the routine being compiled.Possible syntax:
This currently gives the error "Expected an opcode name but found @", so it's available for expansion.