tinkering with DOS mouse pointer

am trying to tinker around with the ugly block of a mouse pointer we get in the TEXT MODE in DOS. So, i thought of changing it by replacing the ascii value 219 (the value that dos uses for its block cursor) by a new font say an hour glass. i wrote the code as follows:

#include

union REGS i,o;
initmouse()
{
i.x.ax=0;
int86(0x33,&i,&o);
return(o.x.ax);
}

showmouseptr()
{
i.x.ax=1;
int86(0x33,&i,&o);
}


hidemouseptr()
{
i.x.ax=2;
int86(0x33,&i,&o);
}

void font()
{
unsigned seg,off;
unsigned char far(tbl[14])={

0x00,0xff,0x81,0x81,0x42,
0x24,0x18,0x18,0x24,0x42,
0x81,0x81,0xff,0x00,
};
seg=FP_SEG(tbl);
off=FP_OFF(tbl);

_AH=0X11;
_AL=0;
_BH=14;
_BL=0;
_CX=1;
_DX=219;

_ES=seg;
asm push bp;
asm mov bp,off;
geninterrupt(0x10);
}

void main()
{
font();
initmouse();
showmouseptr();
}

This changes the character at 219 location to the bitmap i provided. Except, it just crashes everytime i run it. Am i trying to write to protected area of DOS and if yes, is their a way out.

Your help will be greately appreciated.


Programming is a race between software engineers striving to build bigger and better idiot-proof programs,and the Universe trying to produce bigger and better idiots. So far,the Universe is winning.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories