C Program to check if mouse support is available or not.
Program :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | #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 (o.x.ax); } |
Output :
1 | Mouse support available. |
- Int86() is a C function that allows to call interrupts in the C program
- Header File : dos.h
1 2 | Usage is int86 (int intr num, union REGS *inregs, union REGS *outregs) |
- In and out register must be type of REGS.
- REGS is a built in UNION declaration in C.
- It is defined in the header file <dos.h>