>Well, I already had the suite before these questions came up >in my mind. You can understand wanting to understand :-) >what's going on under the hood. Yeah, sure, but I am not sure you're hood is heading the right way :)) >The PIClist site has been great. I found a few macros that do >BANKSELs and eventually it dawned on me that I could use DEFINEs >and IFDEFs to decide whether to do the bank switches. Defines >for the current bank and conditionals for the switch. ... I get the feeling you are confusing two separate operations. here is the relevant portion out of the beginning of a module from Olin's environment. Note that the bank for local variables is defined as lbank, and the bank for other global variables is gbank (set elsewhere in the *.ins module). Then at the bottom of the quoted piece the information the linker needs is set up as .bank#v. This tells the linker where the udata information is to go. This should always be constant unless you redefine the lbank. I have added a couple of comments to show exactly where the variable definitions should get put. To see why Olin declares a global area you will need to dig inside the development environment. You then need to look at the linker command file to see how the .bank#v (where #v gets converted to a number) gets matched to the correct ram bank. As an aside I always declare my externals in the global area as an indicator that they are accessed/accessing from/to elsewhere, and it tidies them away into a place where they are likely to be declared within the module that is declaring the globals anyway. ; ; Configuration constants. ; lbank equ 1 ; register bank for the local state of this module ; ; Derived constants. ; lbankadr equ bankadr(lbank) ; address within local state register bank ; ;*********************************************************************** ; ; Global state. All this state is assumed to be in the GBANK register ; bank by other modules. ; .bank#v(gbank) udata ; variables to go in global bank defined here ; ;*********************************************************************** ; ; Local state. ; if lbank != gbank .bank#v(lbank) udata endif ; variables to go in local bank defined here -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body