Maarten Brock - 2006-12-07

Logged In: YES
user_id=888171
Originator: NO

Alfred,

This can already be done with function pointers with or without typedef:

typedef int (*fp)(int);

void main()
{
int (* const test1)(int) = (int(*)(int))0x2400;
const fp test2 = (fp)0x2500;

test1(1);
test2(1);
}

Unfortunately it does not optimize when the function pointers are global.

Do the fixed functions in on-chip rom use SDCC's calling convention for passing parameters and results? Otherwise it only works for void(void) functions.

Maarten