Demonstrate use of mouse in C (assembly)
/* PROGRAMME TO DEMONSTRATE USE OF MOUSE IN C LANGUAGE */
/* FORMING OUR OWN CURSOR */
#include<stdio.h>
#include<graphics.h>
#include<dos.h>
union REGS inregs;
struct SREGS sinregs;
static int mask[]={
0xe1ff,
0xe1ff,
0xe1ff,
0xe1ff,
0xe1ff,
0xe000,
0xe000,
0xe000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x1e00,
0x1200,
0x1200,
0x1200,
0x13ff,
0x1249,
0x1249,
0xf249,
0x9001,
0x9001,
0x9001,
0x8001,
0x8001,
0x8001,
0xffff
};
main()
{
int gd=DETECT,gm;
initgraph(&gd,&gm,"");
cleardevice();
inregs.x.ax=0;
int86(0x33,&inregs,&inregs);
inregs.x.ax=1;
int86(0x33,&inregs,&inregs);
inregs.x.ax=9;
inregs.x.bx=5;
inregs.x.cx=0;
inregs.x.dx=(int)mask;
segread(&sinregs);
sinregs.es=sinregs.ds;
int86x(0x33,&inregs,&inregs,&sinregs);
getch();
closegraph();
}
No comments:
Post a Comment