This reminds me of a game I use to play with a fellow programmer. When we had a bug we would look it over and then play the game "Fix That Bug", based on the game "Name That Tune". "I can fix that bug in five bytes." "I can fix that bug in four bytes." "Fix that bug!" Bill C. bill@cornutt.com ---------- > At 10:49 30/04/98 -0400, you wrote: > > > Improving the method discussed earlier: > taking X=byte and converting to BCD digits H,T,U > > in pseudoBasic!! > > H=0 > T=0 > U=X > if U>=200 then H=H+2: U=U-200: Goto Check40 'NUMBER WILL BE <=55 > if U>=100 then H=H+1: U=U-100 > if U>=80 then T=T+8: U=U-80: Goto Check10 'NUMBER WILL BE <=19 > Check40: > if U>=40 then T=T+4: U=U-40 > if U>=20 then T=T+2: U=U-20 > Check10: > if U>=10 then T=T+1: U=U-10 > > should take 24 to 48 instructions on a pic depending on X > > _____________________________________________________ > Osama ALASSIRY osama@qatar.net.qa osama@alassiry.com > http://www.alassiry.com >