On Mon, 18 Jan 1999 13:56:07 +0100 Radboud Verberne writes: >Hi PIC'ers, > >When I changen from a 16c62a to a 16c63 I found something in the >datasheet that I do not understand. On page 139 of the datasheet they say that >you have to define save_w in all the banks... How do I define save_w >twice? In bank 0 it is defined with a cblock... save_w is at 0x45. How do I >define the save_w at 0xC5? > >another cblock does not work, save_w equ 0xC5 does not work... What >should I use? > >(BTW first time i use a chip with more than one page of program >memory) Actually, you only have to define the label once (and you can use cblock or equ to do this), and, in fact, you cannot define it twice, since a symbol can only have one value. However, since you don't know how the bank select bits will be set when the dreaded interrupt strikes, and the first thing your store-context routine does is save w in a file register, we don't know which bank of RAM that will go in (and we don't want to mess with the bank select bits before we save them using the swap status,0). SO, all you need to do is MAKE SURE nothing else uses ram location 0xc5. If store context is called when bank 0 is currently active, w will be stored at 0x45. If store context is called when bank 1 is active, w will be stored at 0xc5. Restore context knows where to get the saved w from because you restore the bank select bits (part of status) prior to restoring w. Summarizing, define your save_w in bank 0 (you might want to have it be your first ram location so it doesn't accidentally get moved by later inserting cblocks). Figure out where the assembler put save_w, and make sure nothing uses that location in bank 1. You could insure it is free by declaring save_w_1 at 0xc5 so an error message is generated if something else ends up on top of it. Harold Harold Hallikainen harold@hallikainen.com Hallikainen & Friends, Inc. See the FCC Rules at http://hallikainen.com/FccRules and comments filed in LPFM proceeding at http://hallikainen.com/lpfm ___________________________________________________________________ You don't need to buy Internet access to use free Internet e-mail. Get completely free e-mail from Juno at http://www.juno.com/getjuno.html or call Juno at (800) 654-JUNO [654-5866]