C Program to Check if Mouse Support is available or not.
⦁ Int86( ) is a C function that allows to call interrupts in the program.
⦁ Prototype in dos.h usage is int86 (int intr num, union REGS *inregs, union REGS *outregs)
⦁ in and out register must be type of REGS.
⦁ REGS is built in UNION declaration in C.
⦁ It is defined in the header file <dos.h>
--------------------------------------------------------------------------------------------------------------------------
#include<stdio.h>
#include<dos.h>
int initmouse( );
union REGS i,o;
int main( )
{
int flag;
flag = initmouse( );
if (flag == 0)
{
printf("Mouse support not available.");
}
else
{
printf("Mouse support available");
}
return 0;
}
int initmouse( )
{
i.x.ax = 0;
int86(0X33, &i, &o);
return (0.x.ax);
}
--------------------------------------------------------------------------------------------------------------------------
Output
--------------------------------------------------------------------------------------------------------------------------
Mouse Support available.
EmoticonEmoticon