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

Consider the following program fragment in assembly language:

mov ax, 0h

mov cx, 0A h

doloop:

dec ax

loop doloop

What is the value of ax and cx registers after the completion of the doloop?

The correct answer is

ax = FFF6 h and cx = 0 h

CX starts at 0Ah, or 10. Each LOOP instruction decrements CX and repeats while it is nonzero, so DEC AX executes ten times.

\(AX=(0-10)\bmod 2^{16}=65526=\mathrm{FFF6}_{16}\)

Thus AX = FFF6h and CX = 0000h.

Was this answer helpful?

Important Questions from Machine Instructions and Addressing Modes

  1. Consider a processor P whose instruction set architecture is the load-store architecture. The instruction format is such that the first operand of any instruction is the destination operand.

    Which one of the following sequences of instructions corresponds to the high-level language statement $Z = X + Y$ ?
    Note: X, Y, and Z are memory operands. R0, R1, and R2 are registers.
  2. Instruction AAA is used to
  3. Which of the following is/are part of an Instruction Set Architecture of a processor?
  4. The following language uses mnemonic OP codes

  5. What will be the hexadecimal value in the register ax (32-bit) after executing the following instructions ?

        mov al, 15

        mov ah, 15

        xor al, al

        mov cl, 3

        shr ax, cl

    Codes :

Need Expert Advice?

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