46 lines
686 B
NASM
46 lines
686 B
NASM
; asmfuncs.asm
|
|
; Josh Holtrop
|
|
; 10/23/03
|
|
|
|
[global _write_cr0]
|
|
[global _read_cr0]
|
|
[global _write_cr3]
|
|
[global _read_cr3]
|
|
|
|
;stores the parameter to the CR0 register
|
|
;extern dword write_cr0(dword cr0);
|
|
_write_cr0:
|
|
push ebp
|
|
mov ebp, esp
|
|
mov eax, [ebp+8]
|
|
mov cr0, eax
|
|
pop ebp
|
|
ret
|
|
|
|
;returns the value in the CR0 register
|
|
;extern dword read_cr0();
|
|
_read_cr0:
|
|
mov eax, cr0;
|
|
ret
|
|
|
|
;stores the parameter to the CR3 register
|
|
;extern dword write_cr3(dword cr3);
|
|
_write_cr3:
|
|
push ebp
|
|
mov ebp, esp
|
|
mov eax, [ebp+8]
|
|
mov cr3, eax
|
|
pop ebp
|
|
ret
|
|
|
|
;returns the value in the CR3 register
|
|
;extern dword read_cr3();
|
|
_read_cr3:
|
|
mov eax, cr3;
|
|
ret
|
|
|
|
|
|
|
|
|
|
|