标题:CFREE4中没有BIOS.H,无法开串口,该怎么做??
只看楼主
dianziwg
Rank: 1
等 级:新手上路
帖 子:25
专家分:0
注 册:2004-11-17
 问题点数:0 回复次数:0 
CFREE4中没有BIOS.H,无法开串口,该怎么做??
#include <bios.h>
#include <conio.h>
#define COM1       0
#define DATA_READY 0x100
#define TRUE       1
#define FALSE      0
#define SETTINGS ( 0x80 | 0x02 | 0x00 | 0x00)
int main(void)
{
    int in, out, status, DONE = FALSE;
    bioscom(0, SETTINGS, COM1);
    cprintf("... BIOSCOM [ESC] to exit ...
");
    while (!DONE)
    {
        status = bioscom(3, 0, COM1);
        if (status & DATA_READY)
        if ((out = bioscom(2, 0, COM1) & 0x7F) != 0)
        putch(out);
        if (kbhit())
        {
            if ((in = getch()) == '')
           DONE = TRUE;
        bioscom(1, in, COM1);
        }
    }
    return 0;
}
搜索更多相关主题的帖子: 串口 BIOS 
2008-10-25 10:47



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-240454-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.315777 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved