gnupic@linuxhacker.org
gnupic@linuxhacker.org
> (as an aside, I've toyed with the idea of adding a simulator
> assertion so that you could write:
>
> assert BSR=(some_reg>>8)
> movf some_reg,W,B
I'd *really* like to have an assembler directive that told GPASM
what the value of BSR was expected to be. Just as you've proposed
for the simulator, but interpreted by the assembler as well. Then
the algorithm in the assembler would be:
if the user explicitly set the bank bit
use the specified value
else if the register address is a global register
use B=0
else if the register is in the same bank as specified to the
assembler by the pseudo-op
use B=1
else
generate assembly error
I've also wanted this on the PIC16 for years. I actually did hack
something like this into my own assembler, but I gave up on maintaining
my own assembler about five years ago for lack of time.
As I understand it, this concept is similar to the "assume" directive
of x86 assemblers. Perhaps "assume" is a suitable name for this
as well, with an operand that is a register address.
Eric
gnupic@linuxhacker.org