请问:有关int86()函数具体调用问题(200分)

  • 主题发起人 主题发起人 lmax
  • 开始时间 开始时间
L

lmax

Unregistered / Unconfirmed
GUEST, unregistred user!
[:(]先拿个例子来看:
int MouseReset(void)
{
union REGS in,out;
in.x.ax=0;
int86(0x33,&in,&out);
if (out.x.ax==0) return 0;
return 1;
}
上面的例子是有关鼠标中断调用的函数
0x33 是鼠标中断的中断号
in 调用鼠标中断的入口参数
out 调用鼠标中断的出口参数(保存中断过程的返回值)
好了,双面函数分析的差不多了,俺要提出问题了:
1、计算机中队应的软硬中断有很多,我在使用不同的中断时,它的入口参数值不可能是同一个值,
例如:in.x.ax=0 ,那么,我在调用不同的中断时(如显示中断),入口参数到底应赋给什么值,
另外,我知道入口参数应赋给寄存器,可是我到底付给哪一个寄存器呢,我百思不得其解,逼得我
看了一便汇编,基本了解各个寄存器的功能,可是我还是不知入口参数到底赋何值,到底赋给哪个
寄存器,后来我考虑可能针对每个中断都有一张表,其中说明了这个中断的具体调用方法(使用哪个
寄存器,值应该是多少等等),那么,是不是这样呢,请高手给予帮助,不胜感激!!!
2、还有,就是返回值。调用一个中断,都会有返回值,根据返回值就可了解中断调用是否正常,那么,
返回值到底赋给那个寄存器呢??????
大哥,帮帮忙吧,我真的不知该怎么做了,急切盼望您的回信 :)
 
DOS下每个中断都有约定的出、入口参数,比如哪个寄存器输入什么,哪个寄存器输入什么。
至于涉及鼠标的中断,就需要你具体看DOS的中断列表了。网上这方面的资料也挺多的,
列表会有详细说明:在哪个寄存器输入、哪个寄存器输出
搜一下应该会有不少的。。
应该充分利用网络
 
下面有DOS中断大全
http://wlbookwl.myrice.com/asm.htm
通常来说, 调用是否成功利用标志寄存器的CF位,也有在AH来返回的,具体可以看
上面的资料
 
其实你只要找一下中断列表,啥都明白了,这个资料网上多的是。
下面是我给你找的
INT 33 - Mouse Function Calls
For more information see the following topics:
INT 33,0 Mouse Reset/Get Mouse Installed Flag
INT 33,1 Show Mouse Cursor
INT 33,2 Hide Mouse Cursor
INT 33,3 Get Mouse Position and Button Status
INT 33,4 Set Mouse Cursor Position
INT 33,5 Get Mouse Button Press Information
INT 33,6 Get Mouse Button Release Information
INT 33,7 Set Mouse Horizontal Min/Max Position
INT 33,8 Set Mouse Vertical Min/Max Position
INT 33,9 Set Mouse Graphics Cursor
INT 33,A Set Mouse Text Cursor
INT 33,B Read Mouse Motion Counters
INT 33,C Set Mouse User Defined Subroutine and Input Mask
INT 33,D Mouse Light Pen Emulation On
INT 33,E Mouse Light Pen Emulation Off
INT 33,F Set Mouse Mickey Pixel Ratio
INT 33,10 Mouse Conditional OFF
INT 33,13 Set Mousedo
uble Speed Threshold
INT 33,14 Swap interrupt subroutines
INT 33,15 Get mouse driver state and memory requirements
INT 33,16 Save mouse driver state
INT 33,17 Restore mouse driver state
INT 33,18 Set alternate subroutine call mask and address
INT 33,19 Get user alternate interrupt address
INT 33,1A Set mouse sensitivity
INT 33,1B Get mouse sensitivity
INT 33,1C Set mouse interrupt rate (InPort only)
INT 33,1D Set mouse CRT page
INT 33,1E Get mouse CRT page
INT 33,1F Disable mouse driver
INT 33,20 Enable mouse driver
INT 33,21 Reset mouse software
INT 33,22 Set language for messages
INT 33,23 Get language number
INT 33,24 Get driver version, mouse type &
IRQ number
- function is specified in AX
- a mickey is 1/200 inches
- for additional information see your vendordo
cumentation
- function number occupies all of AX rather than AH

Mouse functions can be brokendo
wn into the following classes:
Mouse Driver Control / Feedback Functions
INT 33,0 Mouse Reset/Get Mouse Installed Flag
INT 33,15 Get Mouse Driver State and Memory Requirements
INT 33,16 Save Mouse Driver State
INT 33,17 Restore Mouse Driver State
INT 33,1C Set Mouse Interrupt Rate (InPort only)
INT 33,1F Disable Mouse Driver
INT 33,20 Enable Mouse Driver
INT 33,21 Reset Mouse Software
INT 33,24 Get Driver Version, Mouse Type &
IRQ Number
Mouse Cursor Control Functions
INT 33,1 Show Mouse Cursor
INT 33,2 Hide Mouse Cursor
INT 33,4 Set Mouse Cursor Position
INT 33,7 Set Mouse Horizontal Min/Max Position
INT 33,8 Set Mouse Vertical Min/Max Position
INT 33,9 Set Mouse Graphics Cursor
INT 33,A Set Mouse Text Cursor
INT 33,F Set Mouse Mickey Pixel Ratio
INT 33,10 Mouse Conditional OFF
INT 33,13 Set Mousedo
uble Speed Threshold
INT 33,1A Set Mouse Sensitivity
INT 33,1B Get Mouse Sensitivity
Mouse Button and Position Feedback Functions
INT 33,3 Get Mouse Position and Button Status
INT 33,5 Get Mouse Button Press Information
INT 33,6 Get Mouse Button Release Information
INT 33,B Read Mouse Motion Counters
Video Control and Feedback Functions
INT 33,1D Set Mouse CRT Page
INT 33,1E Get Mouse CRT Page
Mouse Interrupt Setup Functions
INT 33,C Set Mouse User Defined Subroutine and Input Mask
INT 33,14 Swap Interrupt Subroutines
Alternate Mouse Interrupt Setup Functions
INT 33,18 Set Alternate Subroutine Call Mask and Address
INT 33,19 Get User Alternate Interrupt Address
Light Pen Emulation Functions
INT 33,D Mouse Light Pen Emulation On
INT 33,E Mouse Light Pen Emulation Off
International Language Support Functions
INT 33,22 Set Language for Messages
INT 33,23 Get Language Number

下面是我给你的调用例子,其它的由于太多,你自己找找吧。
INT 33,0 - Mouse Reset/Get Mouse Installed Flag
AX = 00

on return:
AX = 0000 mouse driver not installed
FFFF mouse driver installed
BX = number of buttons

- resets mouse to default driver values:
. mouse is positioned to screen center
. mouse cursor is reset and hidden
. no interrupts are enabled (mask = 0)
. do
uble speed threshold set to 64 mickeys per second
. horizontal mickey to pixel ratio (8 to 8)
. vertical mickey to pixel ratio (16 to 8)
. max width and height are set to maximum for video mode
INT 33,1 - Show Mouse Cursor

AX = 01

returns nothing

- increments the cursor flag;
the cursor is displayed if flag
is zero;
default flag value is -1

其它的调用与此类似,希望上面这些对你有用。
 
后退
顶部