Microprocessors · Digital Electronics
22 questions · asked in 13 of 26 years (2001–2026)
MCQ 20 · NAT 21-mark 18 · 2-mark 4
2001Questions per year2026
Questions 16–20 of 22
A software delay subroutine is written as given below :
DELAY : MVI H, 255D
MVI L, 255D
LOOP : DCR L
JNZ LOOP
DCR H
JNZ LOOP
How many times DCR L instruction will be executed ?
DELAY : MVI H, 255D
MVI L, 255D
LOOP : DCR L
JNZ LOOP
DCR H
JNZ LOOP
How many times DCR L instruction will be executed ?
Answer: (D)
At the start, DCR L runs 255 times, until the content of L becomes 0.
After that, each time H is decremented, DCR L runs 256 times. The first run is when L is decremented by 1 and becomes . Then it runs more times. This repeats until the content of H becomes 1, which is 254 times.
So, in total, DCR L is executed
=255 + 254 x 256 =65279
After that, each time H is decremented, DCR L runs 256 times. The first run is when L is decremented by 1 and becomes . Then it runs more times. This repeats until the content of H becomes 1, which is 254 times.
So, in total, DCR L is executed
=255 + 254 x 256 =65279
The 8085 assembly language instruction that stores the content of H and L
register into the memory locations and , respectively, is:
Answer: (C)
(store H and L direct) stores the HL pair in two consecutive memory locations starting at the given address: the content of L goes to and the content of H goes to the next location, . (This is L first, then H, the reverse of the order in the question, but SHLD is still the only option that puts both registers in these two locations.)
Why the others fail:
(A), (B) SPHL has no address. It only copies the HL pair into the stack pointer, so nothing is stored in memory.
(D) STAX stores the accumulator A, not HL, and it takes only the BC or DE pair as the address, not a 16-bit address such as .
Answer: (C)
Why the others fail:
(A), (B) SPHL has no address. It only copies the HL pair into the stack pointer, so nothing is stored in memory.
(D) STAX stores the accumulator A, not HL, and it takes only the BC or DE pair as the address, not a 16-bit address such as .
Answer: (C)
The following program is written for an 8085 microprocessor to add two bytes
located at memory addresses 1FFE and 1FFF
LXI H, 1FFE
MOV B, M
INR L
MOV A, M
ADD B
INR L
MOV M, A
XOR A
On completion of the execution of the program, the result of addition is found
LXI H, 1FFE
MOV B, M
INR L
MOV A, M
ADD B
INR L
MOV M, A
XOR A
On completion of the execution of the program, the result of addition is found
Answer: (C)
Step by step:
LXI H, 1FFE: HL = 1FFE.
MOV B, M: B = data at 1FFE (first byte).
INR L: adds 1 to register L only, not to the HL pair. L = FE becomes FF, so HL = 1FFF.
MOV A, M: A = data at 1FFF (second byte).
ADD B: A = A + B, which is the sum.
INR L: L = FF becomes 00. INR works on 8 bits and the carry does not go into H, so H stays 1F and HL = 1F00. (A 16-bit increment, INX H, would give 2000.)
MOV M, A: the sum is stored at address 1F00.
XRA A: clears A to 00H, so the sum is no longer in A.
So the result is at memory address 1F00.
Answer: (C)
LXI H, 1FFE: HL = 1FFE.
MOV B, M: B = data at 1FFE (first byte).
INR L: adds 1 to register L only, not to the HL pair. L = FE becomes FF, so HL = 1FFF.
MOV A, M: A = data at 1FFF (second byte).
ADD B: A = A + B, which is the sum.
INR L: L = FF becomes 00. INR works on 8 bits and the carry does not go into H, so H stays 1F and HL = 1F00. (A 16-bit increment, INX H, would give 2000.)
MOV M, A: the sum is stored at address 1F00.
XRA A: clears A to 00H, so the sum is no longer in A.
So the result is at memory address 1F00.
Answer: (C)
A memory system has a total of 8 memory chips, each with 12 address lines and
4 data lines, The total size of the memory system is
Answer: (A)
Each chip has 12 address lines, so it has locations. Each location holds 4 bits (4 data lines).
Size of the whole memory = number of chips locations per chip bits per location
= 131072 bits = 128 kbits
= 128/8 = 16 kbyte
Answer: (A)
Size of the whole memory = number of chips locations per chip bits per location
= 131072 bits = 128 kbits
= 128/8 = 16 kbyte
Answer: (A)
When a program is being executed in an 8085 Microprocessors, its Program Counter contains
Answer: (D)
The Program Counter holds the memory address of the next instruction to be executed.
Keep practising