summaryrefslogtreecommitdiff
path: root/libc/bios/bios_min.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/bios/bios_min.c')
-rw-r--r--libc/bios/bios_min.c61
1 files changed, 61 insertions, 0 deletions
diff --git a/libc/bios/bios_min.c b/libc/bios/bios_min.c
new file mode 100644
index 0000000..ef86c4a
--- /dev/null
+++ b/libc/bios/bios_min.c
@@ -0,0 +1,61 @@
+/* Copyright (C) 1996 Robert de Bath <robert@mayday.compulink.co.uk>
+ * This file is part of the Linux-8086 C library and is distributed
+ * under the GNU Library General Public License.
+ */
+
+#ifdef __AS386_16__
+#ifdef __STANDALONE__
+
+#include <bios.h>
+
+#ifdef L_bios_putc
+bios_putc(c)
+{
+#asm
+#if !__FIRST_ARG_IN_AX__
+ mov bx,sp
+ mov ax,[bx+2]
+#endif
+ mov ah,#$0E
+ mov bx,#7
+ int $10
+#endasm
+}
+#endif
+
+/****************************************************************************/
+
+#ifdef L_bios_getc
+bios_getc()
+{
+#asm
+ xor ax,ax
+ int $16
+#endasm
+}
+#endif
+
+/****************************************************************************/
+
+#ifdef L_bios_khit
+bios_khit()
+{
+#asm
+ mov ah,#1
+ int $16
+ jz nokey
+ cmp ax,#0
+ jnz dort
+ mov ax,#3
+dort:
+ ret
+nokey:
+ xor ax,ax
+#endasm
+}
+#endif
+
+/****************************************************************************/
+
+#endif
+#endif