Page 1 of 1

Get the Contents of EIP and CR1 in Real Mode

Posted: Fri Aug 20, 2004 5:47 am
by XStream
Hey,

Just as the topic says, I need get the contents of EIP and CR1 so that my error handler can print up the state of the machine, I am currently in real mode but it is probably the same no matter what mode your in.

I have tried

Code: Select all

mov   eax, eip/cr1
and I have also tried

Code: Select all

push   eip/cr1
pop   eax
But neither way works??

Cheers.

Re:Get the Contents of EIP and CR1 in Real Mode

Posted: Fri Aug 20, 2004 6:03 am
by Candy
XStream wrote: Hey,

Just as the topic says, I need get the contents of EIP and CR1 so that my error handler can print up the state of the machine, I am currently in real mode but it is probably the same no matter what mode your in.

I have tried

Code: Select all

mov   eax, eip/cr1
and I have also tried

Code: Select all

push   eip/cr1
pop   eax
But neither way works??

Cheers.
For eip

Code: Select all

call nearjump
nearjump:
pop eax
CR1 doesn't exist. It's physically not existant in the processor afaik.

If it was, you could read it with mov eax, cr1 (movl %cr1, %eax).

Re:Get the Contents of EIP and CR1 in Real Mode

Posted: Fri Aug 20, 2004 6:44 am
by Solar
CR1 is reserved for all purposes, according to the Intel manuals. Even if you could print its values, it wouldn't help anyone anything. ;)

Re:Get the Contents of EIP and CR1 in Real Mode

Posted: Fri Aug 20, 2004 7:31 am
by XStream
Thanks guys.

Re:Get the Contents of EIP and CR1 in Real Mode

Posted: Fri Aug 20, 2004 8:53 pm
by Brendan
Hi,
Candy wrote:

Code: Select all

call nearjump
nearjump:
pop eax
For real mode you might want to use "pop ax" instead of "pop eax"....


Cheers,

Brendan