> because "gbankadr" is declared in the INS file : > > gbankadr equ H'20' ;adr within globals bank Ah! Now I understand the other problem too (again, this is why I wanted to see ALL your code). This should be 30h, not 20h. Part of the confusion comes for several uses of the term "global". The "global" relating to GBANKADR refers to variables that are defined GLOBAL between modules so that other modules can access them using EXTERN. GBANK and GBANKADR help you identify where default global variables live. It's intended to be used like: extern somevar ;global variable defined elsewhere dbankif gbankadr ;set banks for access to global variables movf somevar, w ;access a global variable We sometimes also refer to "unbanked" RAM as "global" RAM. This has to do with the processor, not with how your code uses it. Many 16F parts have such RAM from 70h to 7Fh. The 12F629 is a little unusual in that all of its RAM is unbanked, which is what's causing the confusion here. For code compatibility, I partitioned the 20h to 5Fh RAM of the '629 into the traditional block of 16 unbanked locations, then created a .BANK0 segment of the rest as if it were banked. GBANKADR should therefore be 30h because this is in the .BANK0 segment. DBANKIF knows that all the memory is unbanked and won't emit any code for DBANKIF GBANKADR as long as it's set to any of the real RAM addresses. > But what about the .BANK0 bank starting at 0x30 ? > I can't find any symbol to use with the DEFRAM macro. Generally you would use GBANKADR or LBANKADR or a private symbol you define that is known to be in the same physical memory bank of whatever RAM segment you are using. > (There is a symbol called "BANK0ADR" with the value 0x00, which > is the wrong address for .BANK0, not ?) Yeah, that's a problem. Technically 0 is correct because it is an address within bank 0. However, it would be more useful if it were an address within the .BANK0 section. That way DBANKIF would know to not emit any bank setting instructions. I hadn't forseen a memory architecture like the 12F629 when I created these symbols. I guess I need a more general way of defining the memory architecture. For now, define GBANKADR as 30h and change the UDATA_SHR in the INTR module to DEFRAM COMMREGS_FIRST, stay away from the BANKnADR constants, and everything should work. ***************************************************************** Embed Inc, embedded system specialists in Littleton Massachusetts (978) 742-9014, http://www.embedinc.com -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body