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
z80asm macros #814
Comments
z80asm does not have macro support. The feature is planned, but not yet done. I will leave this topic open, to close when macros are implemented. |
There is a Perl script that you can run with
|
M4 is integrated as a macro processing language. Basic information: Introduction: m4 is a powerful language but it can also be annoying especially if you're a beginner. Doing basic macro substitution should be fairly easy though. The other option Paulo mentioned can also be done with a less dissimilar syntax. |
If a file ends in ".m4" then zcc will pass it through m4 before the next stage. "foo.asm.m4" will pass through m4 to generate "foo.asm" (in the same directory!) which will then be passed to the assembler as usual. "foo.c.m4" will pass through m4 to generate "foo.c" (in the same directory) which will then be passed to the c compiler as usual. A couple of special filetypes ".inc.m4" and ".h.m4" will have m4 applied to result in ".inc" and ".h" respectively but processing stops there. These can then be used as includes into asm or c. |
Even multi-line macros would be good (never mind macros with arguments) to re-use often used patterns. |
z80asm is now a macro assembler! Implemented MACRO/ENDM, REPT/ENDR, REPTC/ENDR, REPTI/ENDR, EXITM, LOCAL, DEFL, #define, #undef Documentation at https://github.com/z88dk/z88dk/wiki/Tool---z80asm---preprocessor |
Hi,
sorry to put this here, but I haven't found any accurate place.
I'm trying to use macros with the z80asm Assembler but I can't find any documentation
about it.
How can I put macros in the assembler code (not in C but in pure assembler files) ?
What is the syntax?
The text was updated successfully, but these errors were encountered: