在TC下如何挂接MOUCE???

dycdyc123 2000-12-09 10:50:00
在TC下如何挂接MOUCE???
请给出程序??
...全文
222 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
风中老长 2000-12-16
  • 打赏
  • 举报
回复
int 33h
00H 复位鼠标
入口 AL=00H
出口 BX=鼠标按键个数

01H 显示鼠标
入口 AL=01H
出口 显示鼠标

02H 隐藏鼠标
入口 AL=02H
出口 隐藏鼠标

03H 读鼠标状态
入口 AL=03H
出口 BX=按键状态
CX=光标位置横坐标
DX=光标位置纵坐标

04H 设置鼠标光标位置
入口 AL=04H
CX=横坐标
DX=纵坐标

05H 取按键信息
入口 AL=05H
BX=期望的按键(0左,1右)
出口 AX=按键状态
BX=按键次数
CX=最后一次按键的横坐标
DX=最后一次按键的纵坐标
武稀松 2000-12-12
  • 打赏
  • 举报
回复
先把MOUSE。COM驻留,调用INT33H
循环调用看看是否点击了。具体寄存器的值cxiaobao说的对。
cxiaobao 2000-12-11
  • 打赏
  • 举报
回复
sorry!
at line 9:if(r.x.ax=0)=====>>if(r.x.ax==0)
cxiaobao 2000-12-11
  • 打赏
  • 举报
回复
#include<dos.h>
/*reset mouse,ax=0,return if ax=0 means there is not mouse installed
-1 means there is mouse installed,and save the number of buttons in bx*/
void mouse_init(void)
{
union REGS r;
r.x.ax=0;
int86(0x33,&r,&r);
if(r.x.ax=0)
{
printf("There is NOT mouse installed!");
exit(-1);
}
printf("Mouse with %d buttons installed!",r.x.bx);
}
/*show mouse,ax=1
Attention:if you call this function for times
you should call mouse_hide() for times to hide mouse*/
void mouse_show(void)
{
union REGS r;
r.x.ax=1;
int86(0x33,&r,&r);
}
/*hide mouse,ax=2
Attention:as mouse_show()*/
void mouse_hide(void)
{
union REGS r;
r.x.ax=2;
int86(0x33,&r,&r);
}
/*get mouse state,ax=3*/
void mouse_getstate(int *x,int *y,int *button)
{
union REGS r;
r.x.ax=3;
int86(0x33,&r,&r);
*button=r.x.bx;/*if left button was pressed r.x.bx=0;
if right button was pressed r.x.bx=1;
if middle button was pressed r.x.bx=2;
*/
*x=r.x.cx; /*mouse current X postion*/
*y=r.x.dx; /*mouse current Y postion*/
}
/*set mouse postion,ax=4*/
void mouse_setpostion(int x,int y)
{
union REGS r;
r.x.ax=4;
r.x.cx=x;/*X postion*/
r.x.dx=y;/*Y postion*/
int86(0x33,&r,&r);

}

you can write other function like this
and the detailed information about the int 0x33 at http://www.asmcity.com/prog/p_info/Intwin.zip
DaNiao 2000-12-10
  • 打赏
  • 举报
回复
得写很多汇编的东西,十年前我写过,现在全忘了
还是去找TC tools吧
dycdyc123 2000-12-10
  • 打赏
  • 举报
回复
Cxiaobao:
Would you give me your programe ?
Thiks!
Winsky 2000-12-09
  • 打赏
  • 举报
回复
1、你可以使用33h中断,自己编写mouse的函数
2、你可以去找个tc的程序包叫做Turbao c tools 2.0 好象是89年出的,里面有个功能强大mouse开发包,还有文本窗口、菜单包、中断服务包等,功能很强大。
cxiaobao 2000-12-09
  • 打赏
  • 举报
回复
用33号中断,在tc中使用int86()函数,要用到寄存器联合REGS(好象在dos.h)。具体去查书吧。如果要源程序,通知我。

69,369

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧