home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 15 / CD_ASCQ_15_070894.iso / vrac / tsr4c.zip / CLOCK.C < prev    next >
Text File  |  1992-02-25  |  788b  |  27 lines

  1. /***************************************************************
  2.     TINY CLOCK TSR - RESIDENT MODULE
  3. ****************************************************************/
  4.  
  5. #include "cr.h"
  6.  
  7. char time_str[]="00:00:00";
  8.  
  9. popclock(void)
  10. {  register char *t,*s;
  11.    struct time_rec cur_time;
  12.  
  13.     add_tsc_event(6L);    /* Setup next event in 1/3 second */
  14.  
  15.     bios_time(&cur_time);    /* Read BIOS time of day */
  16.  
  17.     t=&cur_time.hours;    /* Prepare to convert hh:mm:ss */
  18.     s=time_str;
  19.     do cv_b2dec((byte)*t,s), s+=3;     /* Convert 1 byte to decimal */
  20.       while (--t>=&cur_time.seconds);  /* Until done with seconds */
  21.  
  22.     chk_video();          /* Obtain current video settings */
  23.     crs_x=scr_width-8;      /* Set cursor to upper right corner */
  24.     dsp(time_str);          /* Display time string there */
  25.  
  26. }
  27.