#include "deftype.h"

int bin2bcd(unint bin,unchar *bcd)
/* 俀恑壔侾侽恑悢乮俛俠俢乯 仼 侾俇恑悢曄姺儖乕僠儞 */
{
unint mbin;
unchar bcd2[5]; /* BCD偼嵟戝俆僶僀僩乮侾侽寘乯*/
unint i=4,j=0;
	while (mbin=bin%100,bin/=100,bin>0) {
		bcd2[i--]=((mbin/10)<<4)+(mbin%10);
	}
	bcd2[i]=((mbin/10)<<4)+(mbin%10);
	for(;i<5;i++) bcd[j++]=bcd2[i];
	return(j); /* 僶僀僩悢傪曉偡 */
}
