一个小通讯程序,DX帮忙看一下!include <stdio.h>
#include <dos.h>
#include <dir.h>
#include <string.h>
#include <conio.h>
#include <alloc.h>
#include <time.h>
#include <ctype.h>
void main()
{ time_t t1,t2;
unsigned char st,st1,head;
outportb(0x2fb,0x80);
outportb(0x2f8,0x0c);
outportb(0x2f9,0x00);
outportb(0x2fb,0x03);
t1=time(NULL);
while(1)
{t2=time(NULL);
if(difftime(t2,t1)> =2.00)
{printf("over time in jieshou()");
exit(0);
}
st1=inportb(0x2fd);
if((st1&0x01)!=0)
{
head=inportb(0x2f8);
break;
}
printf("the receive byte is %s\n",head);
}
}