Byron Jeff wrote 2012-04-25 14:16: > On Wed, Apr 25, 2012 at 01:52:51PM +0200, Jan-Erik Soderholm wrote: >> >> >> Byron Jeff wrote 2012-04-25 13:25: >>> On Wed, Apr 25, 2012 at 12:44:45PM +0200, Jan-Erik Soderholm wrote: >>>> >>>> >>>> Byron Jeff wrote 2012-04-25 12:30: >>>>> On Wed, Apr 25, 2012 at 11:16:06AM +0200, Jan-Erik Soderholm wrote: >>>>>> Byron Jeff wrote 2012-04-25 04:51: >>>>>> >>>>>> > Note you can use BANKSEL instead of the movlb if you like, >>>>>> > which will only generate the movlb if the bank changes. >>>>>> >>>>>> Are you saying that BANKSEL in some way tracks the current >>>>>> state of the bank-bits? Are you sure? I think BANKSEL >>>>>> always will create the apropriate MOVLB command. >>>>> >>>>> Really? Not an MPASM user, so I'm unsure. >>>> >>>> Yes, it is possible when writing *own* macros, of course. >>>> >>>> Olin Lathrops tool-set has been like that "always". >>>> With some complementary macros to "invalidate" the >>>> saved setting after returning from a CALL and so on. >>>> >>>> But the question is/was about BANKSEL i MPASM, not ? >>> >>> Not exactly. Dwayne wanted to keep the 302 warnings on, but use some fo= rm >>> of macros and defines to check the current bank, whether or not it was >>> generated with BANKSEL or MOVLB. It's not clear if his set of macros >>> guaranteed that the bank bits RP0/RP1 were set correctly or not. What I= 've >>> generated will generate both the MOVLB and will track what BSR is set t= o. >>> So as long as the code is straight line it'll only generate 302 warning= s >>> when the register is not in sync with current value of BSR. >>> >>> BAJ >>> >> >> OK, I think I see now. :-) >> >> Your reference to BANKSEL (that I quoted above) was "when used >> inside your own macro", not to BANKSEL i general, right ? > > Actually I was asking about BANKSEL in general. But it's clear now that i= t > doesn't track. > >> >> Of course, if the BANKSEL is never run at all, it will not >> generate any code either... :-) > > 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 t= oo > 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 t= he > older chips ever. With enhanced chips in every package size, I cannot see= a > good reason to every move back. > > BAJ > Ah, OK. :-) Case closed. It's always good to clear out the details, it's where the devil lives after all, not ? :-) 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 .