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.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: EIP (instruction pointer) register  (Read 931 times)
David Williams
Developer

member is offline

Avatar

meh


PM

Gender: Male
Posts: 452
xx EIP (instruction pointer) register
« Thread started on: May 26th, 2009, 9:44pm »

How can I read the contents of the EIP register, and is it safe to directly modify it?

This pertains to my attempt to create some position-independent code.


Regards,

David.
User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx 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!

Richard.
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls