home *** CD-ROM | disk | FTP | other *** search
/ nisttime.carsoncity.k12.mi.us / nisttime.carsoncity.k12.mi.us.tar / nisttime.carsoncity.k12.mi.us / pub / daytime / unpbcd.c < prev    next >
Text File  |  1996-11-18  |  321b  |  12 lines

  1. int unpbcd(ival)
  2. int ival;
  3. {
  4. /*
  5.         this routine receives a packed BCD value in ival (as read
  6.         from the CMOS clock) and returns the integer value.
  7.         it is the inverse function to cnvbcd, which produces a packed
  8.         BCD value from an integer input
  9. */
  10.         return(10*(ival >> 4) + (ival & 0xf) );
  11. }
  12.