PDA

View Full Version : arm/thumb BL (branch w/ link)



Kontact
12-11-2002, 03:15 AM
hello ppl,

does anyone knows how to calc the offset.

0x7F5BA F0 FE F8 27 (BL 10420e)

how did it calc the (F0 FE F8 27)?

i think F0 is the BL and FE F8 27 is the offset?

am trying to subtract 0x10420e - 07f5BA. but it's not FE F8 27.


any help would be appreciated.


thanks

tnp
13-11-2002, 11:55 AM
0x7F5BA F0 FE F8 27 (BL 10420e)

BL is a 32bit instruction, so F8 also contains some information what is not for the offset. BL instruction's format in binary:
11110xxx xxxxxxxx 11111xxx xxxxxxxx

You can get the offset from the bits signed with x. From this example you can read 0x7F027 from the x bits. You have to multiply this by 2 or 4 (i don't remember) and add to the next operations address to get the jumps destination. But I think something is wrong in your example!

Kontact
14-11-2002, 01:41 AM
hello tnp,

the sample is from 8210v531. anyways, i could have type the wrong hex.

i will try your idea and see if i could get the right offset value..

btw, what arm/thumb doc did u study to learn this. could u send it or post it.

regards,