Peter L. Peres wrote: > 1. I am testing a project that must be developed on 16f84 and finally run > on 16C54 and 12C508. That sounds a bit silly. If it's going to run on a 16C54 (are you really sure, that's a *really* old PIC), it would make sense to test on 16C54-JW or the emulator. As for the 12C508 (completely obsoleted by 12C508A by the way), it even has a different CPU core with different restrictions than the 16F84. Why not use a 12F629 instead of the 12C508? Now that I think about it, don't the 16C5x parts also have the 12 bit core? I'm not totally sure because I've never used a PIC that ancient. Is this for a museum? > I use IFDEF switches in relevant parts of the code. > While doing this I naively wrote: > > list p=p16c54a, l=inhx32, r=hex > include 'p16c5x.inc' > > which I thought would define __16C54 No, it defines __16C54A. > so I could later write: > > IFDEF __16C54 > DT "16C54" ; etc etc > ENDIF > > except __16C54 is not defined outside p16c5x.inc . Huh ? __16C54 isn't defined at all. In any case these symbols are defined by the assembler as a result of the processor selection. Their scope is certainly not limited to the Microchip include files. > mplab, mpasm, and > gpasm faithfully duplicate this behavior. Is this a bug or am I missing > something. Which behavior? Again, I don't understand why you expect the __16C54 symbol to be defined for the 16C54A processor. You've gotten yourself confused here somehow and are misinterpreting the symptoms. > I now do: > > CPU__16C54 EQU 1 > ; CPU__16F84 EQU 1 > > IFDEF CPU__16C54 > list p=... > include ... > ENDIF > > and it works. But it took a while to understand this. Well, yeah, that should work. I would still key off the assembler's built in symbols though. ***************************************************************** Embed Inc, embedded system specialists in Littleton Massachusetts (978) 742-9014, http://www.embedinc.com -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads