In 8085 microprocessor, what is the output of following program ? LDA 8000H…
2018
In 8085 microprocessor, what is the output of following program ?
LDA 8000H
MVI B, 30H
ADD B
STA 8001H
- A.
Read a number from input port and store it in memory
- B.
Read a number from input device with address 8000H and store it in memory at location 8001H
- C.
Read a number from memory at location 8000H and store it in memory location 8001H
- D.
Load A with data from input device with address 8000H and display it on the output device with address 8001H
Attempted by 52 students.
Show answer & explanation
Correct answer: C
Answer: memory at 8001H will contain (memory at 8000H) + 30H (mod 256).
Explanation:
LDA 8000H — Load the accumulator A with the byte stored at memory address 8000H.
MVI B, 30H — Put the immediate value 30H into register B.
ADD B — Add the contents of register B to A; the result replaces A. If the sum exceeds 0xFF, it wraps modulo 256 and the carry flag is set.
STA 8001H — Store the final value of A into memory address 8001H.
Note: The program uses memory load/store instructions (LDA/STA), not I/O instructions (IN/OUT). Any answer that describes input/output device operations is incorrect.
A video solution is available for this question — log in and enroll to watch it.