X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dosdemo;a=blobdiff_plain;f=src%2Futil_s.asm;fp=src%2Futil_s.asm;h=69c034a586068ca760ef471acf16ae19c5b6cb99;hp=0000000000000000000000000000000000000000;hb=574b83282bd01d6b9a70843238bbcbab1590fe76;hpb=fb3df30d97e3824335a6c17fd8d49b9706b6b3c7 diff --git a/src/util_s.asm b/src/util_s.asm new file mode 100644 index 0000000..69c034a --- /dev/null +++ b/src/util_s.asm @@ -0,0 +1,62 @@ + section .text +; foo_ are watcom functions, _foo are djgpp functions + + global get_cs + global _get_cs + global get_cs_ +get_cs: +_get_cs: +get_cs_: + xor eax, eax + mov ax, cs + ret + + global get_msr + global _get_msr +get_msr: +_get_msr: + push ebp + mov ebp, esp + push ebx + mov ecx, [ebp + 8] + rdmsr + mov ebx, [ebp + 12] + mov [ebx], eax + mov ebx, [ebp + 16] + mov [ebx], edx + pop ebx + pop ebp + ret + + global get_msr_ +get_msr_: + push ebx + push edx + mov ecx, eax + rdmsr + pop ebx + mov [ebx], eax + pop ebx + mov [ebx], edx + ret + + global set_msr + global _set_msr +set_msr: +_set_msr: + mov ecx, [esp + 4] + mov eax, [esp + 8] + mov edx, [esp + 12] + rdmsr + ret + + global set_msr_ +set_msr_: + mov ecx, eax + mov eax, edx + mov edx, ebx + wrmsr + ret + + +; vi:ft=nasm: