home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
High Voltage Shareware
/
high1.zip
/
high1
/
DIR2
/
DIGIPROG.ZIP
/
FFTEST.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-06-03
|
1KB
|
73 lines
#include <dos.h>
#include <stdio.h>
main()
{
struct REGPACK sregs;
union REGS regs;
int y,x,numbytes,tdx,rdx,hex=0;
unsigned char buff[0x200];
printf("\nEnter Tx DX : ");
scanf("%d",&tdx);
printf("\nEnter Rx DX : ");
scanf("%d",&rdx);
for(x=0; x<0x100; x++)
{
regs.h.ah = 0x01; /* Write character */
regs.h.al = (unsigned char) x;
regs.x.dx = tdx;
int86(0x14,®s,®s);
}
printf("\nRx'ed hex data using fct 02h");
for(x=0; x<0x100; x++)
{
if( !(x%0x10) ) printf("\n");
regs.h.ah = 0x02; /* Read Character */
regs.x.dx = rdx;
int86(0x14,®s,®s);
if(regs.h.ah & 0x80) { printf("\n Timeout ... "); break;}
printf("%02X ",regs.h.al);
}
printf("\n\nPress any Key for read string"); getch();
for(x=0; x<0x100; x++)
{
regs.h.ah = 0x01; /* Write Character */
regs.h.al = (unsigned char) x;
regs.x.dx = tdx;
int86(0x14,®s,®s);
}
printf("\nRx'ed hex data using fct 0fh\n");
sregs.r_dx = rdx;
sregs.r_ax = 0x0f00; /* Read String */
sregs.r_cx = 0x100;
sregs.r_es = _DS;
sregs.r_bx = FP_OFF(buff);
intr(0x14,&sregs);
for(x=0; x<0x100; x++)
{
if( !(x%0x10) ) printf("\n");
printf("%02X ",buff[x]);
}
}