Geoff Wootton wrote: > > Hi folks, > > I'm having trouble understanding the include file for the > PIC17C43 (p17c43.inc). I would have assumed the banked registers > would have the same memory locations but this is not the case. > Taking SPBRG and PIE as an example, these are both located at > location 17H, the SPBRG being in bank 0 and PIE being in bank 1. > Why are these listed in the include file as location 17 and 117 > respectively? > ... They will assemble and exectue properly either way, since the instruction can only hold 8 bits in the operand, 117 will get truncated to 17. However, if you change them both to 17, then MPLAB's watch windows (and Modify dialog) will not be able to distinguish between them. Using the full address is mainly for the debugger, which allows you to watch each of these (and others) as you single step. MPLAB-ICE also, when watching the internal data bus of the 17C43 will be able to properly tag accesses to SPBRG or PIE since it "looks at" the bank select lines and also generates the full 8bit+BSR address. Recommendation: Don't change the include file. Also, use the full addresses for your user variables, as well, so that you can debug them with MPLAB. -- ___________________________ | Darrel Johansen | | tempe, arizona | | darrelj@primenet.com | |_________________________|