1 ; asmfuncs.asm 2 ; Josh Holtrop 3 ; 10/23/03 4 5 [global _write_cr0] 6 [global _read_cr0] 7 [global _write_cr3] 8 [global _read_cr3] 9 10 ;extern dword write_cr0(dword cr0); 11 _write_cr0: 12 00000000 55 push ebp 13 00000001 89E5 mov ebp, esp 14 00000003 8B4508 mov eax, [ebp+8] 15 00000006 0F22C0 mov cr0, eax 16 00000009 5D pop ebp 17 0000000A C3 ret 18 19 ;extern dword read_cr0(); 20 _read_cr0: 21 0000000B 0F20C0 mov eax, cr0; 22 0000000E C3 ret 23 24 25 ;extern dword write_cr3(dword cr3); 26 _write_cr3: 27 0000000F 55 push ebp 28 00000010 89E5 mov ebp, esp 29 00000012 8B4508 mov eax, [ebp+8] 30 00000015 0F22D8 mov cr3, eax 31 00000018 5D pop ebp 32 00000019 C3 ret 33 34 ;extern dword read_cr3(); 35 _read_cr3: 36 0000001A 0F20D8 mov eax, cr3; 37 0000001D C3 ret 38 39 40 41 42