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
--
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
>
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
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
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
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