NASM - The Netwide Assembler
NASM Forum => Programming with NASM => Topic started by: junior_study on July 21, 2012, 01:59:13 PM
-
hi:
this instruction ? movl %cr3 , %eax
can this indtruction load cr3's value into eax?
thank you!
-
No, not in Nasm syntax. Try:
mov eax, cr3
... and not in user mode in a protected OS. A "mov" into or out of a control register is a "privileged instruction" - won't work in ring 3. From "real real-mode dos" (or "write my own OS mode", yes. Probably not meaningful until you've loaded something into it... and not effective until you've enabled paging (bit 31 in cr0, I think). Possibly in a kernel module...
You probably want to study the Intel/AMD manual(s), and/or http://www.sandpile.org and/or http://www.osdev.org More of a "senior study", I think. :)
Best,
Frank