All Exams Test series for 1 year @ ₹349 only
Question

How many times will the following loop be executed ?

LXI B, 0007 H

LOP : DCX B

MOV A, B

ORA C

JNZ LOP

This question was previously asked in
UGC NET 2014 Paper 2 Computer Science and Applications Question Paper (28-Dec-2014)
The correct answer is

07

LXI B, 0007 H loads the register pair BC with 0007 H (B = 00 H, C = 07 H).

DCX B decrements the 16-bit pair BC, but DCX does not affect any flag. So the program tests for zero by copying B into the accumulator (MOV A, B) and OR-ing it with C (ORA C); the Z flag is set only when both B and C are 00 H, i.e. BC = 0000 H.

JNZ LOP repeats the loop while BC ≠ 0. After successive passes BC takes the values 0006, 0005, 0004, 0003, 0002, 0001, 0000 H.

The loop body therefore runs \(7\) times; after the 7th DCX, BC = 0000 H, Z = 1 and the jump is not taken.

Hence, the answer is 07.

Was this answer helpful?

Similar Questions

  1. Match the following 8085 instructions with the flags :

     List – I List – II
    a.XCHGi.only carry flag is affected.
    b.SUBii.no flags are affected.
    c.STCiii.all flags other than carry flag are affected.
    d.DCRiv.all flags are affected.

    Codes :

    a b c d

  2. Specify the contents of the accumulator and the status of the S, Z and CY flags when 8085 microprocessor performs addition of 87 H and 79 H.

  3. One of the main features that distinguish microprocessor from micro-computers is

  4. What will be the output at PORT1 if the following program is executed ?

    MVI B, 82H

    MOV A, B

    MOV C, A

    MVI D, 37H

    OUT PORT1

    HLT

  5. Which of the following 8085 microprocessor hardware interrupt has the lowest priority ?

  6. In 8085 microprocessor, the digit 5 indicates that the microprocessor needs

  7. In 8085, which of the following performs : load register pair immediate operation ?

  8. The RST 7 instruction in 8085 microprocessor is equivalent to :

  9. 8085 microprocessor has _____ hardware interrupts.

  10. Which of the following in 8085 microprocessor performs

    HL = HL + DE ?


Important Questions from Microprocessors

  1. What is the value in AL and CF after the following instruction in 8086 is executed?
    MOV AL, 8EH
    MOV CL, 02H
    SAR AL, CL
  2. What is the content in R1, after the following instructions are executed?
    CLR C
    MOV A,#4CH
    SUBB A,#6EH
    JNC NEXT
    CPL A
    INC A
    NEXT: MOV R1, A
  3. When TMOD is 10 H, the timer will operate as ____________.
  4. The Assembler directive in 8086 which is used to tell the assembler that the names or labels following the directive are in some other assembly module is, ____________.
  5. The magnetic vector potential of an electromagnetic system is given by $  \vec{A}=(y \cos ax)  \vec{a_x} + (y+e^x)   \vec{a_z}$. The magnitude of the magnetic flux density at the origin is

Need Expert Advice?
Upcoming Exams
CTET
December 12, 2026
WB SET
December 13, 2026
CBSE UGC NET
December 14, 2026
CSIR UGC NET
December 19, 2026
Test Series
UGC NET img
Teaching
UGC NET (Paper 2) December 2026 Mock Test Series
799 Tests 2 Tests Free
299 Attempts
4.4(45)
English, Hindi
More Questions from UGC NET

Start Your Preparation with Prepp Mobile App

Download the app from Google Play & App Store
Download the app from Google Play & App Store
Prepp Mobile App