[comp.os.msdos.programmer] Using mice with C w/o machine language

gene@uokmax.uucp (Gene E. Johannsen) (08/24/90)

	As we all know, in order to have the computer do something when a
mouse button is pressed, a vector has to be set up by using an interrupt.  This 
vector has to be in the es:dx registers when this interrupt is called.  How in a
C program can I make these registers point to a C routine?

gene@uokmax.ecn.uoknor.edu

joe@proto.COM (Joe Huffman) (08/24/90)

In article <1990Aug23.215002.8771@uokmax.uucp>, gene@uokmax.uucp (Gene E. 
 Johannsen) writes:
> This vector has to be in the es:dx registers when this interrupt is called.  
> How in a C program can I make these registers point to a C routine?

You can't do it without a helper function.  Zortech has the msm_XXXX family
of functions.  One of which will install your interrupt.  You could also
do it with the int86x() function.  Be careful though.  In this case it 
can't be a standard C function.  The return must be an IRET, not a RET.
the msm_ function puts a 'wrapper' around your 'C' function with an IRET
in the proper place...

Some other compilers have a special interrupt declared function type.


-- 
joe@proto.com
uunet!proto!joe
FAX: 208-263-8772