program RandDot;

{  This program displays on the graphics screen random dots at a very high
{  high speed.  20,000 dots are displayed in a few seconds.
{
{  The program was written for Turbo Pascal by Jeff Firestone.
{
{  NOTE -- This program uses the external assembly language procedure
{  POINT.INV which must be on the default drive inorder to compile.}

      type
        varX = record
          varL,varH: Byte;
        end;
        TimeRec = record
          AX,BX: varX;
          Min,Hour,Msec,Sec: byte;
          BP,SI,DI,DS,ES,FLAGS: integer;
        end;
        RecPack = record
          AX: varX;
          BX,CX,DX,BP,SI,DI,DS,ES,FLAGS: Integer;
        end;

      var
        intparm : RecPack;
        i,j : integer;
        rx,ry : integer;

      procedure GraphicsOn;
      begin
        with IntParm do
          begin
            AX.varH := $00;
            AX.varL := $06;
            Intr($10,intparm);
          end;
      end;

      procedure GraphicsOff;
      begin
        with IntParm do
          begin
            AX.varH := $00;
            AX.varL := $02;
            Intr($10,intparm);
          end;
      end;

      procedure Dot(x,y: integer);
      begin
        with IntParm do
          begin
            AX.varH := 12;
            AX.varL := $81;
            CX := x;
            DX := y;
            Intr($10,intparm);
          end;
      end;

Procedure Point(x,y,color:integer); External 'point.inv';

begin
  GraphicsOn;
  for i:= 1 to 20000 do
    begin
      rx:= random(639);
      ry:= random(199);
      point(rx,ry,1);
    end;
  write('            '+chr(13));
  writeln(' Hit RETURN');
  readln;
  GraphicsOff;
end.N.BAT     - Delete OBJ,LST,SYM, and BIN 