中国DOS联盟论坛

中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --

联盟域名:www.cn-dos.net  论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!

游客:  注册 | 登录 | 命令行 | 会员 | 搜索 | 上传 | 帮助 »
作者:
标题: DOS扩展8253定时器中断求助? 上一主题 | 下一主题
zhb1284
新手上路





积分 14
发帖 6
注册 2007-4-24
状态 离线
『楼 主』:  DOS扩展8253定时器中断求助?

这段程序为什么中断会响应不了呢?哪位大侠能帮我解决一下,我的QQ:19684802,Email:zhanghuaben@yahoo.cn
#include "graphics.h"
#include "stdio.h"
#include "fcntl.h"
#include "stdlib.h"
#include "alloc.h"
#include "stdlib.h"
#include "dos.h"

#define LOW_BYTE(n) (n&0x00ff)
#define HI_BYTE(n)    ((n>>8)&0x00ff)÷

// 主轴使用的变量
union{
    unsigned int b;
    unsigned char d[2];
}MAxisCnt;

void SetXMotTimer(unsigned count)
{
        outportb(0x3e7, 0xb0);
       
        outportb(0x3e6, LOW_BYTE(count));
        outportb(0x3e6, HI_BYTE(count));
}

void interrupt XMotorInt(void)
{
        disable();
       
        SetXMotTimer(1000);
        ......//向IO口输出脉冲信号
        outportb(0x20, 0x20);
       
        enable();
}

void main(void)
{
        outportb(0x3eb, 3);
       
        outportb(0x21, 0);
       
        setvect(11, XMotorInt);
       
        SetXMotTimer(1000);
       
        getch();
  
  return;
}

2008-4-2 12:37
查看资料  发送邮件  发短消息 网志   编辑帖子  回复  引用回复
sun51
新手上路





积分 6
发帖 2
注册 2008-8-15
状态 离线
『第 2 楼』:  

我现在也遇到和楼主相似的问题啊,请问楼主最后怎么解决了?

2008-8-15 22:57
查看资料  发短消息 网志   编辑帖子  回复  引用回复

请注意:您目前尚未注册或登录,请您注册登录以使用论坛的各项功能,例如发表和回复帖子等。


可打印版本 | 推荐给朋友 | 订阅主题 | 收藏主题



论坛跳转: