Page 1 of 1

pushing the control registers

Posted: Fri Jun 29, 2007 9:38 pm
by Pyrofan1
i tried

Code: Select all

push %cr0
but that gives me
kernel/isr.s:263: Error: suffix or operands invalid for `push'

Posted: Fri Jun 29, 2007 9:41 pm
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

Re: pushing the control registers

Posted: Fri Jun 29, 2007 11:19 pm
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