[Icc-mot] Arrays of function pointers and paged functions

Barry Callahan barryc at rjlsystems.com
Fri May 11 10:05:34 PDT 2007


I've been playing, off and on, with some code to try and figure out why, 
when I have expanded memory enabled and paged functions are default in 
my project, trying to call functions via an array of pointers "Just 
Doesn't Work".

This morning, I had an epiphany. The reason it doesn't work is that the 
MCU doesn't know it needs to swap pages before calling the function. If 
I use a pragma to make all of the functions that I want to call via the 
array nonpaged, it works.

Is there a way that I can use an array to call the functions without 
having them all have to be nonpaged?

I mean, I know I can use trampolines. Or I can use a switch structure. 
But both of these alternatives are somewhat sub-optimal.

-- 
#/******************************\
#* Barry Callahan               *
#* RJL Systems                  *
#* phone: 1 586 790 - 0200 x112 *
#*        1 800 528 - 4513 x112 *
#* fax:   1 586 790 - 0205      *
#\******************************/



More information about the Icc-mot mailing list