Jump to content

32 bit instruction set - The Program Counter


Recommended Posts


Hello,
Why is the Program counter 8 bytes ahead of its current instruction? Is this ARM in particular ?
Isn't it supposed to be current instruction + 4  ?

Would like to understand why it is current instruction + 8
Would be really appreciated!

screenshot_20210816_004718.png

Link to comment
Share on other sites

Thanks for the link.
I'm think i understand.
Ok 3 stage pipeline. (fetch, decode, execute)
So for each clock the PC gets incremented by 4. Two clocks(fetch, decode) already happened before the execution.

So it should look like this? :

0x00000032 LDR R0, [PC,#68] -- execute +0 ; PC current instruction
0x00000036 LDR R0, [PC,R0] --decode +4
0x0000003A LDR R0, [R0] -- fetch +8 ; The fetch instruction which the PC is on


So PC is two instructions a head of its original value.

screenshot_20210816_125044.png

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.