removed clang-format and clang_complete files from the repo
[dosdemo] / src / util_s.asm
1         section .text
2         bits 32
3 ; foo_ are watcom functions, _foo are djgpp functions
4
5         global get_cs
6         global _get_cs
7         global get_cs_
8 get_cs:
9 _get_cs:
10 get_cs_:
11         xor eax, eax
12         mov ax, cs
13         ret
14
15         global get_msr
16         global _get_msr
17 get_msr:
18 _get_msr:
19         push ebp
20         mov ebp, esp
21         push ebx
22         mov ecx, [ebp + 8]
23         rdmsr
24         mov ebx, [ebp + 12]
25         mov [ebx], eax
26         mov ebx, [ebp + 16]
27         mov [ebx], edx
28         pop ebx
29         pop ebp
30         ret
31
32         global get_msr_
33 get_msr_:
34         push ebx
35         push edx
36         mov ecx, eax
37         rdmsr
38         pop ebx
39         mov [ebx], eax
40         pop ebx
41         mov [ebx], edx
42         ret
43
44         global set_msr
45         global _set_msr
46 set_msr:
47 _set_msr:
48         mov ecx, [esp + 4]
49         mov eax, [esp + 8]
50         mov edx, [esp + 12]
51         rdmsr
52         ret
53
54         global set_msr_
55 set_msr_:
56         mov ecx, eax
57         mov eax, edx
58         mov edx, ebx
59         wrmsr
60         ret
61
62
63 ; vi:ft=nasm: