I've been reading books on the ARM Cortex-M architecture and as already mentioned in other post, all the books are consistent in saying that the PC points four bytes (Thumb Instruction Set) forward due to Pipeline (prefetch).
Did some testing with debugger, and ended up getting more confused, in theory I fully understand the reasons for the PC is 4 bytes, and perfectly understand the adjustment made by the debugger to display the PC value correctly as the executing statement.
But I was confused when I read that the PC is set temporarily when used to calculate the approximate memory locations to load the registers.
I quote the part that left me very confused, Section 3.1.5 of the book "The Definitive Guide to the ARM Cortex-M3, Second Edition" jyiu:
"In other instructions like literal load (reading of a memory location related to current PC value), the effective value of PC might not be instruction address plus 4 due to alignment in address calculation. But the PC value is still at least 2 bytes ahead of the instruction address During execution. "
Could anyone suggest me a specific reading about this behavior, but more detailed, noting that perfectly understood the operation, but I feel as if something was missing on the subject.
That for many is a trivial question, but I want to go forward with pendencies in the understandings.
Thank you.