(*$M 8192, 0, 32768 *) (*$F+*)

Program SE_ITIME;
Uses  Crt, Dos;

(*
 *  17.01.1994: Creation TL
 *  12.10.2003:
 *
 *  1) Lancer plusieurs fois le programme...
 *     Verifier l'occupation memoire au fur et a mesure avec MEMMAP
 *
 *  Q) Pourquoi et comment les programmes
 *     sont-ils actifs en "meme temps" ?
 *)

Var XX, YY, K_TIM :Integer; TimIntVec_OLD :PROCEDURE;

(*-----*)

Procedure TimIntVec_GXY; INTERRUPT;
  Var WX, WY, WW :Integer;
Begin
  WX:=WhereX; WY:=WhereY; GotoXY(XX, YY); WRITE(' ');
  Case Random(4) Of
    0: If XX >  1 Then Dec(XX);
    1: If XX < 80 Then Inc(XX);
    2: If YY >  1 Then Dec(YY);
    3: If YY < 24 Then Inc(YY);
  End;
  GotoXY(XX, YY); WRITE('O'); GotoXY(WX, WY);

  For WX:=0 To MaxINT Do
    For WY:=0 To 64 Do WW:=WW+1;

  ASM
    PUSHF
    CLI
  End;
  TimIntVec_OLD;
  ASM
    STI
  End;
End;   (* TimIntVec_GXY *)

(*-----*)

Begin  (* Debut *)
  K_TIM:=0;
  GetIntVec($1C, Addr(TimIntVec_OLD));
  
  RANDOMIZE;
  XX:=2+ 4*Random(19); YY:=5+Random(10); TextColor(1+Random(15));
  SetIntVec($1C, Addr(TimIntVec_GXY));
  
  SwapVectors;
  EXEC(GetENV('COMSPEC'), '');
  SwapVectors;
  
  SetIntVec($1C, Addr(TimIntVec_OLD));
  ClrSCR; WriteLN; WriteLN('    Bye Bye');
End.   (* SE_ITIME *)
