program scr;

type ScreenImage= Array[0..4095] of byte;

var i,j: integer;
    scr: ScreenImage absolute $b800:$0000;
    ch:  char;
    img: file;

begin
  assign(img,'test.scr');
  clrscr;
  writeln('                      * * *   C O L O R    T E S T   * * *');
  writeln('                           (TextColor,TextBackground)     ');
  for i:=0 to 15 do
    for j:=0 to 7 do
      begin
        gotoxy(3+j*10,i+4);
        textcolor(i);
        textbackground(j);
        write(i:3,',',j:1,' ');
      end;
  gotoxy(1,25);
  textbackground(black);
  textcolor(green);
  write('Press any key to put screen...');
  repeat
  until keypressed;
  rewrite(img);
  BlockWrite(img,scr,32);
  clrscr;
  write('Press any key to get screen...');
  repeat
  until keypressed;
  reset(img);
  BlockRead(img,scr,32);
  repeat
  until keypressed;
  gotoxy(38,22);
  textcolor(red+16);
  write('Done!')
end.
