|
Ok - I'm pretty sure I solved this mystery now..
The cpu is an Atmel AT91 series which has internal ram mapped in memory ~0x300000 at boot.. The code can then write to an internal register to re-map the ram to Page 0. I watched the code, and it does just this, eventually executing code back from address 0 (which is now executing from ram)...
On the 2nd time round now, the MOV commands make sense, as R0-R3 were populated prior to the RAM remapping, so the code in this 2nd time through is now saving those registers.
At least, that's my theory.. :)
|