home *** CD-ROM | disk | FTP | other *** search
/ nisttime.carsoncity.k12.mi.us / nisttime.carsoncity.k12.mi.us.tar / nisttime.carsoncity.k12.mi.us / pub / acts / cnvbcd.c < prev    next >
C/C++ Source or Header  |  1996-11-07  |  562b  |  22 lines

  1. char cnvbcd(val)
  2. int val;
  3. {
  4. #include "nistime.h"
  5. #ifdef IBMPC
  6. /*
  7.         this subroutine converts the integer value passed
  8.         in val into two 4-bit BCD digits.  the two digits
  9.         are packed into a byte and are returned by the
  10.         function.  this routine is used to format the
  11.         values for setting the CMOS clock.
  12.  
  13.     this routine is only used in the IBMPC version and
  14.     will compile as a do-nothing if IBMPC is not defined
  15. */
  16. int tendig,unidig;
  17.         tendig=val/10;
  18.         unidig=val - 10*tendig;
  19.         return(16*tendig + unidig);
  20. #endif
  21. }
  22.