4.6.15 Generic Pointers

Next: 4.6.16 PIC16 C Libraries Up: 4.6 The PIC16 port Previous: 4.6.14 Interrupts Contents Index

## 4.6.15 Generic Pointers

Generic pointers are implemented in PIC16 port as 3-byte (24-bit) types. There are 3 types of generic pointers currently implemented data, code and eeprom pointers. They are differentiated by the value of the 7th and 6th bits of the upper byte:

pointer type | 7th bit | 6th bit | rest of the pointer | description
data | 1 | 0 | `uuuuuu uuuuxxxx xxxxxxxx` | a 12-bit data pointer in data RAM memory
code | 0 | 0 | `uxxxxx xxxxxxxx xxxxxxxx` | a 21-bit code pointer in FLASH memory
eeprom | 0 | 1 | `uuuuuu uuuuuuxx xxxxxxxx` | a 10-bit eeprom pointer in EEPROM memory
(unimplemented) | 1 | 1 | `xxxxxx xxxxxxxx xxxxxxxx` | unimplemented pointer type

Generic pointer are read and written with a set of library functions which read/write 1, 2, 3, 4 bytes.

Next: 4.6.16 PIC16 C Libraries Up: 4.6 The PIC16 port Previous: 4.6.14 Interrupts Contents Index