A86: Macro problem...


[Prev][Next][Index][Thread]

A86: Macro problem...




Anyone ever get a "Macro expansion too long" error when compiling with TASM? 
;)  I'm just curious if there's any possible way around that...like, can you 
"nest" macros, or is there an alternate compiler that supports macros that I 
could try?  I know that if I can make the following macro two lines shorter 
(and still hold the same effect) it will work (I think), so if anyone has 
anyone "macro optimization" ideas...

#define NUM(s,n,e)  .db (n > $FFFFFF) + (n > $FFFF) + (n > $FF) + 3
#defcont            \.db (e << 1) + (s & 1)
#defcont            \.db n & $FF
#defcont            \#if (n > $FF)
#defcont            \.db (n & $FF00) >> 8
#defcont            \#if (n > $FFFF)
#defcont            \.db (n & $FF0000) >> 16
#defcont            \#if (n > $FFFFFF)
#defcont            \.db n >> 24
#defcont            \#endif\#endif\#endif

(s is the sign, n is the number, and e is the exponent, just in case you're 
curious; and that first line of the macro gets the length in bytes of the 
number plus 2)

JayEll


Follow-Ups: