Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
481 views
in Electronics by (106k points)
closed by

What will be the content of Accumulator, Register-B Overflow Flag (OV) after the execution of the following 8051 micro-controller assembly code?

MOV A, #65h

MOV 0F0h, #14h

DIV AB

DIV AB


1. A = 00h, B = 00h, OV = 1
2. A = 05h, B = 00h, OV = 0
3. A = 00h, B = 05h, OV = 0
4. A = 05h, B = 00h, OV = 1

1 Answer

0 votes
by (103k points)
selected by
 
Best answer
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:

  1. The DIV instruction divides the unsigned 8-bit integer in the accumulator by the unsigned 8-bit integer in register B.
  2. After the division, the quotient is stored in the accumulator.
  3. 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

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...