| Under most other ICC compilers, a function pointer is the same as the function address. However, for ICCAVR and other compilers that use the Code Compression technology, a function pointer is the address of a word in the flash containing the address of the function. In other word, lets say "_foo" is the name of the function, the compiler generates something like:
.area func_lit
PL_foo::
.word _foo
and whenever a function pointer is needed, the compiler returns the address of PL_foo instead of _foo. When you call a function via a function pointer, the compiler knows there is an extra level of indirection and will do the right thing.
kristil@imagecraft.com |