'Getting an "not in bank 0" error that I can not ge'
part 0 16 bytes
> Getting an "not in bank 0" error that I can not get rid of.
The assembler is brainless. It has *no idea* what bank you may be in,
or even should be in. It generates errors literally, just to keep you
on your toes!
There is a way to do it, but for the moment I'd just forget it. I
mailed a message with the commands to suppress that message and another
even sillier one IIRC. Just use them and carefully set up the banks the
way *you* think they should be after careful consideration. And do
learn to use the TRIS instruction that makes it all far easier in the
I'll analyse your code much more carefully after I have a nap and feel
Paul; I remember this issue over safe use of high and low bank naming in
assembly, so I asked the supreme professor, Andrew Warren. His answer to me
Actually, I DISCOURAGED the practice of doing the XOR in the
file-register equate; here are the four methods that are
commonly used, along with my reasons for using Method #4 over
Note: In the following examples, "XXX" is a register address
on page 1 (i.e., between 0x80 and 0xFF).
REG EQU XXX-128 ;Generates no warnings, but
.... ;also doesn't allow REG to
MOVWF REG ;be viewed in MPASM watch
;windows. Equivalent to:
; REG EQU XXX & 0x7F
; REG EQU XXX ^ 0x80
;both of which have the same
REG EQU XXX ;Generates an MPASM warning.
MOVWF REG ;
REG EQU XXX ;Generates no warning, EVEN
.... ;when accidentally used with
MOVWF REG & 0x7F ;a page-0 register.
REG EQU XXX ;Generates no warning when
.... ;used correctly (i.e., when
MOVWF REG ^ 0x80 ;REG is on page 1), but DOES
;generate a warning when
;accidentally used with a
Chris Eddy wrote:
> Paul; I remember this issue over safe use of high and low bank naming
> in assembly, so I asked the supreme professor, Andrew Warren. His
> answer to me is below.
He didn't mention using the TRIS instruction and just doing it
Since you ask. The *really* neat way is to use a variable called,
say, RBANK, and using
RBANK is set to 0 at the start of the code, and you use two macros:
RBANK SET 0
RBANK SET 0x80
And use them as commands to set and clear the RB bit where you think
they are needed in the code. If you now get an error, it implies you
didn't set it right though this can be confused by program flow.
More... (looser matching)
- Last day of these posts
- In 1999
, 2000 only
- New search...