4 years, 4 months ago.

How to modify sp(r13), lr(r14) and pc (r15) as they cannot be directly read (inline assembly) keil

I want to change sp,lr and pc register values. I am using nucleo l476xx board. It has arm m4 processor. I read it here http://www.keil.com/support/man/docs/armcc/armcc_chr1359124249383.htm {No variables are declared for the sp (r13), lr (r14), and pc (r15) registers, and they cannot be read or directly modified in inline assembly code.}

Please tell me how I can do that. I am doing it for the purpose of creating checkpoints.


posted by Furqan Arshad 07 Sep 2016

1 Answer

4 years, 3 months ago.

As stated in the docs, these registers are special and cannot be modified during runtime. Only way of manipulating would be using an external debugger.

I have figure out the answer. I can modify these registers using external assembly code.

posted by Furqan Arshad 05 Oct 2016