Table of Contents Previous topic Next topic
C COMPILER->Compiler Data Formats->function pointer
Function pointers are 16 bits wide for reentrant functions, 24 bits wide for small memory model non-reentrant functions and 32 bits wide for large memory model non-reentrant functions.
If a global variable pFunc is declared as a pointer to a reentrant function then the least significant byte of the function address is located at address _iVar, the most significant byte of the function address is located at address _iVar+1.
If a global variable pFunc is declared as a pointer to a small memory model non-reentrant function then the least significant byte of the function address is located at address _iVar, the most significant byte of the function address is located at address _iVar+1 and the address of the local data for the function is located at address _iVar+2.
If a global variable pFunc is declared as a pointer to a large memory model non-reentrant function then the least significant byte of the function address is located at address _iVar, the most significant byte of the function address is located at address _iVar+1, the least significant byte of the address of the local data for the function is located at address _iVar+2 and the most significant byte of the address of the local data for the function is located at address _iVar+3.