Monday, February 29, 2016

8051 DIV Instruction

Division

Instruction DIV AB Divide 1 4 1 0 0 0 0 1 0 0 AB = A / B DIV AB divides the unsigned eight-bit integer in the Accumulator by the unsigned eight-bit integer in register B. The Accumulator receives the integer part of the quotient; register B receives the integer remainder. The carry and OV flags are cleared. Exception: if B had originally contained 00H, the values returned in the Accumulator and B-register are undefined and the overflow flag are set. The carry flag is cleared in any case. C AC F0 RS1 RS0 OV P The Accumulator contains 251 (0FBH or 11111011B) and B contains 18 ( 12H or 00010010B). The following instruction, DIV AB leaves 13 in the Accumulator (0DH or 00001101B) and the value 17 (11H or 00010001B) in B, since 251 = (13 x 18) + 17. Carry and OV are both cleared.

Related topics:
8051 Arithmetic Operation Instructions   |   8051 ADD Instruction   |   8051 ADDC Instruction   |   8051 SUBB Instruction   |   8051 INC Instruction   |   8051 DEC Instruction   |   8051 MUL Instruction   |   8051 DA Instruction

List of topics: 8051