News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

ML work with ilimited levels of macros ???

Started by HSE, July 04, 2016, 04:52:19 AM

Previous topic - Next topic

HSE

A minor HJWAsm modification (see http://masm32.com/board/index.php?topic=5464.0) allow me to see the maximum macro level reached in compilation.

A Biterider project (who mainly use ML) give me this result:
RA3_OA32_Addin.asm: 234 lines, 82 passes, 41715 ms, 0 warnings, 0 errors, 133 maxmacrolevel

  133 levels!!!  Where is the 20-40 limit we found in  http://masm32.com/board/index.php?topic=4366.msg46737#msg46737 ?  :shock:

Apparently ML discriminate between macro level and macro nesting, but not JWAsm family.

Quote from: HSE on July 25, 2015, 06:19:04 AM
Is something in ObjAsm interpreted as macro level by Jwasm and not by Ml?

Oh!! I have imagined this a year ago...    8)
Equations in Assembly: SmplMath

jj2007

If you post the modified exe, I could use it with my MasmBasic testbed. I am curious to see the maxlevel.

HSE

Hi JJ!

This exe have MAX_MACRO_NESTING       40

but I test macrolevel against  a new constant MAX_MACRO_LEVEL     340

The rrr test sugest that MAX_MACRO_NESTING have no action in nesting limitation.   
Equations in Assembly: SmplMath

jj2007

Thanks :t

My dedicated testbed for the MasmBasic macros reaches level 7:
Tmp_File.asm: 765 lines, 4 passes, 343 ms, 0 warnings, 0 errors, 7 maxmacrolevel

In contrast, building RichMasm needs only 6 levels:
Tmp_File.asm: 17676 lines, 9 passes, 609 ms, 0 warnings, 0 errors, 6 maxmacrolevel

And it chokes over xchg rv(LoadIcon(rv(GetModuleHandle, 0), ebx)), ebx :(

HSE

JJ:
Any message from compiler?

Compare with this exe. Macrolevel is tested with MAX_MACRO_NESTING 340 (the original constant)
Equations in Assembly: SmplMath

jj2007

No specific message, except that it needs only 6 levels in a 17,000+ lines file full of macros. IMHO there is something wrong with the macros you are using ::)

HSE

You have the same problem with hjwasm32b (the second exe)?
Equations in Assembly: SmplMath

jj2007

Regarding the xchg rv(), yes. But that is not surprising, it's in the construction of the macro. Surprising is that it works with AsmC ::)

I have no problem with the macro levels, though. My nesting levels are never that deep.

HSE

#8
The xchg rv() is habran-jonhsa subject of studie because in second exe I don't change almost nothing (I think  :biggrin:

I solved little mistakes that prevent some libraries usage. Now I have a maximum  of 15 levels in my libraries and 22 in main module. And work with ML, wich perhaps is interesting for debugging in RadAsm.

                 LATER: I remember now that when ML work fine also work fine JWAsm "normal" family because
                 the problem is that linker in debug mode have problems with long lines. 

Like dedndave suggest strongly now the programs are UNICODE, this allow me to use the libraries of ObjAsm (that all the time was posible to recompile in ANSI mode, but some work)

Still is better HJwasm because some equations need long lines for SmplMath macros. 

Equations in Assembly: SmplMath