The MASM Forum

General => The Workshop => Topic started by: HSE on July 04, 2016, 04:52:19 AM

Title: ML work with ilimited levels of macros ???
Post by: HSE on July 04, 2016, 04:52:19 AM
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)
Title: Re: ML work with ilimited levels of macros ???
Post by: jj2007 on July 04, 2016, 07:00:03 AM
If you post the modified exe, I could use it with my MasmBasic testbed. I am curious to see the maxlevel.
Title: Re: ML work with ilimited levels of macros ???
Post by: HSE on July 04, 2016, 07:27:58 AM
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.   
Title: Re: ML work with ilimited levels of macros ???
Post by: jj2007 on July 04, 2016, 03:58:10 PM
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 :(
Title: Re: ML work with ilimited levels of macros ???
Post by: HSE on July 04, 2016, 10:24:03 PM
JJ:
Any message from compiler?

Compare with this exe. Macrolevel is tested with MAX_MACRO_NESTING 340 (the original constant)
Title: Re: ML work with ilimited levels of macros ???
Post by: jj2007 on July 05, 2016, 02:00:08 AM
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 ::)
Title: Re: ML work with ilimited levels of macros ???
Post by: HSE on July 05, 2016, 02:22:46 AM
You have the same problem with hjwasm32b (the second exe)?
Title: Re: ML work with ilimited levels of macros ???
Post by: jj2007 on July 05, 2016, 03:06:56 AM
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.
Title: Re: ML work with ilimited levels of macros ???
Post by: HSE on July 05, 2016, 04:04:37 AM
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.