Correct Answer - Option 2 : A = 05h, B = 00h, OV = 0
Concept:
DIV AB instruction
If the numerator ! = 0 → always makes CY = 0 & OV = 0
If the numerator = 0 → CY = 0, OV = 1 (indicates an error)
The operation of this instruction is shown below:
- The DIV instruction divides the unsigned 8-bit integer in the accumulator by the unsigned 8-bit integer in register B.
- After the division, the quotient is stored in the accumulator.
- The remainder is stored in the B register.
Calculation:
Given contents of the accumulator and register are 65H and 14H respectively.
The values of the accumulator and the register B after DIV instruction executed two times are shown below after first and second-time execution respectively.
Instruction
|
Accumulator
|
Register B
|
DIV AB
|
04H
|
09H
|
DIV AB
|
00H
|
04H
|
OV = 0
Calculation:
Given contents of the accumulator and register are 65H and 13H respectively.
The values of the accumulator and the register B after DIV instruction executed two times are shown below after first and second-time execution respectively.
Instruction
|
Accumulator
|
Register B
|
DIV AB
|
05H
|
00H
|
DIV AB
|
05H
|
00H
|
OV = 0