Re: [Sdcc-user] Function addressing

2009-01-19 Thread Frieder Ferlemann
Maarten Brock schrieb: > Ok, make it a const function pointer then. And to get > rid of the warning add a cast too: > > void (* const fp)(void) = (void (*)(void))0xFFF0; > fp(); Or directly: ((void (*)(void))0xFFF0)(); Greetings, Frieder --

Re: [Sdcc-user] Function addressing

2009-01-19 Thread Maarten Brock
Ok, make it a const function pointer then. And to get rid of the warning add a cast too: void (* const fp)(void) = (void (*)(void))0xFFF0; fp(); Now it's as small as the inline asm. Maarten > The resulting code using the C version generates this assembly instructions: > > mov _fp,#0xF0 >

Re: [Sdcc-user] Function addressing

2009-01-18 Thread Jesus Calvino-Fraga
The resulting code using the C version generates this assembly instructions: mov _fp,#0xF0 mov (_fp + 1),#0xFF . . . mov dpl,_fp mov dph,(_fp + 1) lcall __sdcc_call_dptr That is 15 bytes of code memory and two bytes of RAM. On the other hand, the assembly call (within C) lcal

Re: [Sdcc-user] Function addressing

2009-01-18 Thread Maarten Brock
Or in C void (*fp)(void) = 0xfff0; fp(); > Try: > > _asm lcall 0xfff0 _endasm; > > > At 10:59 AM 18/01/2009, Gudjon I. Gudjonsson wrote: > > >Hi > > Sorry once again if the question is silly but I am trying to call the > >PGM_MTP at address 0xFFF0 > >function in the in application bootlo

Re: [Sdcc-user] Function addressing

2009-01-18 Thread Jesus Calvino-Fraga
Try: _asm lcall 0xfff0 _endasm; At 10:59 AM 18/01/2009, Gudjon I. Gudjonsson wrote: >Hi > Sorry once again if the question is silly but I am trying to call the >PGM_MTP at address 0xFFF0 >function in the in application bootloader for the NXP 8051 microcontrollers. >The problem is that I don

[Sdcc-user] Function addressing

2009-01-18 Thread Gudjon I. Gudjonsson
Hi Sorry once again if the question is silly but I am trying to call the PGM_MTP at address 0xFFF0 function in the in application bootloader for the NXP 8051 microcontrollers. The problem is that I don't know how to put an absolute address on a function. I know how to absolute address variab