home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_07_07 / v7n7055a.txt < prev    next >
Text File  |  1989-09-05  |  611b  |  26 lines

  1.  
  2. Listing 2:
  3.    
  4.    #include <stdio.h>
  5.    #define IOBYTE_ADDRESS 0X03
  6.    #define IOBYTE_SET_FOR_PARALLEL 0X00
  7.    #define IOBYTE_SET_FOR_SERIAL 0X80
  8.  
  9.    main()
  10.    /* Toggles the IOBYTE */ 
  11.        {
  12.        unsigned char *pc = (char *) IOBYTE_ADDRESS;
  13.        if (*pc !== IOBYTE_SET_FOR_PARALLEL)
  14.            {
  15.            printf("\n Changing from Serial to Parallel \n");
  16.            *pc = IOBYTE_SET_FOR_PARALLEL;
  17.            }
  18.        else
  19.            {
  20.            printf("\n Changing from Parallel to Serial \n");
  21.            *pc = IOBYTE_SET_FOR_SERIAL;
  22.            }
  23.        exit(0);
  24.        }
  25.  
  26.