![]() Privalov wanted FASM to be as powerful as possible, even at the cost of comprehensibility. I know fixes are confusing, and to understand them you have to learn the inner workings of the preprocessor, but they give you great coding power. Right now this part of tutorial is TODO, I hope I will write it soon, for now you can look at JohnFound’s Fresh’s macro library, file INCLUDE\MACRO\globals.inc. In assembly programming this is useful, especially when you break code into modules but want to have data and code grouped in separate segment/section, but defined in a single file. You can also use fixes to move parts of code. So instead of using symbol fixed to “ #” you can just use “ #” etc. So what was the problem with declaring a macro inside a macro? The first time the compiler encountered a “ }” inside the macro’s body it interpreted it as the end of the macro’s body declaration, so there wasn’t any way to include “ }” in a macro’s body. (of course it’s more complicated than this, but this is enough for understanding fixes). You can quite easily work it out yourself: at macro declaration the macro’s body is saved, and when a macro is expanded the preprocessor replaces the line containing the macro with that macro’s body, it internally declares equates to handle its arguments and then continues preprocessing the macro body. First of all, we need to know how macros are preprocessed. Now let’s get back to declaring a macro inside a macro. This was only an example to show how fixing works, it isn’t usually used in this manner.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |