We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
If I have the address of particular function, is it possible load the function in assembly? I understand that usually the function is loaded as LCALL _function but I was wondering whether it is possible to load the function with its address? Appreciate anyone who can offer me advise on this. Thank you.
Basicly, the return address and the function pointer are loaded onto the stack and then a RET instruction causes the CPU to pop the address of the function pointer into the PC. That technique has no excuse being used on the 8051, which has a perfectly fine "computed goto" instruction:
JMP @A+DPTR
Hi, Sometimes it needs to keep DPTR unmodified, for example, if you pass a parameter to called function via DPTR. So the usage of "call-via-stack" method is still usable with C51. Regards, Oleg