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 >
Wrap
C/C++ Source or Header
|
1996-11-07
|
562b
|
22 lines
char cnvbcd(val)
int val;
{
#include "nistime.h"
#ifdef IBMPC
/*
this subroutine converts the integer value passed
in val into two 4-bit BCD digits. the two digits
are packed into a byte and are returned by the
function. this routine is used to format the
values for setting the CMOS clock.
this routine is only used in the IBMPC version and
will compile as a do-nothing if IBMPC is not defined
*/
int tendig,unidig;
tendig=val/10;
unidig=val - 10*tendig;
return(16*tendig + unidig);
#endif
}