On Fri, 13 Feb 2004 20:09:25 +0100 Jan-Erik Soderholm wrote: > Aubrey McIntosh, Ph.D. wrote : > > > Does banksel always generate two instructions on the > > 16F877? > > I think so. I'd guess (if MPASM is smart enough) > one instruction on two page PICs and two instructions > on four page PICs. > > > Is there a > > clever way have a macro generate only the minimum number of > > instructions? > > Yes, Olins DBANKIF macros does that. Note that you must have a > system of assembler symbols to keep track of the current > bank settings, and in some cases you can't now what the > settings are (such as after an "entry point"). That's where Olins > macro UNBANK comes into play. UNBANK removes all > assumptions of bank settings so the next DBANKIF always > creates the bcf/bsf instructions. Couldn't inclusive-or be used instead of 1 or 2 bcf/bsf instructions? That way the macro would insert either 1 or 0 instructions. Eric -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.