2010-05-28 01:07 AM
Testing Register R0-R12
2011-05-17 04:52 AM
''I found out that the problem is that I destroy R7, when I take a look after compiling to my assembler code I can see that my application is moveing R7 to the stack pointer?!? But why?''
I would guess that the compiler is saving R13 in a register and that register happens to end up being (after register allocation) R7. Do as PICguy suggests. Only R0 to R3 are scratch registers and so other registers need to be specifically preserved.2011-05-17 04:52 AM
A quick push of r4-r12 before your test followed by the corresponding pop should solve your problem. ARM C code expects r4-r12 to be preserved on subroutine calls. Possibly useful: add LR to your push and PC to your pop.