#include<iostream.h>
#include<dos.h>
#include<conio.h>
unsigned int Thoigian = 0;
unsigned int TG = 0;
void interrupt (*OldInt)(...);
void interrupt NewInt(...)
{
Thoigian++;
OldInt();
}
void interrupt NewInt1(...){
TG++;
Thoigian++;
OldInt();
}
  void main()
  {
     char ch; int sogiay=0;   int dem = 0;
     OldInt = getvect(0x08);
     disable();
     setvect(0x08,NewInt);
     enable();
     clrscr();
     while( sogiay < 60){
     disable();
     sogiay = Thoigian/18.21;
     enable();

     if( sogiay % 10 == 0  ){
     cout << " Chuong trinh da chay "<< sogiay <<"s\n";
     //while( dem > 1 ){
     TG = 0;
     disable();
     setvect(0x08,NewInt1);
     enable();
     dem = 0;
     while(  dem < 5 ){
     disable();
     dem = TG/18.21;
     enable();
     //cout << " hien thi dem : "<<dem<<"s\n";
     }
     //disable();
     //setvect(0x08,NewInt);
     //enable();
     }

     }
     disable();
     setvect(0x08,OldInt);
     enable();
  }