Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: arbitrary assembly output #245

Closed
erkyrath opened this issue Sep 11, 2023 · 5 comments
Closed

Feature: arbitrary assembly output #245

erkyrath opened this issue Sep 11, 2023 · 5 comments

Comments

@erkyrath
Copy link
Contributor

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:

@@ 1 2 3 $FF;

This currently gives the error "Expected an opcode name but found @", so it's available for expansion.

@erkyrath
Copy link
Contributor Author

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.

@erkyrath
Copy link
Contributor Author

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.

@erkyrath
Copy link
Contributor Author

Finished with PR merge.

@DavidKinder
Copy link
Owner

I'd left this open as I believe that the idea of being able to reference symbols isn't done?

@erkyrath
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants