News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Macros?

Started by cman, June 30, 2010, 08:20:15 PM

Previous topic - Next topic

cman

If one has a large number of macros written is it better to break these macros into separate files according to class or is it OK to keep them in one file ( this will not increase code size ). I'm not sure if including large files of macros will contribute to "code bloat". Thanks for any information!

jj2007

You can keep them in one file, no problem. Macros that don't get called anywhere don't bloat the code. And even a collection of several hundred macros has no measurable influence on the assembly time - at most 100 ms maybe.

dedndave

the size of the file has to be huge to have an affect on assembly
if you notice, Hutch has split windows.inc into 2 files (winextra.inc is the other half)
that keeps the size under 1 Gb
you can put a lot of macros into 1 Gb   :P
but, you might consider splitting them into a few catagorized files, just for the sake of maintenance
it might make it easier to find a specific macro, if it needs to be updated or something

jj2007

Quote from: dedndave on July 01, 2010, 02:41:35 PM
it might make it easier to find a specific macro
Unless your editor allows MyDumbMac*MACRO searches ;-)

Rockoon

While its true that you can put a lot of macros in 1Gb, I'm pretty sure that MASM32 doesnt even come close to distributing with 1Gb of macros. In fact, I'm pretty sure that all of the programmers here, combined, have never produced 1Gb of macros over their entire lives.
When C++ compilers can be coerced to emit rcl and rcr, I *might* consider using one.

jj2007

Quote from: Rockoon on July 01, 2010, 04:13:45 PM
In fact, I'm pretty sure that all of the programmers here, combined, have never produced 1Gb of macros over their entire lives.
Windows 3.1 (the whole OS) arrived at 0.6% of that amount. Then they started the bloat race :bg