BBC BASIC for Windows
« EIP (instruction pointer) register »
Welcome Guest. Please Login or Register. Apr 5th, 2018, 10:29pm
ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018. Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.
If you require a dump of the post on your message board, please come to the support board and request it.
Re: EIP (instruction pointer) register
« Reply #1 on: May 26th, 2009, 10:30pm »
Quote:
How can I read the contents of the EIP register
You can use this code to copy eip into eax:
Code:
call next
.next
pop eax
Note that although this will always work, it may cause performance issues on modern processors which expect a call always to be paired with a ret.
Quote:
is it safe to directly modify it?
I'm not too sure what you mean by "directly" modifying it, but all the common means of modifying eip (jmp, call, ret) are "safe" in the sense that you should be able to rely on them doing what they're supposed to do!