Roberts II, Charles K. wrote: > It was giving a different output every time because the quotient was > not cleared before the routine was called. No. The quotient's contents before the routine is called are unimportant; the routine was giving a different output for some other reason, possibly related to bank-switching. > If I divide 0x0014/0x0004 = 0x0050, 0x0010/0x0002 = 0x8000, > 0x10/0x04 = 0x0800. Any ideas what is going on? One of three things is happening: 1. The code you're executing isn't the code you copied (with the ",W" fix I posted yesterday) from my web page. 2. You're not writing to/reading from the correct bank. 3. You're not accurately displaying the contents of the Quotient registers after the division. Don't focus on the division routine; it works. Look instead at the code that calls the routine and at the code that displays the quotient. That's where the problem is. -Andy === Andrew Warren -- aiw@cypress.com === Principal Design Engineer === Cypress Semiconductor Corporation === === Opinions expressed above do not === necessarily represent those of === Cypress Semiconductor Corporation -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body