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
support for "EQU" in assembler #61
Comments
What would it do? |
It would set a label to the given value (rather than the memory location of the label) So for example, you could set |
basically, to avoid magic numbers in assembly code |
for example, say I use 0x1000 to store the cursor. I'd rather write:
|
Oh, assembler time definition, yeah, right. I have been working around it by using labels and dat allover the place (not fun over time, and slower) |
yeah, labels + dat works but it adds a level of indirection |
I looked trough most stuff that Notch put out and never notices anything like that, but I guess it will be added, as its nothing the CPU must do but rather the assembler. |
Correct, it is an assembler feature common to many assemblers. I don't know if any DCPU-16 assemblers have it yet though. |
We could add this with a prepended dot to make clear, that this is assembler specific:
Nearly every assembler uses this style to create his own extensions... btw. we can also add inclusion functionality; I guess that's something useful, too:
|
another one to consider would be |
Ah you mean some way of setting the base address? That would be sweet, yea. btw, I just wrote a short proposal for the Standards Comittee about equ, let's see what they say: 0x10cStandardsCommittee/0x10c-Standards#27 (edit) |
Update: Jarvix is, as far as I know, currently working on a RFCX about exactly this and some other stuff (conditional compilation and stuff like that) |
Just like we have DAT (similar to the DFB in old 8-bit CPU assemblers) I think we need something like an EQU instruction in our assemblers for setting constants.
Has anyone seen an EQU equivalent in any of Notch's work (or in any other assemblers)?
The text was updated successfully, but these errors were encountered: