For such a simple well defined case, what about using BCD? I haven't looked at the archives but why not take the original number, turn it into BCD in two bytes and return the lower nibble of the upper byte and the upper nibble of lower byte as a one byte BCD answer which is then turned back into a normal number? And of course a 9999 EOF marker. :-) chuckc pic microcontroller discussion list wrote: > On Mon, Feb 04, 2002 at 11:58:54AM -0700, WEBB,TIM (A-Sonoma,ex1) wrote: > Could someone show me how to do simple division on a 16F877 > > For example, I have a number between 0 and 255 and I want to know how many > times 10 can be divided into the number. > Is there a simple way to achieve this? For some background take a look at a brief tutorial I posted last year: (NOTE: PASSWORDED site to thwart E-mail spambots. user and password both are 'piclist') http://www.infosite.com/~jkeyzer/piclist/2000/Jul/1363.html BAJ -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body