-
-
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
Moving def of EQUS to below usage makes value equal to its length #751
Comments
This is indeed a bug, but this should error out at the definition of
Since it's marked as "referenced", the symbol ends up being emitted in the object file, which outputs the As for numeric symbols, the reason why you've been unable to use All this lengthy explanation boils down to these points:
So, while we certainly have a bug (
Here's why the last one will work:
This solution allows defining There is no way to define it "in the middle": as soon as a symbol is referenced, it can only be defined as a numeric symbol (label, |
Cool explanation! Thanks.
Oh, no, I have no issue with the first approach. I only tried the second approach because I was goofing off. |
Here is a boiled down example of a situation I ran into today.
Given this file, bug.asm:
Using rgbds v0.4.2, if you run
rgbasm bug.asm -o bug.o && rgblink bug.o -o bug.gbc
, then the first 12 bytes of bug.gbc will be as expected:For sanity, I tried moving the definition of
PART_TWO_START
down after where it is used to see what the error message would be:However, the ROM still builds fine, and the first 12 bytes of bug.gbc are:
Here, 0x1f is the length of the string
"Table.part_two - Table.part_one"
.The text was updated successfully, but these errors were encountered: