#include <windows.h>
#include <stdio.h>
#include <conio.h>
#include "winio.h"#define REG_RX 0x3F8
#define REG_TX 0x3F8
#define REG_IER 0x3F9
#define REG_IIR 0x3FA
#define REG_LCR 0x3FB
#define REG_MCR 0x3FC
#define REG_LSR 0x3FD
#define REG_MSR 0x3FE
#define REG_FCR 0x3FFvoid f_InitialCom()
{
int inVal,outVal; _outp(REG_LCR,0x80);
inVal=_inp(REG_LCR);
printf("LCR:%Xh\n",inVal);
_outp(REG_TX,0x78);
_outp(REG_IER,0);
_outp(REG_LCR,0x03);
_outp(REG_IER,0);
_outp(REG_FCR,0x80);
}
void main()
{
    int inVal,outVal;
    bool bResult;
   // Call InitializeWinIo to initialize the WinIo library.    bResult = InitializeWinIo();    if (bResult)
    {
// Under Windows NT/2000/XP, after calling InitializeWinIo,
// you can call _inp/_outp instead of using GetPortVal/SetPortVal
// f_InitialCom();
_outp(REG_LCR,0x80);
inVal=_inp(REG_LCR);
printf("LCR:%Xh\n",inVal);
// When you're done using WinIo, call ShutdownWinIo
ShutdownWinIo();
    }
    else
    {
printf("Error during initialization of WinIo.\n");
exit(1);
    }
}输出总是0xFFh,好象数值都没写进去.
帮忙看看.