Impact of ARM7 and arm9-flow on PC
"PC = PC + 1". This is not completely correct. The addition of one from the PC indicates that when there is no non-pipeline, it is decoded by referring to it, execution refers to sequential execution.
However, when there is a flow of water, it is more complicated. Here we use ARM7 and ARM9.
Class 7 is a 3-level flow. ARM9. During the execution process, the PC is incremented by 8 each time. The reason is as follows:
For ease of Problem description, we assume that the instruction at 0 address is being executed, and we can draw a clear conclusion from the following two figures.
The ARM7 is a three-level assembly line, and the three-level assembly line of amr7 is as follows:
There are 5-level pipelines for ARM9. the 5-level pipelines for arm9-are as follows:
It can be seen that the root cause of PC = current command execution address + 8 in both arm and arm is that in the assembly line design of both, the command execution stage is in the third stage of the assembly line.
R15 (PC) always points to the instruction that is taking the finger, instead of the instruction that is executing or decoding. In general, it is customary to refer to the first instruction as a reference point, so PC always points to the third instruction. When the arm status is set, each command is 4 bytes long. Therefore, the PC always points to the command address and adds an 8-byte address, that is, the PC value = the currentProgramExecution Position + 8;
Note: The PC in ads really points to the command to be executed. This is the result of software processing, mainly for the convenience of debugging the program.