{$M 1024,0,0}
Uses Crt,Dos;
Const
      VideoPtr : Pointer = Ptr($B800,0);
Type
      VideoArray  = Array [ 1 .. 4000 ] of byte;
      PVideoArray = ^VideoArray;

Var
            F : File;
            N : Word;
            X : Word;
        S1,S2 : String[13];
       Buffer : PVideoArray;

Procedure SaveScreen; Interrupt;
 Begin
  Inc(X);
  Str(X,S1);
  S2 := 'save'+S1+'.scr';
  Assign(F,S2);
  ReWrite(F,1);
  BlockWrite(F,Buffer,1);
  Close(F);
 End;

Begin
 X := 0;
 GetMem(Buffer,4000*SizeOf(Byte) );
 Buffer := VideoPtr;
 SetIntVec(5, @SaveScreen );
 Keep(0);
End.
