----- Original Message ----- From: "Rex Byrns" To: Sent: Tuesday, May 21, 2002 5:21 PM Subject: Re: [PIC] - Detecting the press of a button > Thanks guys, > > Most of my frustration is now gone after realizing that at some point I must > have deleted the line that selected bank 0 after setting tris in bank 1. Bit > tests are now reporting as expected. > > Why the ^%&^%*^%(&%% doesnt the assembler catch this? It has those annoying > messages about specifying a bit in bank 1. Oh well it is free. Because in general it cannot catch this. It doesn't have any idea at assembly time what might be in what registers at run time. It just makes the assumption that the current bank is zero and complains about any reference outside that bank (the familiar 302 warning). I sure would have liked to see pseudo-op that would allow you to tell the assembler what the bank is intended to be at any point. For example: INBANK0 ; tell the assembler we are now in bank 0 bsf PORTB,0 ; so it won't complaina about this bsf TRISB,0 ; but it will complain about this bsf STATUS,RP0 ; tell processor to go to bank 1 INBANK1 ; let the assember know that bsf PORTB,0 ; now this will generate a warning bsf TRISB,0 ; but this won't Olin Lathrop has a nice set of macros that behave sort of like this, and I have created a similar set (which one of these days I am going to post) but it would have been nice to have the feature right in the assembler. Bob Ammerman RAm Systems -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu