home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
High Voltage Shareware
/
high1.zip
/
high1
/
DIR2
/
DIGIPROG.ZIP
/
FCT2.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-03-29
|
645b
|
40 lines
#include <dos.h>
#include <stdio.h>
main()
{
struct REGPACK sregs;
int y,x,numbytes,dx,hex=0;
union REGS regs;
/*struct SREGS sregs;*/
/* special char - <CR> */
printf("\nEnter DX : ");
scanf("%d",&dx); while(kbhit()) getch();
printf("A)SCII or H)ex : ");
if(toupper(getch()) == 'H') hex++;
printf("\nEnter # bytes : ");
scanf("%x",&numbytes); while(kbhit()) getch();
for(x=0; x<numbytes; x++)
{
regs.h.ah = 0x02;
regs.x.dx = dx;
int86(0x14,®s,®s);
if(hex)
printf("AH : %02X AL : %02X ",regs.h.ah,regs.h.al);
else
printf("AH : %02X AL : %c ",regs.h.ah,regs.h.al);
}
}