```c
void crtoff()/*Turn off the display*/
{
int crtflag;/*Flag indicating whether the display supports power-saving mode*/
union REGS inregs,outregs;
inregs.x.ax=0x4f10;
inregs.x.bx=0;
int86(0x10,&inregs,&outregs);
if(outregs.h.al==0x4f)/*If the display supports power-saving mode, turn it off*/
{
inregs.x.ax=0x4f10;
inregs.x.bx=0x0201;
int86(0x10,&inregs,&outregs);
inregs.x.ax=0x4f10;
inregs.x.bx=0x0301;
int86(0x10,&inregs,&outregs);
crtflag=1;
}
else /*Otherwise, disable display refresh*/
{
inregs.x.ax=0x1201;
inregs.h.bl=0x36;
int86(0x10,&inregs,&outregs);
crtflag=0;
}
while(bioskey(1)==0&&Minf==0) /*Wait for keyboard or mouse information to turn on the display*/
GetMouseState(&Minf);
if(crtflag)/*If the display supports power-saving mode, turn it on*/
{
inregs.x.ax=0x4f10;
inregs.x.bx=0x1;
int86(0x10,&inregs,&outregs);
}
else/*Otherwise, allow display refresh*/
{
inregs.x.ax=0x1200;
inregs.h.bl=0x36;
int86(0x10,&inregs,&outregs);
}
}
```