flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > Macro aliasing and forward references |
Author |
|
revolution 10 Oct 2009, 14:04
You can't forward reference macros, rept, irp, struc, define. The preprocessor is single pass only.
|
|||
10 Oct 2009, 14:04 |
|
nyrtzi 10 Oct 2009, 14:17
The preprocessor does only a single pass? Weird... oh well.
I guess I'll just have to use sed or some other tool to do some custom preprocessing and add that to my Makefile. Thanks for the pointer. |
|||
10 Oct 2009, 14:17 |
|
nyrtzi 10 Oct 2009, 18:11
Just for future reference in case someone is doing something similar...
The actual source code. Assumed to be in the src/ directory. Code: format elf include '../obj/aliases.inc' macro proc name { macro endp \{ ; replace this line with cleanup code ret purge endp \} _#name: ; replace this line with initialization code } main: goo ret proc goo ; do something endp Put this for example in a Makefile. Code: find src/ -iname '*.asm' | xargs awk '/^proc/ { printf("macro %s { call _%s }\n",$2,$2); }' > obj/aliases.inc This of course assumes that you have some kind of a shell environment available with 'find', 'xargs', 'awk' and 'make'. I'm doing this on a CentOS virtualbox... |
|||
10 Oct 2009, 18:11 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.