作者suhorng ( )
看板C_and_CPP
标题Re: [问题] DEV-CPP 下int86()
时间Tue Sep 8 21:52:43 2009
※ 引述《catspawboy (WII*wii)》之铭言:
请问在DEV-CPP这个IDE下
要怎麽使用到int86()或intx86()这两个函数?
还是说有其他方法代替???
那可以帮我解释以下程式码的意思嘛????
void show_mouse(void)
{
union REGS in, out;
in.x.ax = 0x1;
int86(0x33, &in, &out);
}
挺旧的 code 了,16 位元跑 DOS 时代的吧 ?
DOS int 蒐集
http://www.ctyme.com/intr/int-33.htm
如它所说
INT 33h 系列是实模式 DOS 环境下控制滑鼠的中断
其中以 AX = 0001h 的功能呼叫为显示滑鼠
至於 union REGS 请参照
http://www.delorie.com/djgpp/doc/libc/libc_486.html
int86() 顾名思义就是模拟一个软体中断,至於有些限制、它的作用等
在刚才给的网页有很清楚的说明:
Currently, it supports only a subset of all available interrupts and
functions:
1) All functions of any interrupt which expects only scalar arguments
registers (i.e., no pointers to buffers).
2) In addition, the following functions of interrupt 21h are supported: 9,
39h, 3Ah, 3Bh, 3Ch, 3Dh, 3Fh, 40h, 41h, 43h, 47h, 56h.
When the interrupt is invoked, the CPU registers are copied from in. After
the interrupt, the CPU registers are copied to out.
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 220.137.81.104
※ 编辑: suhorng 来自: 220.137.81.104 (09/08 21:57)
1F:推 catspawboy:谢谢解说~ 既然是显示滑鼠~ 09/08 22:38
2F:→ catspawboy:那线在的介面上应该是没用了吧@@? 09/08 22:39
3F:→ james732:要不要说说你打算要做什麽事? 09/08 22:42
4F:推 catspawboy:老师拿了本用TC写的实例 让我用DEV-CPP翻.... 09/08 22:43
5F:→ sunneo:那...就改用curses.h吧 09/08 23:04