// Topic: explain the problem of the arm assembly line such as add r0, PC, # g_oaladdresstable-(. + 8 ).
// By gooogleman
// Mail: gooogleman@foxmail.com
// URL: http://blog.csdn.net/gooogleman/article/details/7651548
About add r0, PC, # g_oaladdresstable -(. + 8) Many people have asked about this command in the csdn forum. I have answered a lot before. I am still in the Development Board Technical Support Group, it seems that he does not understand what to say.
In fact, he is in a dead end and has to think about it with his own mind.
In fact, this is what arm agreed to do. Arm uses this pipeline method to do it very scientifically, just like our factory pipeline method in reality, which can improve efficiency.
Well, no matter whether it is ARM7, arm11, or even s5pv210, it is in line with the title. The reason is as follows:
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, so the PC always points to the command address plus an 8-byte address, that is, the PC value = the current program execution Position + 8;
Among the three eboot instances
Add R11, PC, # g_oaladdresstable-(. + 8)
In winceeboot of sate210 I also have the following:
Add R11, PC, # g_oaladdresstable-(. + 8)
Don't you understand?
Let's see arm's official documents.
Complete introduction see documents: http://www.arm.com/pdfs/comparison-arm7-arm9-v1.pdf
Let's look at the meaning of this paragraph!
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, so the PC always points to the command address plus an 8-byte address, that is, the PC value = the current program execution Position + 8;