I'm curious about something on the memory organization of a PIC. We will use the 16F819 as an example.
Data sheet below:
http://ww1.microchip.com/downloads/en/devicedoc/39598e.pdf
Alright, there are general purpose registers in three different banks: Bank 0, bank 1, and bank 3.
Bank 0 has locations 20h through 7Fh, bank 1 has A0h through EFh, and bank 2 has 120h through 16Fh.
Say I were to need to move a value from general purpose memory location in bank 2 (Say location 121h) to the SSPBUF in bank 0.
Is it as simple as turning to bank 2, then using "MOVF 121h,w" --- turning back to bank 0, and then moving the value from w into the SSPBUF.
Are values in the W register always preserved when switching between banks?
Thanks.
Data sheet below:
http://ww1.microchip.com/downloads/en/devicedoc/39598e.pdf
Alright, there are general purpose registers in three different banks: Bank 0, bank 1, and bank 3.
Bank 0 has locations 20h through 7Fh, bank 1 has A0h through EFh, and bank 2 has 120h through 16Fh.
Say I were to need to move a value from general purpose memory location in bank 2 (Say location 121h) to the SSPBUF in bank 0.
Is it as simple as turning to bank 2, then using "MOVF 121h,w" --- turning back to bank 0, and then moving the value from w into the SSPBUF.
Are values in the W register always preserved when switching between banks?
Thanks.