A86: Re: Macro problem...


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

A86: Re: Macro problem...




Are you using the newest version of TASM? It uses extended memory. You might
even have to tell it that you want to be able to define longer macros (there
is a limit on how long they can be). I'm not sure if TASM will automatically
do this or not, but get rid of all those spaces!!!

#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

----- Original Message -----
From: <JayEll64@aol.com>
To: <assembly-86@lists.ticalc.org>
Sent: Saturday, January 29, 2000 12:29 AM
Subject: 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
>



References: