New answers tagged

2 votes

Why does the x86 not have an instruction to obtain its instruction pointer?

OP specifically clarifies interest in a historical reason. Intel would have to give their exact reasoning but the following points are worth noting. Intel's 8086 and 8088 were outgrowths of their ...
user avatar
3 votes

Why does the x86 not have an instruction to obtain its instruction pointer?

There's a highly-upvoted comment, also requoted in this question's highest-voted answer, saying What would you need it for? So let me tell you about the coolest piece of code I ever wrote, because ...
user avatar
11 votes

Why does the x86 not have an instruction to obtain its instruction pointer?

So long as a stack exists, the IP address may easily be obtained via the byte sequence "E8 00 00 5B" [CALL $+3 : POP BX] because near calls use PC-relative addressing. On the other hand, ...
user avatar
  • 26.3k
10 votes

Why does the x86 not have an instruction to obtain its instruction pointer?

On 8086 the instruction pointer is not a general purpose register you can freely access for reading. On earlier 808x models this was also the case, even though program counter was directly used to ...
user avatar
  • 16.1k
15 votes
Accepted

Why does the x86 not have an instruction to obtain its instruction pointer?

As Thorbjørn Ravn Andersen already put it nicely: What would you need it for? There is almost no practical (*1) need to obtain the PC address at runtime (*2) - it's a value to be obtained during ...
user avatar
  • 166k

Top 50 recent answers are included