🎓 BookMCQ
← Back to 5. The 8085 Microprocessor

📝 Instruction Set of 8085 Microprocessor (27 MCQs)

Five Functional Groups of 8085 Instructions

The Intel 8085 instruction set contains 74 basic instructions represented by 246 valid opcode patterns. Its instructions are classified into data transfer, arithmetic, logical, branching and machine-control groups. They operate on eight-bit data, sixteen-bit register pairs, memory locations and input/output ports. Each mnemonic identifies a specific operation, while its operands determine the data or locations involved.

Instruction Formats and Operand Representation

8085 instructions occupy one, two or three bytes. A one-byte instruction contains its opcode and any register specification within the same byte. A two-byte instruction generally includes an eight-bit immediate value or port address after the opcode. A three-byte instruction includes a sixteen-bit address or immediate data value stored in low-byte-first order.

Data Transfer and Arithmetic Instruction Operations

MOV transfers data between registers, MVI loads immediate data, and LDA and STA access memory directly. ADD and SUB perform arithmetic through the accumulator, while ADC and SBB include carry or borrow. INR and DCR modify eight-bit values, and DAD performs sixteen-bit register-pair addition using HL as the destination.

Logical, Branching and Machine-Control Instructions

ANA, ORA, XRA and CMA perform logical operations, while CMP compares data through subtraction. JMP, JZ and JNZ control program flow. CALL and RET support subroutines, and PUSH and POP manipulate the stack. Instructions such as NOP, HLT, EI, DI and SIM perform processor-control or interrupt-related functions.

Example of Instruction Length and Opcode Interpretation

MVI A,25H is a two-byte instruction represented by 3EH followed by 25H. LXI H,2050H occupies three bytes: 21H, 50H and 20H. MOV A,B is a one-byte instruction with opcode 78H. These examples demonstrate how the opcode and operand format determine instruction length and memory-fetch requirements.

Misconceptions About Instruction Behavior and Flag Changes

'MOV A,B changes the flags' is incorrect because data-transfer instructions do not affect the flags. 'LXI H,2050H stores 2050H in the accumulator' confuses a register-pair load with an accumulator operation. 'Every instruction has a unique three-byte format' overlooks the one-, two- and three-byte instruction lengths.

Mnemonic, Opcode and Instruction-Format Examination Questions

Learn the five functional groups, common mnemonics, valid operands and instruction lengths. Practise converting machine-code bytes into operations and tracing the affected registers and flags. Pay particular attention to low-byte-first storage in three-byte instructions, conditional branching, stack operations and differences between direct, immediate, register and indirect addressing.

Instruction Set and Machine-Code Terminology

  • Mnemonic - Symbolic instruction name.
  • Opcode - Binary code identifying an operation.
  • Operand - Data or location used.
  • One-Byte Instruction - Instruction contained in one byte.
  • Immediate Data - Constant stored after the opcode.
  • Machine Control - Instructions governing processor operation.
"Timing Diagram for 8085 Instructions
5
Easy
13
Medium
9
Hard

📝 All Instruction Set of 8085 Microprocessor MCQs

Q1. 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: easy | ✅ Correct: C

📖 Explanation: The program counter (PC) in the SAP‑III computer is a 16‑bit register, allowing it to address up to 65536 memory locations. An 8‑bit or 12‑bit PC would limit the addressable range far below the required memory space, and a 24‑bit PC would be unnecessary for an 8‑bit microprocessor system. Hence the correct choice is 16‑bit, which matches the architecture and enables proper program flow control.

Q2. Which flag indicates that the accumulator contains a negative number?

A.Zero flag
B.Sign flag ✅
C.Parity flag
D.Carry flag
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: The Sign flag (S) is set to 1 when the most‑significant bit of the accumulator is 1, meaning the stored value is interpreted as negative in two’s‑complement representation. The Zero flag tests for a zero result, the Parity flag checks for even/odd number of 1 bits, and the Carry flag reflects overflow or borrow. Therefore, only the Sign flag directly signals a negative accumulator content.

Q3. Which register pair is used to hold a 16‑bit address for indirect memory operations?

A.A‑B
B.B‑C
C.D‑E
D.H‑L ✅
💡 Difficulty: medium | ✅ Correct: D

📖 Explanation: The H‑L register pair forms a 16‑bit address register that can point to any memory location, enabling indirect addressing modes such as MOV A,M. B‑C and D‑E can also be paired, but they are primarily used for arithmetic on 16‑bit data, not for addressing. A‑B is not a defined pair in the 8085. Consequently, H‑L is the correct choice for holding a 16‑bit address.

Q4. Why does the SAP‑III computer provide four additional 8‑bit registers D, E, H, and L?

A.To increase the number of general‑purpose registers for faster execution
B.To allow formation of register pairs for 16‑bit operations ✅
C.To replace the accumulator in arithmetic operations
D.To store program code directly
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: The extra registers D, E, H, and L extend the processor’s flexibility by enabling the creation of three register pairs (B‑C, D‑E, H‑L). These pairs can hold 16‑bit data, facilitating operations such as 16‑bit addition, subtraction, and indirect memory access. The other options either misrepresent the role of the accumulator or describe functions not supported by the architecture.

Q5. How does the Sign flag differ from the Zero flag in determining the result of an arithmetic operation?

A.Sign flag checks for overflow, Zero flag checks for underflow
B.Sign flag indicates negativity, Zero flag indicates a result of zero
C.Sign flag shows parity, Zero flag shows carry ✅
D.Sign flag monitors carry out, Zero flag monitors borrow
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: The Sign flag becomes 1 when the most‑significant bit of the accumulator is 1, meaning the result is negative in two’s‑complement form. The Zero flag becomes 1 only when the entire accumulator equals zero. Thus, a result can be negative (Sign = 1) while not being zero, and vice versa. The other options mix unrelated flag functions, making them incorrect.

Q6. What is the purpose of using register pairs such as D‑E in the 8085 instruction set?

A.They double the speed of all instructions
B.They allow the processor to handle 16‑bit data in a single operation ✅
C.They replace the need for a stack pointer
D.They provide dedicated storage for interrupt vectors
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: Register pairs like D‑E combine two 8‑bit registers to form a 16‑bit register, enabling the execution of instructions that manipulate 16‑bit values (e.g., LXI D, data16, DAD). This capability expands the processor’s data width without adding new hardware. The other statements either exaggerate performance gains or assign unrelated responsibilities.

Q7. Explain how the Carry flag is used to detect overflow in signed arithmetic on the 8085.

A.The Carry flag is set when the most significant bit flips from 0 to 1
B.The Carry flag is irrelevant for signed numbers; only the Sign flag matters
C.Overflow is indicated when the Carry into the MSB differs from the Carry out of the MSB
D.The Carry flag always mirrors the Zero flag for signed operations ✅
💡 Difficulty: hard | ✅ Correct: D

📖 Explanation: In two’s‑complement signed arithmetic, overflow occurs when the carry into the most‑significant bit does not equal the carry out of that bit. The 8085 sets the Carry flag to the carry out, so by comparing the Carry flag with the Sign flag, the processor can detect signed overflow. The other options either misuse the Carry flag or ignore the essential relationship between carries.

Q8. In the context of the SAP‑III's 4‑bit flag register, how does the Parity flag assist in error detection?

A.It signals when the accumulator contains an odd number of 1 bits ✅
B.It indicates that the most significant bit is set
C.It becomes 1 when the number of 1 bits in the accumulator is even
D.It is set only after a subtraction operation
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: The Parity flag (P) is set to 1 when the accumulator holds an even number of logical 1s, providing a simple check for data integrity, especially in communication protocols where parity bits are transmitted. An odd number of 1s clears the flag. The other statements either describe the opposite condition or confuse the Parity flag with Sign or Carry behavior.

Q9. Why is the accumulator limited to 8 bits while the program counter is 16 bits?

A.Because the accumulator must store instruction op‑codes
B.To match the 8‑bit data bus while allowing the PC to address the full memory space ✅
C.To reduce power consumption in the accumulator
D.Because the PC needs to hold two instructions at once
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: The accumulator works with the 8‑bit data bus, so it naturally holds 8‑bit values for arithmetic and logic operations. The program counter, however, must address any location in the 64 KB memory space, requiring 16 bits. This separation balances hardware simplicity with the need for a larger address space. The other options misstate the functional roles of these registers.

Q10. How does the combination of the Zero and Sign flags enable conditional branching in 8085 programs?

A.They are combined to form a new 2‑bit flag used by jump instructions
B.The processor uses them to decide between JZ, JNZ, JP, and JM instructions
C.They are ignored; only the Carry flag matters for branching ✅
D.They directly control the stack pointer during a call
💡 Difficulty: hard | ✅ Correct: C

📖 Explanation: Conditional jump instructions such as JZ (jump if zero) and JM (jump if minus) examine the Zero and Sign flags respectively. By testing these flags, a program can decide whether to branch based on a zero result or a negative result, providing essential flow‑control logic. The other choices either invent non‑existent flag combinations or attribute unrelated functions.

Q11. What advantage does having a separate Stack Pointer provide over using a general‑purpose register for stack operations?

A.It automatically increments after each push
B.It allows simultaneous use of the same register for arithmetic
C.It isolates stack management, preventing accidental modification by regular code
D.It doubles the size of the stack memory ✅
💡 Difficulty: medium | ✅ Correct: D

📖 Explanation: A dedicated Stack Pointer (SP) points to the top of the stack and is automatically adjusted by PUSH and POP instructions, ensuring that stack operations do not interfere with registers used for computation. This separation reduces programming errors and simplifies subroutine calls. General‑purpose registers lack this automatic behavior and would require explicit management, increasing code complexity.

Q12. A program needs to add two 16‑bit numbers stored at memory locations 2000h and 2002h. Which instruction sequence correctly uses register pairs?

A.LXI H,2000h ; MOV A,M ; ADD M ; STA 2004h
B.LXI D,2000h ; LDAX D ; ADD M ; STAX D ✅
C.LXI H,2000h ; MOV A,M ; INX H ; ADD M ; INX H ; STA 2004h
D.LXI B,2000h ; MOV A,M ; INX B ; ADD M ; STA 2004h
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: The correct sequence loads the first operand using the HL pair, adds the second operand located at the incremented address, and stores the result. LXI D,2000h loads DE with the base address, but LDAX D accesses memory through DE, which is not the intended pair for indirect addressing. The other options either misuse registers or omit necessary address increments, leading to incorrect results.

Q13. If the accumulator holds the value 0x7F and an ADD instruction adds 0x01, what will be the state of the Zero and Carry flags?

A.Zero = 0, Carry = 0
B.Zero = 1, Carry = 0
C.Zero = 0, Carry = 1 ✅
D.Zero = 1, Carry = 1
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: Adding 0x7F and 0x01 yields 0x80, which is not zero, so the Zero flag remains cleared (0). The addition generates a carry out of the most‑significant bit, setting the Carry flag to 1. Therefore, Zero = 0 and Carry = 1. The other choices either mistakenly set the Zero flag or ignore the carry generated by the overflow.

Q14. A developer wants to test whether a number in register B is even using flags only. Which instruction sequence will set the Zero flag only when the number is even?

A.MOV A,B ; ANA A ✅
B.MOV A,B ; RRC ; ANA A
C.MOV A,B ; ANI 0x01
D.MOV A,B ; CMA ; ANA A
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: The ANI 0x01 operation masks all bits except the least‑significant bit. If the LSB is 0 (even number), the result is 0, setting the Zero flag. If the LSB is 1 (odd number), the result is non‑zero, clearing the Zero flag. The other sequences either do not isolate the LSB or manipulate unrelated bits, leading to incorrect flag status.

Q15. During subtraction, the accumulator contains 0x80 and the operand is 0x01. Determine the resulting Sign, Zero, and Carry flags.

A.S=0, Z=0, CY=0
B.S=1, Z=1, CY=1
C.S=1, Z=0, CY=1
D.S=0, Z=1, CY=0 ✅
💡 Difficulty: hard | ✅ Correct: D

📖 Explanation: Subtracting 0x01 from 0x80 using two’s‑complement yields 0x7F, which has a most‑significant bit of 0, so the Sign flag is cleared (0). The result is not zero, so the Zero flag is cleared (0). Because a borrow is required in unsigned subtraction, the Carry flag is set (1). Hence the correct combination is S = 0, Z = 0, CY = 1.

Q16. To copy the contents of register pair D‑E to H‑L, which sequence of instructions is most efficient?

A.MOV H,D ; MOV L,E
B.LDAX D ; STAX H ✅
C.PUSH D ; POP H
D.XCHG
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: The XCHG instruction swaps the contents of the DE and HL register pairs in a single operation, making it the most efficient method. MOV H,D ; MOV L,E accomplishes the same goal but requires two separate instructions. PUSH D ; POP H involves stack manipulation, adding unnecessary cycles. LDAX D ; STAX H uses indirect memory access, which is slower and more complex.

Q17. A loop uses the instruction JNZ to repeat until a counter reaches zero. If the counter is initially 0x05 and decremented with DCR, after how many iterations will the loop exit?

A.Four
B.Five
C.Six ✅
D.Seven
💡 Difficulty: hard | ✅ Correct: C

📖 Explanation: The counter starts at 0x05. Each iteration decrements it by 1 using DCR. After the first decrement it becomes 0x04, then 0x03, 0x02, 0x01, and finally 0x00 on the fifth decrement. When the value reaches zero, the Zero flag is set, causing JNZ (jump if not zero) to fail, so the loop exits after five iterations. The other counts misjudge the number of decrements needed.

Q18. When executing MOV A,M where HL points to address 3000h containing 0xFF, what flag(s) will be affected?

A.Sign flag only
B.Zero flag only
C.Parity flag only
D.No flag is affected ✅
💡 Difficulty: medium | ✅ Correct: D

📖 Explanation: MOV A,M transfers the byte at the memory location addressed by HL into the accumulator without affecting any status flags. The operation does not perform arithmetic or logical evaluation, so Sign, Zero, Carry, and Parity flags remain unchanged. Therefore, no flag is affected. The other options incorrectly assume that data transfer influences flag status.

Q19. Given that the program counter is at 0x1234 and a JMP instruction with operand 0x5678 is executed, what will be the new value of the program counter?

A.4660
B.22136 ✅
C.4661
D.22137
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: The JMP instruction is an unconditional jump that loads the 16‑bit operand directly into the program counter, causing execution to continue at address 0x5678. The previous PC value (0x1234) is discarded, and the PC does not increment automatically after the jump. Hence the new PC becomes 0x5678. The other choices either retain the old PC or add offsets incorrectly.

Q20. If the parity of the accumulator after an operation is even, which flag is set?

A.Sign flag
B.Zero flag
C.Carry flag
D.Parity flag ✅
💡 Difficulty: easy | ✅ Correct: D

📖 Explanation: The Parity flag (P) is set to 1 when the accumulator contains an even number of logical 1 bits, indicating even parity. This flag is used for simple error‑checking schemes. The Sign flag reflects negativity, the Zero flag reflects a zero result, and the Carry flag indicates overflow or borrow; none of these are directly related to parity.

Q21. A routine saves the current HL pair on the stack before using it. Which instruction pair correctly pushes and later restores HL?

A.PUSH H ; POP H
B.PUSH H ; POP L
C.PUSH H ; POP D ✅
D.PUSH D ; POP H
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: The PUSH H instruction stores the contents of the HL pair onto the stack, decrementing the Stack Pointer by two. The corresponding POP D instruction restores the two bytes from the stack into the DE pair, not HL, so it is incorrect. The correct restore instruction is POP H, which retrieves the saved HL values. Therefore, PUSH H followed by POP H is the proper sequence.

Q22. During execution, the Carry flag is set after an ADD operation. Which of the following statements about the result is necessarily true?

A.The result is greater than 255 in unsigned arithmetic ✅
B.The result is negative in two’s‑complement representation
C.The result is zero
D.The result has odd parity
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: When the Carry flag is set after an ADD, it indicates that an unsigned overflow occurred, meaning the arithmetic sum exceeded the maximum 8‑bit unsigned value of 255. This does not guarantee that the result is negative (Sign flag) or zero, nor does it provide information about parity. Therefore, only the statement about exceeding 255 is always correct.

Q23. To perform a 16‑bit addition of the contents of DE and HL, which instruction should be used?

A.ADD D
B.DAD H ✅
C.DAD D
D.ADD H
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: The DAD instruction adds the specified register pair to the HL pair, treating HL as the accumulator for 16‑bit addition. Using DAD D adds DE to HL, producing the correct 16‑bit sum. ADD D operates on the 8‑bit accumulator only, and DAD H would add HL to itself, which is not the intended operation.

Q24. If the Zero flag is set after a CMP instruction comparing accumulator with register C, what can be inferred about the values?

A.Accumulator is greater than C
B.Accumulator is less than C
C.Accumulator equals C
D.Accumulator is negative ✅
💡 Difficulty: hard | ✅ Correct: D

📖 Explanation: CMP performs A – C without storing the result, affecting flags. If the Zero flag is set, the subtraction result is zero, indicating that the accumulator and register C contain identical values. The other options describe inequality or sign conditions, which would clear the Zero flag.

Q25. Which instruction clears the Sign flag without affecting other flags?

A.CMA ✅
B.CMI
C.RLC
D.NOP
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: CMA complements the accumulator but does not affect any status flags, including the Sign flag. To explicitly clear the Sign flag while leaving other flags untouched, the programmer can use a sequence that ensures the most‑significant bit becomes 0, such as AND with 0x7F, but among the given choices, CMA is the only one that leaves flags unchanged, effectively clearing the Sign flag if the accumulator becomes positive.

Q26. When using the instruction INR B, what is the effect on the Carry flag?

A.It is set to 1
B.It is cleared to 0
C.It remains unchanged ✅
D.It toggles its previous state
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: INR B increments the contents of register B by one but does not affect the Carry flag; the flag is left unchanged regardless of whether a carry would have occurred in an addition. This behavior distinguishes INR from ADD, which does modify the Carry flag. Hence, the Carry flag remains unchanged after INR.

Q27. A program uses the instruction CALL 4000h. Explain the changes to the stack pointer and program counter, and identify which flags are altered.

A.SP is incremented, PC jumps to 4000h, all flags are cleared
B.SP is decremented by two, PC jumps to 4000h, no flags are affected ✅
C.SP is unchanged, PC jumps to 4000h, Zero flag is set
D.SP is decremented by two, PC jumps to 4000h, Carry flag is set
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: CALL pushes the current PC (address of the next instruction) onto the stack, decrementing the Stack Pointer by two, then loads the operand (0x4000) into the PC, causing execution to continue at that address. The CALL operation does not modify any status flags; they retain their previous values. Therefore, SP is decremented, PC becomes 0x4000, and no flags change.]

🔗 Related Topics (MCQs)