home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 September / Simtel20_Sept92.cdr / msdos / sysutl / busy1.arc / BUSY.C next >
C/C++ Source or Header  |  1989-10-26  |  811b  |  30 lines

  1. /*
  2. **    This program demonstrates several "busy indicators", and also
  3. **    serves as a example of using the BIOS clock tick timer at 40:40
  4. **    Written in 1989 by Otto Makela, Jyvaskyla, Finland.
  5. **    Permission is granted to copy this code freely, though a small
  6. **    mention of the source would be appreciated... :-)
  7. */
  8.  
  9. main()    {
  10.     register int i,j;
  11.     const far unsigned char *tick=(far unsigned char *)0x00400040;
  12.  
  13.     scr_printf("  two     four          eight\n");
  14.     while(scr_poll()==-1)
  15.         if((i=*tick>>2)!=j)
  16.             scr_printf(
  17.                 "  %c %c     %c %c %c %c %c     %c %c %c\r",
  18.                 "▄▀"        [i&1],
  19.                 "▌▐"        [i&1],
  20.                 "/|\\-"        [i&3],
  21.                 " -÷:"        [i&3],
  22.                 "-=≡="        [i&3],
  23.                 "\36\20\37\21"    [i&3],
  24.                 "▄▐▀▌"        [i&3],
  25.                 "║╗═╔║╚═╝"    [i&7],
  26.                 " ░▒▓█▓▒░"    [i&7],
  27.                 " ·∙\11O\11∙·"    [i&7],
  28.                 j=i);
  29. }
  30.