gnupic: How do I specify certain addresses to not be banked?
Subject:
How do I specify certain addresses to not be banked?
From:
Jesse Gordon ####@####.####
Date:
13 Sep 2009 05:07:07 -0000
Message-Id: <4AAC7887.90605@nikola.com>
Greetings. This is my first post - so please be patient as I learn the
ropes. Thanks!
I'm working with an 18f1220.
I wish to use bank 1 for my main code, and bank 2 for my low priority
ISR so they can have each plenty of non-shared ram.
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."
Let me explain:
PORTA, for example, is defined as:
PORTA EQU H'0F80'
Let's say I then do a:
CLRF PORTB
the assembler (gpasm-0.13.4 beta) does (and should) clear the access bit
so the CLRF will always operate on 0x80 in bank zero.
Thus, no matter what bank is currently set in BSR, a CLRF on PORTA will
always hit bank 0...
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?
That way, whenever I do an operation on MyGlobalByte, it would always
(without me having to specify ",0") access 0x01 in bank 0.
Surely I can go change some line in some file to make it do that task
for the range of 0xF00-0xFFF since it already does it for 0xF80-0xFFF.
Thank you very much,
-Jesse