Problems with running the blinker program - page 2 - General Discussion and Assistance - CHDK Forum supplierdeeply

Problems with running the blinker program

  • 12 Replies
  • 3204 Views
*

Offline RaduP

  • *****
  • 890
Re: Problems with running the blinker program
« Reply #10 on: 17 / August / 2009, 04:08:39 »
Advertisements
Ok, thanks for the input. I disassembled the code with my disassembler, and it became "bl ff993bd8"
WTF... I'll try using IDA, just to make sure is not a bug with my disassambler, but if it isn't, then I am very confused, since the location is pretty close to where it should jump..

*

Offline RaduP

  • *****
  • 890
Re: Problems with running the blinker program
« Reply #11 on: 17 / August / 2009, 04:17:11 »
Ok, same result in IDA.. This is really strange :/

*

Offline reyalp

  • ******
  • 12585
Re: Problems with running the blinker program
« Reply #12 on: 17 / August / 2009, 04:50:49 »
It's not strange, it's exactly what I said would happen. BL only operates on a 24 bit PC relative value. So 0xff993ac4 = (PC - 6735164)

Since your code is loaded somewhere near the start (near 0x1900 or 0 depending on whether it's relocated) it will wrap around to just about the same address. However, even if you ended up with the right address, it wouldn't be legal:
Quote from: ARM Architecture Reference Manual
Memory bounds
 Branching backwards past location zero and forwards over the end of the 32-bit address space is UNPREDICTABLE.
Don't forget what the H stands for.

 

Related Topics