中国DOS联盟

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

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

中国DOS联盟论坛
现在时间是 2026-08-01 05:48
中国DOS联盟论坛 » DOS开发编程 & 发展交流 (开发室) » DOS扩展8253定时器中断求助? 查看 1,639 回复 1
楼 主 DOS扩展8253定时器中断求助? 发表于 2008-04-02 12:37 ·  中国 浙江 台州 椒江区 电信
新手上路
积分 14
发帖 6
注册 2007-04-24 11:53
19年会员
UID 86302
性别 男
状态 离线
这段程序为什么中断会响应不了呢?哪位大侠能帮我解决一下,我的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;
}
2 发表于 2008-08-15 22:57 ·  中国 上海 联通
新手上路
积分 6
发帖 2
注册 2008-08-15 20:24
17年会员
UID 123294
性别 男
状态 离线
我现在也遇到和楼主相似的问题啊,请问楼主最后怎么解决了?
论坛跳转: