Turbo C BIOSCOM EXAMPLE








  PRODUCT  :  TURBO C                                NUMBER  :  404
  VERSION  :  1.0/1.5
       OS  :  MS-DOS
     DATE  :  January 12, 1988                         PAGE  :  1/2

    TITLE  :  BIOSCOM EXAMPLE




  The following program demonstrates the use of the Turbo C run
  time library function bioscom:


                                /* BIOSCOM.C */

  #include <bios.h>
  #include <conio.h>

  #define COM1        0
  #define COM2        1

  #define SET         0
  #define SEND        1
  #define RECEIVE     2
  #define STATUS      3

  #define ESC         '\x1B'

  #define BAUD_300    0x40
  #define BAUD_1200   0x80

  #define PARITY_NONE 0x00
  #define PARITY_ODD  0x08
  #define PARITY_EVEN 0x18

  #define BITS_7      0x02
  #define BITS_8      0x03
  #define STOP_1      0x00
  #define STOP_2      0X04

  main()
  {
      int register out, in;


      bioscom(SET, BAUD_1200 | BITS_7 | STOP_1 | PARITY_NONE,
              COM1);

      cprintf("... BIOSCOM [ESC] to exit ...\n");
















  PRODUCT  :  TURBO C                                NUMBER  :  404
  VERSION  :  1.0/1.5
       OS  :  MS-DOS
     DATE  :  January 12, 1988                         PAGE  :  2/2

    TITLE  :  BIOSCOM EXAMPLE




      while (1)
      {
       if (kbhit())
       {
           if ((in = getch())== ESC) exit(0);
           bioscom(SEND, in, COM1);
       }
       if ( (out = bioscom(RECEIVE, 0, COM1) & 0x7F) != 0)
           putch(out);
      }
  }

  DISCLAIMER: You have the right to use this technical information
  subject to the terms of the No-Nonsense License Statement that
  you received with the Borland product to which this information
  pertains.

































Comments

Popular posts from this blog

BOTTOM LIVE script

Evidence supporting quantum information processing in animals

ARMIES OF CHAOS