alan.b.pearce@stfc.ac.uk wrote 2012-04-25 14:54: >> Correct. So it can be used in my macro. In fact it may be a good >> idea. Using BANKSEL would backport my macro back to the older family >> of chips too because BANKSEL will properly twiddle the appropriate >> bits, whereas mine specifically does a MOVLB, which is an enhanced 16F >> only instruction. Personally I'm not pressed because I'm never >> planning on moving back to the older chips ever. With enhanced chips >> in every package size, I cannot see a good reason to every move back. > > The other thing to note about Olins macros is that they only generate > instructions for the bits in the bank selection register that require > changing, where BANKSEL always generates instructions to change all the > bits. Olins macros will even generate no code if no bits require > changing, so splashing the macro around before every instruction that > could access a register in a bank doesn't mean you fill up the code > space. ' And then, it is also worth noting that on the Enhanced Midrange PICs (with 32 banks) *one* MOVLB instruction sets all bankbits at once. This is one of the things that makes them perform better using the same source code as on the old Midrange PICs. Each bank-switch takes half the time/cycles (compared to a 4-bank PIC). And BANKSEL of course "knows" this. :-) Jan-Erik. --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .