What is the use of writing to the program counter in the arm?
who is the target users for this?
Hi DEEPAKSA R,
Writing to the PC was a common practice on the 32b legacy Arm cores. Before armv4t, there was no BX instruction. Programmers were using a single LDM instruction at the end of their function with the PC in the registers list. This was effectively implementing POP + RETURN in one instruction.
On recent 32b Arm cores it is more frequent to use a BX instruction to explicitly return from a function. Also usually not all the instructions writing to the PC can be predicted.
With the more recent armv8 aarch64, writing directly to the PC is not possible anymore.