|Jamie Lawson (evbhort.uoguelph.ca) wrote: jlawson
>My question has to do with accessing registers in different pages,
>To access PORTA you must set the page bits to point to
>page 0 and refer to this register as loaction 0x05.
>To access TRISA you must set the page bits to point to
>page 1 and refer to this register as location 0x85.
>Just out of curiosity, why is it necessary to change pages AND refer
>to a different location? Why do you not simply change page registers
>and reference the same relative register. In the above example TRISA
>would be on page 1 but be register 0x05?
It's not necessary to do both. In fact, if you look at the opcode
generated by a "MOVWF 0x85", you'll see that it's identical to the
opcode for "MOVWF 0x05"... That's why the page-select bits are required
in the first place.
The Microchip assembler will even give you a warning when it assembles
your source code, telling you that it's truncating the register address.
Andrew Warren - ix.netcom.comfastfwd
Fast Forward Engineering, Vista, California
More... (looser matching)
- Last day of these posts
- In 1995
, 1996 only
- New search...