home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Phoenix CD 2.0
/
Phoenix_CD.cdr
/
01e
/
more_ddj.zip
/
B_GETC.C
next >
Wrap
Text File
|
1986-09-27
|
1KB
|
35 lines
/* Listing 2 -- b_getc.c */
/*---------------------------------------------------------------------*/
#include <stdio.h>
#include <dos.h>
/* B_GETC.C Get a character with a direct video bios call.
* this routine can be used to complement stderr as
* it can be used to get characters from the keyboard, even when input
* redirected. The typed character is returned in the low byte of the
* returned integer, the high byte holds the auxillary byte used to
* mark ALT keys and such. See the Technical Ref for more info.
*
* Copyright (C) 1985 Allen I. Holub. All rights reserved.
*
*----------------------------------------------------------------------
*/
extern int int86(int, union REGS *, union REGS *);
/*----------------------------------------------------------------------*/
#define KB_INT 0x16 /* Keyboard BIOS interrupt */
#define GETC 0x00 /* Getc is service 0 */
int b_getc()
{
union REGS Regs;
Regs.h.ah = GETC ;
int86( KB_INT, &Regs, &Regs );
return( (int)Regs.x.ax );
}