-
-
Notifications
You must be signed in to change notification settings - Fork 171
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
Define symbols using arithmetic on imported symbols #1146
Comments
Can you please post the files as gists or anywhere else where they'd render on a browser? Right now, your links force a download. Thanks! |
This seems close to #201; I'm thinking of either allowing to define "soft labels" (symbols that are defined using I asked Pino to make an issue for this so the use case is recorded (it seems it can be shimmed with |
Gists: I had posted the files as a download for two reasons.
Going forward, are gists better than downloads in general for examples of input to RGBASM? |
I've sometimes wanted to define "soft labels" in RAM code. Currently we sometimes write this pattern:
Since neither of these are possible:
With soft labels, we could do something like this:
|
Isn't that what you'd use EQUS for? |
|
|
Re: "soft labels", fasm has those:
it also allows for attaching metadata to labels, which could be a solution for #1348:
|
I'm working on a local variable allocator that counts how many HRAM variables a subroutine uses so that its callers know how many HRAM variables to skip when placing their own locals. I had planned to build it as a macro pack where macros would do this:
I wrote an example of steps 1, 3, and 4 in ca65 (locals-sample-ca65.s.txt), which assembled successfully. The right side of the symbol definition isn't constexpr, and honey badger don't give a bleep because honey badger can put it in a patch and make the linker fix it up.
However, a line-by-line translation of this code to RGBASM syntax (locals-sample-rgbasm.s.txt) produces an error at the
DEF ... EQU
.suggested labels: enhancement, ca65 parity
The text was updated successfully, but these errors were encountered: