Searching \ for 'MPASM bugs with ' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/language/index.htm?key=asm
Search entire site for: 'MPASM bugs with'.

No exact or substring matches. trying for part
PICList Thread
'MPASM bugs with #define'
1995\06\22@005001 by Greg Solberg

flavicon
face
Hi,

I use Microchip's MPASM v1.10.  Anyone else have problems with #define?
For instance, I compile the following code:

   #define     FOO(a)  (a)
   one equ     FOO(1)
   two equ     FOO(1) + 1
   three       equ     FOO(1) + FOO(1) + FOO(1)
   four        equ     2 + FOO(2)
               end

And I get the following in the list file:

                    0001  #define FOO(a)  (a)
 0001               0002 one     equ     FOO(1)
 0001               0003 two     equ     FOO(1) + 1
 0001               0004 three   equ     FOO(1) + FOO(1) + FOO(1)
 0004               0005 four    equ     2 + FOO(2)
                    0006         end

The values computed for labels "two" and "three" are wrong.  The basic problem
seems to be with using a #define macro at the beginning of an expression.

Does anyone else have this problem?  Does Microchip know about it?  Anyone
have some nice work-around?

Thanks for your help,
Greg Solberg
spam_OUTgregTakeThisOuTspammigsol.com

More... (looser matching)
- Last day of these posts
- In 1995 , 1996 only
- Today
- New search...