First import
[xorg_rtime.git] / xorg-server-1.4 / hw / xfree86 / os-support / shared / inout.S
blob80c47c4192ffd4cf7aa1f1b82aba0df49f82885c
1 /* $XConsortium: inout.s /main/6 1996/02/21 17:53:35 kaleb $ */
7 /* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/inout.S,v 1.1 1999/07/10 07:24:52 dawes Exp $ */
9 #include "assyntax.h"
12  *      Make i80386 io primitives available at C-level.
13  */
15         FILE("inout.s")
16         AS_BEGIN
17         SEG_TEXT
20  *-----------------------------------------------------------------------
21  * inb ---
22  *      Input one byte.
23  *
24  * Results:
25  *      Byte in al.
26  *-----------------------------------------------------------------------
27  */
28         GLOBL   GLNAME(inb)
29 GLNAME(inb):
30         MOV_L   (REGOFF(4,ESP),EDX)
31         SUB_L   (EAX,EAX)
32         IN_B
33         RET
36  *-----------------------------------------------------------------------
37  * outb ---
38  *      Output one byte.
39  *
40  * Results:
41  *      None.
42  *-----------------------------------------------------------------------
43  */
44         GLOBL   GLNAME(outb)
45 GLNAME(outb):
46         MOV_L   (REGOFF(4,sp),EDX)
47         MOV_L   (REGOFF(8,sp),EAX)
48         OUT_B
49         RET
51  *-----------------------------------------------------------------------
52  * inw ---
53  *      Input one 16-bit word.
54  *
55  * Results:
56  *      Word in ax.
57  *-----------------------------------------------------------------------
58  */
59         GLOBL   GLNAME(inw)
60 GLNAME(inw):
61         MOV_L   (REGOFF(4,ESP),EDX)
62         IN_W
63         RET
66  *-----------------------------------------------------------------------
67  * outw ---
68  *      Output one 16-bit word.
69  *
70  * Results:
71  *      None.
72  *-----------------------------------------------------------------------
73  */
74         GLOBL   GLNAME(outw)
75 GLNAME(outw):
76         MOV_L   (REGOFF(4,ESP),EDX)
77         MOV_L   (REGOFF(8,ESP),EAX)
78         OUT_W
79         RET
82  *-----------------------------------------------------------------------
83  * inl ---
84  *      Input one 32-bit longword.
85  *
86  * Results:
87  *      Word in eax.
88  *-----------------------------------------------------------------------
89  */
90         GLOBL   GLNAME(inl)
91 GLNAME(inl):
92         MOV_L   (REGOFF(4,ESP),EDX)
93         IN_L
94         RET
97  *-----------------------------------------------------------------------
98  * outl ---
99  *      Output one 32-bit longword.
101  * Results:
102  *      None.
103  *-----------------------------------------------------------------------
104  */
105         GLOBL   GLNAME(outl)
106 GLNAME(outl):
107         MOV_L   (REGOFF(4,ESP),EDX)
108         MOV_L   (REGOFF(8,ESP),EAX)
109         OUT_L
110         RET