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
/
cnvbcd.c
< prev
next >
Wrap
Text File
|
1996-11-18
|
415b
|
17 lines
char cnvbcd(val)
int val;
{
/*
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.
*/
int tendig,unidig;
tendig=val/10;
unidig=val - 10*tendig;
return(16*tendig + unidig);
}