pushing the control registers

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Pyrofan1
Member
Member
Posts: 234
Joined: Sun Apr 29, 2007 1:13 am

pushing the control registers

Post by Pyrofan1 »

i tried

Code: Select all

push %cr0
but that gives me
kernel/isr.s:263: Error: suffix or operands invalid for `push'
Ninjarider
Member
Member
Posts: 62
Joined: Fri Jun 29, 2007 8:36 pm

Post by Ninjarider »

not sure what compiler your using. i use masm. and in masm you would want to do mov ax, cr0

dont know if it will let you push cr0
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: pushing the control registers

Post by Brendan »

Hi,
Pyrofan1 wrote:i tried

Code: Select all

push %cr0
For control registers, debug registers and test registers, there are no instructions for pushing, popping or moving to/from memory - the only way to access them is moving to/from general registers, for e.g.:

Code: Select all

    movl %cr0, %eax
    pushl %eax

Code: Select all

    popl %eax
    movl %eax,%cr0
Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Post Reply