mov eax, CR4 ??

mov eax, CR4 ??

Hi everyone,

Kinda askew but thought someone here might now. I'm trying to execute an asm command:

mov eax, CR4

which of course would read the control register CR4 and put it in eax. However when I execute this I am getting a privileged instruction error. Intel's Instruction Set Reference says that *writing* to a CR is privileged (0), but makes no mention of reading being privileged. Am I doing something wrong, or have I missed something in the reference?

Thanks!
-Dale

publicaciones de 2 / 0 nuevos
Último envío
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.

Hello,

The Intel manual uses the Intel assembly syntax. In this syntax "mov eax, CR4" means move the contents of CR4 into eax. Due to the error you describe, I will assume that you are using the compiler in Linux, where the AT&T assembly syntax is used. In that case the arguments to the instructions are reversed, which means that you should use "mov CR4, eax" to accomplish what you are trying to use.

I hope that I made the correct assumption and that this will help :-)

Ioannis

Deje un comentario

Por favor inicie sesión para agregar un comentario. ¿No es socio? Únase ya