function initmouse:boolean;
var r:registers;
begin
 fillchar(r,sizeof(r),0);
 r.ax:=0;
 intr($33,r);
 initmouse:=r.ax<>0;
end;

procedure showmouse; assembler;
asm
 mov ax,1
 int $33
end;

procedure hidemouse; assembler;
asm
 mov ax,2
 int $33
end;

function lclick:boolean;
var r:registers;
begin
 fillchar(r,sizeof(r),0);
 r.ax:=5;
 r.bx:=0;
 intr($33,r);
 if (r.bx and 1)=1 then lclick:=true else lclick:=false
end;

function rclick:boolean;
var r:registers;
begin
 fillchar(r,sizeof(r),0);
 r.ax:=5;
 r.bx:=1;
 intr($33,r);
 if (r.bx and 1)=1 then rclick:=true else rclick:=false
end;

function lrelease:boolean;
var r:registers;
begin
 fillchar(r,sizeof(r),0);
 r.ax:=6;
 r.bx:=0;
 intr($33,r);
 if r.bx<>0 then lrelease:=true else lrelease:=false;
end;

function rrelease:boolean;
var r:registers;
begin
 fillchar(r,sizeof(r),0);
 r.ax:=6;
 r.bx:=1;
 intr($33,r);
 if r.bx<>0 then rrelease:=true else rrelease:=false;
end;

procedure mousemove(var movhor,movver:integer);
var r:registers;
begin
 fillchar(r,sizeof(r),0);
 r.ax:=$0b;
 intr($33,r);
 movhor:=r.cx;
 movver:=r.dx;
end;