Hi I have been using and it has been useful for me, the 16bit binary to BCD. AN526 http://www.microchip.com/1010/suppdoc/appnote/category/listing/index.htm Best regads Luis Fernando > Tim Webb wrote: > > > > I have a number from 0 to 35 and I want to seperate the tens and the ones > > into two seperate file registers > > How do I do it using a 16F877 ? > > > > Most of examples that I have found on the piclist are using instructions the > > 16f877 does not have. > > > Just subtract 10 in a loop, checking for > carry, and inc the hi register once for > each subtract. I imagine your input number > is always <=99 so it is 10 subtracts at most > and will be a very quick calculation. > -Roman > > -- -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads