This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

function pointer assignment

Note: This was originally posted on 22nd December 2008 at http://forums.arm.com

Hi,

I've a scenario here.

say, i have 2 functions. func1 and func2.

func1is at adddress 0x28 and func2 at some other location.
now, i have to pass func1 through func2 (where func1 is a callback function)

func2(func1);
while executing the above,  i observed in the assembly instruction that,

ldr r3,0xdb1f0 is called where

At 0xdb1f0:  dcd 0x29 is found.
so that r0 =0x29  (address of func1+1)

Now my question is:
1. why the func1 address 0x29 (func1+1) is loaded instead of 0x28 (func1). what is the logic behind this behaviour.

Please some one answer my question. Though it is not obstructing my work, just curious to know the reason for this behaviour.

Thanks
0