flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > Whitespace and its use in macroinstructions |
Author |
|
AsmGuru62 08 Dec 2011, 01:05
Curious.... why that feature may be needed?
What does a TAB in the macro name can be used for? |
|||
08 Dec 2011, 01:05 |
|
hafai 08 Dec 2011, 04:45
I actually want to create a macro that has the name of something like a tab or a certain number of spaces. It would then have the next word tell it which sub part (with an if statement) of the macro to execute. So something like, "[TAB]/[certain number of spaces] sub-part args" would call the [TAB] macro with the name and args. As I already format my code using tabs I could then naturally invoke my macros without having to remember the [TAB]. And as long as I don't create a sub-part that has the name of a standard assembly instruction then the if statements would cause normal instructions to operate normally.
I'm not sure if I'm describing what I want to do quite right but I just need to know if FASM can do this by default. If not then I guess I'll have to re-compile it with some modifications to handle what I want. |
|||
08 Dec 2011, 04:45 |
|
addes3 08 Dec 2011, 20:56
Sorry, but this is not supported by FASM, as it removes all extra whitespace. FASM doesn't support escape-sequences.
This is an extremely odd request. Just so you know, a macro can use old macros with the same name or the actual instruction. Example: Code: macro mov op1,op2,op3 { if op3 eq mov op1,2op2 else mov op1,op2 mov op2,op3 end if } |
|||
08 Dec 2011, 20:56 |
|
hafai 09 Dec 2011, 12:50
I was aware of 'overloading' an instruction with macro-instructions as the preprocessor just outputs assembly (well, text that the rest of the assembler hopes is legal source code for the following stages). I may have found a better solution for my problem. One that may actually be far better.
But I have one more question. Does the preprocessor get run on the source code several times? Until it returns with no changes? So if in the process of resolving a macro-instruction it creates a new one it would then resolve the new one during a second run through? |
|||
09 Dec 2011, 12:50 |
|
revolution 09 Dec 2011, 20:34
hafai wrote: But I have one more question. Does the preprocessor get run on the source code several times? |
|||
09 Dec 2011, 20:34 |
|
hafai 09 Dec 2011, 21:30
Okay. Thank you.
|
|||
09 Dec 2011, 21:30 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.