program CursorControl;
uses Crt;

{ Procedure to turn the cursor OFF }
procedure CursorOff;
var
  Regs: Registers;
begin
  Regs.AH := $01;       { Set cursor shape function }
  Regs.CH := $20;       { Start scan line > end scan line => invisible }
  Regs.CL := $00;       { End scan line }
  Intr($10, Regs);      { Call BIOS video interrupt }
end;

{ Procedure to turn the cursor ON (normal shape) }
procedure CursorOn;
var
  Regs: Registers;
begin
  Regs.AH := $01;       { Set cursor shape function }
  Regs.CH := $06;       { Start scan line (normal for text mode) }
  Regs.CL := $07;       { End scan line }
  Intr($10, Regs);      { Call BIOS video interrupt }
end;

begin
  ClrScr;
  WriteLn('Cursor will be hidden for 3 seconds...');
  CursorOff;
  Delay(3000);

  WriteLn('Cursor will now be visible again.');
  CursorOn;
  Delay(3000);
end.
