gnupic: Re: [gnupic] How do I specify certain addresses to not be banked?


Previous by date: 13 Sep 2009 10:45:06 -0000 How do I specify certain addresses to not be banked?, Jesse Gordon
Next by date: 13 Sep 2009 10:45:06 -0000 Re: [gnupic] How do I specify certain addresses to not be banked?, Jesse Gordon
Previous in thread:
Next in thread: 13 Sep 2009 10:45:06 -0000 Re: [gnupic] How do I specify certain addresses to not be banked?, Tamas Rudnai

Subject: Re: [gnupic] How do I specify certain addresses to not be banked?
From: "Raphael Neider" ####@####.####
Date: 13 Sep 2009 10:45:06 -0000
Message-Id: <op.uz6ysxah6ymby6@neider-desktop>

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

Previous by date: 13 Sep 2009 10:45:06 -0000 How do I specify certain addresses to not be banked?, Jesse Gordon
Next by date: 13 Sep 2009 10:45:06 -0000 Re: [gnupic] How do I specify certain addresses to not be banked?, Jesse Gordon
Previous in thread:
Next in thread: 13 Sep 2009 10:45:06 -0000 Re: [gnupic] How do I specify certain addresses to not be banked?, Tamas Rudnai


Powered by ezmlm-browse 0.20.