-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathports.s
58 lines (43 loc) · 762 Bytes
/
ports.s
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.text
// Pobiera/zapisuje jeben bajt do portu - byte
.global outportb
.global inportb
// Pobiera/zapisuje dwa bajty do portu - word
.global outportw
.global inportw
// Pobiera/zapisuje cztery bajty do portu - double word
.global outportdw
.global inportdw
.type outportb, @function
outportb:
mov 4(%esp), %dx
mov 8(%esp), %al
out %al, %dx
ret
.type inportb, @function
inportb:
mov 4(%esp), %dx
in %dx, %al
ret
.type outportw, @function
outportw:
mov 4(%esp), %dx
mov 8(%esp), %ax
out %ax, %dx
ret
.type inportw, @function
inportw:
mov 4(%esp), %dx
in %dx, %ax
ret
.type outportdw, @function
outportdw:
mov 4(%esp), %dx
mov 8(%esp), %eax
out %eax, %dx
ret
.type inportdw, @function
inportdw:
mov 4(%esp), %dx
in %dx, %eax
ret