#include "dos.h";

unsigned char charin(portno, ch)
int portno;                     /* 1 for com2, 0 for com1       */
unsigned char *ch;
{
union REGS inr, outr;
unsigned char status;

     inr.x.dx = portno;
     inr.h.ah = 2;              /* Function number              */
     int86(0x14, &inr, &outr);
     *ch = outr.h.al;
     status = outr.h.ah;
     return(status);
}


/* Figure 16.3: Character Input using ROM-BIOS */
