home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR2 / DIGIPROG.ZIP / FCT0F.C < prev    next >
C/C++ Source or Header  |  1993-03-29  |  961b  |  47 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,hex=0;
  11. unsigned char    buff[9000];
  12.  
  13.  
  14. union REGS regs;
  15. /*struct SREGS sregs;*/
  16.  
  17.     printf("\nEnter DX : ");
  18.     scanf("%d",&dx); while(kbhit()) getch();
  19.     printf("\nEnter # bytes : ");
  20.     scanf("%x",&numbytes); while(kbhit()) getch();
  21.     printf("\nA)SCII or H)ex : ");
  22.  
  23.     if(toupper(getch()) == 'H') hex++;
  24.  
  25.  
  26.     sregs.r_ax = 0x0f00;
  27.     sregs.r_dx = dx;
  28.     sregs.r_cx = numbytes;
  29.     sregs.r_es = FP_SEG(buff);
  30.     sregs.r_bx = FP_OFF(buff);
  31.  
  32.     printf("\nCall   - AH : %02X     CX : %04X   ES : BX  =  %04X:%04X ",
  33.                        (sregs.r_ax&0xff00)>>8,sregs.r_cx,
  34.                        sregs.r_es,sregs.r_bx);
  35.     intr(0x14,&sregs);
  36.     printf("\nReturn - AX : %04X   DH : %02X     ZF : %d ",sregs.r_ax,
  37.             (sregs.r_dx&0xff00)>>8,(sregs.r_flags&0x40)>>6);
  38.  
  39.     printf("\n");
  40.     for(x=0; x<sregs.r_ax; x++)
  41.     {
  42.         if(hex)
  43.             printf("%2X ",buff[x]);
  44.         else
  45.             printf("%c",buff[x]);
  46.     }
  47. }