4 * Convert a single byte between (unsigned) packed bcd and binary.
9 __KERNEL_RCSID(0,"$NetBSD$");
11 #include <lib/libkern/libkern.h>
14 bcdtobin(unsigned int bcd
)
17 return (((bcd
>> 4) & 0x0f) * 10 + (bcd
& 0x0f));
21 bintobcd(unsigned int bin
)
24 return ((((bin
/ 10) << 4) & 0xf0) | (bin
% 10));