/*****
                              packtime()

      This function collapses the time into an unsigned integer using the
   DOS disk format with bits: 0x00 - 0x04 = sec, 0x05 - 0x08 = minutes,
   0x09 - 0x0f = hour. Second are in two-second increments (0 - 29).

   Argument list:    int sec        seconds
                     int min        minutes
                     int hour       hour

   Return value:     unsigned int   the packed time

*****/

unsigned int packtime(int sec, int min, int hour)
{
   unsigned int result;

   sec >>= 1;        /* Divide seconds in half */
   result = sec;
   min <<= 0x05;
   hour <<= 0x0b;
   result += min;
   result += hour;
   return result;
}
