home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR2 / DIGIPROG.ZIP / FCT5.C < prev    next >
C/C++ Source or Header  |  1993-03-29  |  977b  |  50 lines

  1.  
  2. #include <dos.h>
  3. #include <stdio.h>
  4.  
  5. main()
  6. {
  7.  
  8. struct REGPACK  sregs;
  9.  
  10. int    y,x,numbytes,dx;
  11.  
  12. union REGS regs;
  13.  
  14.     regs.x.bx = 0;
  15.  
  16.     printf("\nEnter DX : ");
  17.     scanf("%d",&dx); while(kbhit()) getch();
  18.  
  19.     printf("\nR)ead      W)rite  : ");
  20.     if(toupper(getch())=='R')
  21.         regs.h.al = 0;
  22.     else
  23.     {
  24.         regs.h.al = 1;
  25.         printf("Select Settings : ");
  26.         printf("\nA) DTR : LOW   RTS : LOW ");
  27.         printf("\nB) DTR :  HI   RTS : LOW ");
  28.         printf("\nC) DTR : LOW   RTS :  HI ");
  29.         printf("\nD) DTR :  HI   RTS :  HI ");
  30.         switch(toupper(getch()))
  31.         {
  32.             case 'A' : regs.x.bx = 0x0; break;
  33.             case 'B' : regs.x.bx = 0x1; break;
  34.             case 'C' : regs.x.bx = 0x2; break;
  35.             case 'D' : regs.x.bx = 0x3; break;
  36.  
  37.         }
  38.  
  39.  
  40.     }
  41.  
  42.  
  43.     regs.h.ah = 0x05;
  44.     regs.x.dx = dx;
  45.     printf("\nCall   - AH : %02X  AL : %02X  BL: %02X",regs.h.ah,regs.h.al,regs.h.bl);
  46.     int86(0x14,®s,®s);
  47.     printf("\nReturn - AH : %02X  AL : %02X  BL: %02X",regs.h.ah,regs.h.al,regs.h.bl);
  48.  
  49.  
  50. }