Can somebody explain me how to use the int 33 function 0Ch?
I need this because in SVGA mode the mouse isn't working without this function.. :(
Posted on 2006-12-25 04:19:24 by tojas
Posted on 2006-12-25 08:20:15 by SpooK
Ok man, I found this a lot of times, but can you write an example? Please :(
Posted on 2006-12-25 09:35:25 by tojas
Suppose you want to get notified by an event when the user presses the right mouse button on the screen. This of course requires the Mouse Driver to be initialized using function 0x0000 in Trap 0x33.

Now you have to set AX to 0x000C (Define Interrupt Subroutine Parameters) and the CX register to 0x0008 (Call If Right Button Pressed, Bit #3). The Extra Segment (ES) should point to the segment address of your procedure and the Data Register (DX) to its offset. You can use the SEG and the OFFSET keywords for that purpose. Now remember that your trap subroutine should return to the calling procedure using an RETF instruction.

Once you set all these values up, you should issue the trap 0x33 with AX equal to 0x000C of course. Your routine will receive different values pertaining to different states of the mouse in various CPU registers. Let me know if you need further explanation and I will write you an example maybe.
Posted on 2006-12-25 21:54:49 by XCHG
Think of that function as interrupts themselves. The idea is much like the current Win32 message handling system, recursion... a message within a message within a message. Nothing new in terms of extending functionality, it seems a little more messy... but it is easier to deal with in finite terms, because all you have to do is create the routines for parsing such values and pass them to the function that deals with said value.

In the end, your computer always has to process things one event at a time. Everything happens so fast that it is easy for people to become confused as to the basics of computer operation. Slow the process down in your head and imagine what *you* would have to do in order to accomplish everything in succession, then apply it to the computer ;)
Posted on 2006-12-25 22:40:26 by SpooK
Ok, thanks guys :)
I read that I have to write a handler for the mouse with 0xC function in interrupt 0x33. Do I have right? :)
But the problem is that the function 0xC needs the ES:DX for the address of the event handler code... I don't even know how to write this handler :(
Can you write a very little example. Maybe you can show me how to unhide the cursor and then I think I can write others for myself. Thanks
Posted on 2006-12-26 07:39:03 by tojas
Here's some ancient stuff I did back in '91.  Actually now that I look at them, I'm not taking credit, I don't remember where they came from.
Attachments:
Posted on 2006-12-26 08:50:58 by JimG
I checked the sources. It is okay but I couldn't use for my svga mode :(( I know I am very newbie... But please can you write in nasm a code that shows me the svga mode with mouse, a very little code :( Please, this can be a very big help for me.. I know this is a big asking but please can you do for me?
Posted on 2006-12-26 17:18:16 by tojas

I checked the sources. It is okay but I couldn't use for my svga mode :(( I know I am very newbie... But please can you write in nasm a code that shows me the svga mode with mouse, a very little code :( Please, this can be a very big help for me.. I know this is a big asking but please can you do for me?


If you couldn't take the knowledge from the examples that JimG provided above, and apply them to your situation... then you simply are not trying hard enough to learn the basics of programming in ASM. Interrupts are not exactly a beginning point, you need to take it back further and read some more. I suggest reading AoA 16-bit (again, if you already have) and starting with more simple programs.

The reason I say this is because I know for a fact that you will not learn if someone spoon-feeds you some source code at this point... you will merely emulate that limited amount of information and you will be back at square-one asking for more code because you don't understand. The basic fact that you said "Maybe you can show me how to unhide the cursor and then I think I can write others for myself" proves my point.

Slow it down and do things right. Take the generous examples from here, like JimG's, and learn how to utilize Google along with this forum's search function. You'll feel/do much better in the long-run, believe me ;)
Posted on 2006-12-26 21:21:48 by SpooK
Ok man :) Then I'll take a brake from now, then I'll see  what I can do :)) Thanks your help. :)
Posted on 2006-12-27 02:06:20 by tojas