Monday, April 18, 2016

Division


1.   Program for division of two 8-bit numbers. Assume the numbers are perfectly divisible.


See the contents of register C. The result is 8 / 2 = 4 which is correct. But the program will not be able to give the correct result if the numbers are not perfectly divisible.  The next program shows a better division program.


2.   Program for division of two 8-bit numbers. Store the result in terms of quotient and remainder.


See the contents of memory location 5003H (Remainder) and 5004H (Quotient). The result of 10 / 3 is quotient=3 and remainder=1.

No comments:

Post a Comment