Data Pointers

The Siemens 80C517 and 80C537 provide 8 data pointers which can be used to improve memory accesses. Using multiple data pointers can improve the execution of library functions such as: memcpy, memmove, memcmp, strcpy, and strcmp. The 8 data pointers of the 80C517 and 80C537 can also reduce the stack load of interrupt functions.

C51 uses only 2 of the 8 data pointers of the 80C517 at a time. In order to keep the stack load in the interrupt routines low, C51 switches to 2 unused data pointers when switching the register bank. In this case, the contents of the register DPSEL are saved on the stack and a new pair of data pointers is selected. Saving the data pointers on the stack is no longer required.

If an interrupt routine does not switch to another register bank (e.g., the function is declared without the using attribute), the data pointers must be saved on the stack (using 4 bytes of stack space). To keep the size of the stack as small as possible, use the MOD517(NODP8) directive to compile the interrupt routine and the functions called from within the interrupt. This generates code for the interrupt that uses only one data pointer and, therefore, only 2 bytes of stack space.