我就是但用初始化那部分程序去执行,也不行。一下是那部分:
第一个:.
/* PlC-PC serial communication progam */
#include
#define com1 0
/*initialize the com*/
main()
{
int j;
clrscr();
j=bioscom(0,0xfe,com1);
printf("the statu of the port after being initialized is %x\n",j);
printf("%x",j);
getch();
}
另外一个:
/*initialize the seril port*/
#include "dos.h"
void portinit(int port,unsigned char code)
{
union REGS r;
r.x.dx=port;
r.h.ah=0;
r.h.al=code;
int86(0x14,&r,&r);
printf("\nthe statu of port after being initialized is %x\n",r.h.ah);
}
/*test the port if it can be opened with the portinit only*/
void portinit(int port,unsigned char code);
main()
{
union REGS r ;
int port=0;
unsigned char code=0xfe;
portinit(port,code);
getch();
}
03-05-08 01:19