Re: How do I specify certain addresses to not be banked?
Jesse Gordon <[email protected]> Sun, 13 Sep 2009 09:39:31 -0700
| Newsgroups | gmane.comp.hardware.microcontrollers.gnupic |
|---|---|
| Message-ID | <[email protected]> |
Hi Raphael, Thank you very much. You were most helpful! Actually, I was, for some reason, under the impression that the banked bit was set by default in the assembler - but I see now that for addresses 0-7f it is not set - which is exactly and perfectly what I want! Then for my non-"globals" I can just define them with EQU 0x1xx and they will all use the current bank select. Thank you very much! -Jesse Raphael Neider wrote: > Hi Jesse, > >> And I wish to use the first half of bank 0 as "global" vars in the >> same way that the second half (the SFRs) are "global." >> > [>>snip<<] >> So, here is the question: How can I make some of my own ram locations >> also always be accessed in bank 0 without me having to specify the >> ",0" on every file instruction? >> >> For example, if I do: >> >> MyGlobalByte EQU 0xF01 >> >> As it is, the assembler just drops the F00 part and a CLRF on >> MyGlobalByte will clear byte 1 in the currently selected bank. Why >> can't the assembler see that I've specified 0xF01 and automatically >> clear the use-bank-selected bit - Just like it does for addresses >> above 0xF80? > > The PICs have an access bank, which is split into general purpose > registers (often 0x00 - 0x7F, sometimes 0x00 - 0x5F) and special > function registers (0x80 - 0xFF, which are mapped to 0xF80 - 0xFFF, > sometimes 0x60 - 0xFF, remapped to 0xF60 - 0xFFF). The split point > is defined by Microchip and cannot be changed. > You can use > > MyGlobalByte EQU 0x001 > ... > MyGlobalByte EQU 0x07F > SFR0xF80 EQU 0xF80 > ... > SFR0xFFF EQU 0xFFF > > and gpasm (knowing the memory layout of the target device) will > access these via the access bank. All other memory locations > (0x80 - 0xF7F) will use banked access - so use proper BANKSEL > directives where needed. > > Hope that helps, > Raphael > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > >