i'm a assembly programmer that never use macros,but i want to know what macros
are used often by others programmers to make assembly programing easier.Thanks.
are used often by others programmers to make assembly programing easier.Thanks.
They make your sources shorter, and to some extent more readable*.
*a myth. :grin:
Macros can be used to abstract out constants (values or functions). Like in math we give a function a name (i.e. f(x,y)=x^2 + y^2), then we can say something in a brief way (i.e. f(u-2, v+2)). The concepts used in a macro should be well documented. Most all languages have some form of macro - like dynamic cut-n-paste with auto-replace text.
if you're looking for specific macros, here's my macros.inc attached. All of them are picked from this board (sorry for not including author names, but I just copy+pasted stuff for own use - I would suspect bitRAKE is the author of at least half of them ^_^)
I'm writing a new assembler, and i was searching a good reason to include macro support in it or something to improve assembly language sintax.I haven`t found.
Many macros are used to write inline subroutines, i think that the 'inline' instruction would be better for this pourpose.Others macros are just text replacement, this can be done by a text processor.
Programs i have seen that use many macros are not examples of good source code,and are less readable for others programmers.
Many macros are used to write inline subroutines, i think that the 'inline' instruction would be better for this pourpose.Others macros are just text replacement, this can be done by a text processor.
Programs i have seen that use many macros are not examples of good source code,and are less readable for others programmers.