summaryrefslogtreecommitdiff
path: root/libc/msdos
diff options
context:
space:
mode:
Diffstat (limited to 'libc/msdos')
-rw-r--r--libc/msdos/conio.c66
1 files changed, 58 insertions, 8 deletions
diff --git a/libc/msdos/conio.c b/libc/msdos/conio.c
index 3c51c92..1abfa40 100644
--- a/libc/msdos/conio.c
+++ b/libc/msdos/conio.c
@@ -1,23 +1,73 @@
/* Is this BIOS keyboard io ? */
-cgets()
-
-cputs()
-
getch()
+{
+#asm
+ xor ax,ax
+ int $16
+#endasm
+}
getche()
+{
+ int i = getch();
+ if( i & 0xFF) putch(i);
+ return i;
+}
+
+kbhit()
+{
+#asm
+ mov ah,#1
+ int $16
+ jz nokey
+ cmp ax,#0
+ jnz dort
+ mov ax,#3
+dort:
+ ret
+nokey:
+ xor ax,ax
+#endasm
+}
+
+putch()
+{
+#asm
+#if !__FIRST_ARG_IN_AX__
+ mov bx,sp
+ mov ax,[bx+2]
+#endif
+ mov ah,#$0E
+ mov bx,#7
+ int $10
+#endasm
+}
+
+cputs(str)
+char * str;
+{
+ while(*str) putch(*str++);
+}
+
+cgets()
+{
+}
cprintf()
+{
+}
cscanf()
+{
+}
getpass()
+{
+}
gotoxy()
-
-kbhit()
-
-putch()
+{
+}