šŸŽ“ BookMCQ
← Back to 5. The 8085 Microprocessor

šŸ“ Timing Diagram of MOV reg, M of 8085 Microprocessor (12 MCQs)

Memory-to-Register Transfer Using MOV reg,M

The 8085 instruction MOV reg,M transfers an eight-bit value from the memory location addressed by the HL register pair into a selected general-purpose register. The destination may be A, B, C, D, E, H or L. The instruction is one byte long and requires an opcode-fetch machine cycle followed by a memory-read machine cycle.

Role of HL and the Memory Address Bus

The H and L registers together hold the sixteen-bit address of the required memory location. During the memory-read operation, this address is presented on the address bus, with the lower byte multiplexed through AD0–AD7. ALE enables its latching, allowing the same pins to carry the retrieved data afterward.

Opcode Fetch and Memory Read Sequence

The first machine cycle fetches the MOV opcode in four T-states. The second machine cycle performs a memory read in three T-states. During its T1, HL supplies the memory address; during subsequent states RD becomes active low, and memory places the selected byte on the data bus for loading into the destination register.

Example of MOV A,M Execution and Data Transfer

Assume HL contains 2050H and memory location 2050H stores 3AH. Executing MOV A,M fetches the opcode and then reads the byte addressed by HL. The accumulator receives 3AH, while HL and the original memory contents remain unchanged. The complete instruction requires seven T-states.

Machine-Cycle Count and Flag Behavior

The instruction contains one opcode byte and uses two machine cycles: a four-T-state opcode fetch and a three-T-state memory read. It does not perform arithmetic or logical processing, so none of the five 8085 flags is modified. Similar transfers into B, C, D, E, H and L follow the same basic timing pattern.

Misconceptions About MOV reg,M Timing

'MOV A,M reads memory address stored in A' is incorrect because the address comes from HL. 'The instruction requires a memory-write cycle' is incorrect because data moves from memory into a register. 'MOV reg,M changes the flags' is incorrect because register-transfer instructions preserve the status flags.

Memory-Read Timing and Register-Transfer Questions

Identify HL as the source of the memory address and the selected register as the destination. Trace the four-T-state opcode fetch and three-T-state memory read, including ALE and RD. Practise calculating the resulting register contents and explaining why memory and flags remain unchanged after this transfer.

Memory-to-Register Transfer Terminology

  • M - Memory location addressed by HL.
  • HL Pair - Holds the sixteen-bit source address.
  • MOV - Copies data without altering its source.
  • RD - Activates memory reading.
  • Opcode Fetch - Retrieves the instruction byte.
  • Memory Read - Transfers a stored byte to the processor.
2
Easy
6
Medium
4
Hard

šŸ“ All Timing Diagram of MOV reg, M of 8085 Microprocessor MCQs

Q1. An instruction MOV A, M reads the byte stored at the memory address held in the H‑L pair and loads it into the accumulator. If memory location 0x30 contains the value 0x5A, what will A contain after the instruction completes?

A.90 āœ…
B.165
C.0
D.255
šŸ’” Difficulty: easy | āœ… Correct: A

šŸ“– Explanation: The correct answer is 0x5A because the MOV A, M operation copies exactly the byte found at the specified address into the accumulator. Option 0xA5 is the bit‑reversed form and is unrelated. 0x00 would be the result only if the memory held zero, and 0xFF would be the result of a full‑scale value. In a real‑world microcontroller, this behavior lets a programmer retrieve sensor data stored in RAM with a single instruction.

Q2. Which register pairs can be combined to form a 16‑bit address register in the SAP‑III architecture?

A.B‑C
B.D‑E
C.H‑L
D.All of the above āœ…
šŸ’” Difficulty: easy | āœ… Correct: D

šŸ“– Explanation: All three pairs—B‑C, D‑E, and H‑L—are defined as extended register pairs that can act as 16‑bit address registers, so the answer is ā€œAll of the above.ā€ The other choices list only one of the possible pairs, making them incomplete. Knowing the available pairs is essential when designing programs that need to address more than 256 bytes of memory, such as when storing a lookup table for a motor‑control algorithm.

Q3. Why does the timing diagram for MOV reg, M show two distinct machine cycles?

A.The first cycle fetches the opcode, the second fetches the operand from memory.
B.The first cycle writes the result, the second clears the flags. āœ…
C.Both cycles are used to increment the program counter twice.
D.One cycle fetches the opcode and the other writes to the register file.
šŸ’” Difficulty: medium | āœ… Correct: B

šŸ“– Explanation: The MOV reg, M instruction must first fetch its opcode (the first machine cycle) so the CPU knows which operation to perform. In the second cycle the CPU reads the memory operand whose address is provided by the H‑L pair and transfers that byte into the destination register. Options A and C describe parts of the process but miss the two‑cycle structure, while D incorrectly suggests a write‑back operation that does not occur for a simple load.

Q4. If the program counter points to a MOV H, M instruction and the next byte in memory is 0x80, what value will the H register contain after execution?

A.128 āœ…
B.0
C.255
D.1
šŸ’” Difficulty: medium | āœ… Correct: A

šŸ“– Explanation: MOV H, M copies the byte at the memory location addressed by the H‑L pair into the H register. Since the operand byte is 0x80, H will receive exactly that value. Option 0x00 would be correct only if the memory contained zero, 0xFF would require the memory to hold 255, and 0x01 is unrelated. This behavior is used in embedded systems to load configuration data directly into a register without extra arithmetic.

Q5. How does the four‑bit flag register respond when a MOV instruction transfers data to a register?

A.It updates all flags based on the transferred value. āœ…
B.It does not affect any flags.
C.It clears all flags to zero.
D.It sets the carry flag automatically.
šŸ’” Difficulty: medium | āœ… Correct: A

šŸ“– Explanation: The MOV instruction merely moves data; it does not perform arithmetic or logical operations that would modify the status flags. Therefore the flag register remains unchanged. Option A is incorrect because flags are only altered by operations that affect the accumulator’s condition. Option C would erase useful status information, and Option D would incorrectly set a flag that has no relevance to a simple data move. Keeping flags intact is important when a program relies on previous flag states for branching decisions.

Q6. A programmer wants to copy the byte at memory address 0x2000 into register D using MOV D, M. Assuming the H‑L pair already holds 0x2000, how many T‑states does the instruction normally consume?

A.4
B.6
C.8 āœ…
D.10
šŸ’” Difficulty: medium | āœ… Correct: C

šŸ“– Explanation: In the SAP‑III timing diagram, MOV reg, M typically requires two machine cycles: the first cycle (4 T‑states) fetches the opcode, and the second cycle (4 T‑states) reads the memory operand. This totals 8 T‑states. Options 4 and 6 omit one of the cycles, while 10 adds an extra cycle that does not exist for this instruction. Knowing the exact timing helps designers estimate execution speed for time‑critical tasks such as real‑time sensor polling.

Q7. Why does the timing diagram of MOV reg, M show a high‑impedance (Z) state on the data bus during the opcode fetch cycle?

A.Because the memory is not driving the bus at that moment. āœ…
B.Because the CPU is waiting for an interrupt.
C.Because the address lines are being latched.
D.Because the data bus is reserved for future use.
šŸ’” Difficulty: hard | āœ… Correct: A

šŸ“– Explanation: During the opcode fetch, the CPU places the address on the address bus and asserts a read signal, but the data bus is placed in a high‑impedance state (Z) so that the memory can safely drive it without contention. Option A misidentifies the source of the Z state, B incorrectly involves interrupts, and D suggests a reservation that does not occur. This behavior is crucial in hardware designs where multiple devices share a bus, preventing electrical conflicts.

Q8. In a system where the memory read latency is 2 T‑states longer than the standard timing, how does this affect the total execution time of MOV A, M?

A.It increases the total time by 2 T‑states. āœ…
B.It decreases the total time by 2 T‑states.
C.It does not change the total time.
D.It increases the total time by 4 T‑states.
šŸ’” Difficulty: hard | āœ… Correct: A

šŸ“– Explanation: The standard MOV A, M takes two machine cycles (4 T‑states for opcode fetch and 4 T‑states for memory read). If the memory read now requires an additional 2 T‑states, the second cycle becomes 6 T‑states, raising the overall execution time to 10 T‑states, which is 2 T‑states longer than the original. Options B and C contradict the added latency, and D doubles the added delay. Understanding this effect is vital when optimizing real‑time loops that depend on precise timing.

Q9. An interrupt occurs after the opcode fetch of a MOV B, M instruction but before the memory read. Which register is guaranteed to retain its original value?

A.Program Counter āœ…
B.Accumulator
C.B register
D.Stack Pointer
šŸ’” Difficulty: hard | āœ… Correct: A

šŸ“– Explanation: When an interrupt is taken, the CPU typically saves the current Program Counter on the stack before handling the interrupt, but the PC value itself is not altered until the interrupt service routine returns. The accumulator, B register, and stack pointer may be changed by the interrupt routine. Therefore the PC is the only register whose original value is guaranteed to be preserved. Options B, C, and D can be modified by the ISR, making them unsafe choices.

Q10. What is the effect on the data bus during the opcode fetch phase of a MOV instruction in the SAP‑III timing diagram?

A.The bus is driven high by the CPU. āœ…
B.The bus is driven low by the memory.
C.The bus is placed in a high‑impedance (Z) state.
D.The bus carries the address of the operand.
šŸ’” Difficulty: hard | āœ… Correct: A

šŸ“– Explanation: During the opcode fetch, the CPU does not drive the data bus; instead, it places the address on the address lines and asserts a read signal, allowing the memory to place the opcode on the data bus. To avoid contention, the CPU sets its data drivers to high‑impedance, denoted as Z. Option A incorrectly claims the CPU drives the bus high, B misstates the memory’s role, and D confuses address and data lines. This Z state is essential for reliable bus arbitration in multi‑device systems.

Q11. What is the size of the program counter in the SAP‑III computer?

A.8‑bit
B.12‑bit
C.16‑bit āœ…
D.24‑bit
šŸ’” Difficulty: medium | āœ… Correct: C

šŸ“– Explanation: The SAP‑III CPU uses a 16‑bit program counter, allowing it to address up to 216=655362^{16}=65536 memory locations. Options 8‑bit and 12‑bit describe smaller address spaces that would limit program length, while 24‑bit exceeds the architecture’s design. Knowing the PC width helps engineers decide whether a given program will fit within the available address range.

Q12. A student writes a loop that uses MOV L, M to load successive bytes from a buffer. If the buffer starts at address 0x4000 and L is incremented after each iteration, what value will L contain after three iterations?

A.16387 āœ…
B.16386
C.16384
D.16385
šŸ’” Difficulty: medium | āœ… Correct: A

šŸ“– Explanation: Each loop iteration reads the byte at the address held in H‑L, then the program increments L by 1. Starting at 0x4000, after the first iteration L becomes 0x4001, after the second 0x4002, and after the third 0x4003. Option 0x4002 stops one step early, 0x4000 indicates no increment, and 0x4001 reflects only a single iteration. This pattern is common when processing sequential data such as a string of characters stored in memory.

šŸ”— Related Topics (MCQs)