home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / archives / uman1000.zip / umterm.c < prev   
C/C++ Source or Header  |  1986-04-10  |  671b  |  31 lines

  1. /* This is a very simple terminal program for the UMAN */
  2.  
  3. main()
  4. {
  5.     register long iobyte;
  6.     iobyte=bios(19) & ~3;        /* Get iobyte */
  7.     while (1)
  8.     {
  9.         iobyte |=1;
  10.         bios(20,iobyte);    /* Set console device to keyboard */
  11.         if (bios(2)) bios(6,(long)readcon());    /* Check for input */
  12.         iobyte &= ~3;         /* Set console device to serial */
  13.         bios(20,iobyte);
  14.         if (bios(2))        /* There is a character at serial */
  15.             {
  16.             iobyte |=1;
  17.             bios(20,iobyte);
  18.             bios(4,(long)(bios(7)& 0x7f));
  19.             }
  20.     }
  21. }
  22.  
  23. readcon()
  24. {
  25.     /* This reads the console */
  26.     register int c;
  27.     c=bios(3);    /* Read the keyboard */
  28.     if (c!=0x1d) return(c);     /* If not CTRL ] */
  29.     exit(0);
  30. }
  31.