home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
High Voltage Shareware
/
high1.zip
/
high1
/
DIR2
/
DIGIPROG.ZIP
/
FCT0F.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-03-29
|
961b
|
47 lines
#include <dos.h>
#include <stdio.h>
main()
{
struct REGPACK sregs;
int y,x,numbytes,dx,hex=0;
unsigned char buff[9000];
union REGS regs;
/*struct SREGS sregs;*/
printf("\nEnter DX : ");
scanf("%d",&dx); while(kbhit()) getch();
printf("\nEnter # bytes : ");
scanf("%x",&numbytes); while(kbhit()) getch();
printf("\nA)SCII or H)ex : ");
if(toupper(getch()) == 'H') hex++;
sregs.r_ax = 0x0f00;
sregs.r_dx = dx;
sregs.r_cx = numbytes;
sregs.r_es = FP_SEG(buff);
sregs.r_bx = FP_OFF(buff);
printf("\nCall - AH : %02X CX : %04X ES : BX = %04X:%04X ",
(sregs.r_ax&0xff00)>>8,sregs.r_cx,
sregs.r_es,sregs.r_bx);
intr(0x14,&sregs);
printf("\nReturn - AX : %04X DH : %02X ZF : %d ",sregs.r_ax,
(sregs.r_dx&0xff00)>>8,(sregs.r_flags&0x40)>>6);
printf("\n");
for(x=0; x<sregs.r_ax; x++)
{
if(hex)
printf("%2X ",buff[x]);
else
printf("%c",buff[x]);
}
}