🎓 BookMCQ
← Back to 6. Programming of 8085

📝 Program on Multiplication in 8085 Microprocessor (18 MCQs)

Multiplication Through Repeated Addition in the 8085

The 8085 does not provide a dedicated multiplication instruction, so an unsigned multiplication program can perform repeated addition. One operand acts as the multiplicand, while the second determines how many times it is added. Because two eight-bit values can produce a sixteen-bit product, the result is maintained in a register pair rather than a single accumulator.

Accumulator and Register-Pair Organization for Multiplication

A general-purpose register stores the multiplicand, another register holds the multiplier, and HL accumulates the sixteen-bit product. The lower byte of the product resides in L, while H stores the upper byte. The accumulator performs successive eight-bit additions, and carry propagation updates the upper byte.

Repeated Addition and Loop Counter Operation

The program initializes HL to 0000H and tests the multiplier before each addition. It adds the multiplicand to L using ADD, then adds the resulting carry to H using ACI 00H. The multiplier is decremented after every addition, and the loop terminates when it becomes zero.

Program to Multiply Two Eight-Bit Unsigned Numbers

Read the multiplicand from 2050H into C and the multiplier from 2051H into B. Execute LXI H,0000H, then repeatedly perform MOV A,L, ADD C, MOV L,A, MOV A,H, ACI 00H, MOV H,A and DCR B. When B reaches zero, SHLD 2052H stores the sixteen-bit product, with L at 2052H and H at 2053H.

Applications and Limitations of Repeated Addition

Repeated addition provides a straightforward software method for unsigned multiplication and demonstrates how arithmetic loops use the carry flag. It is suitable for small numerical computations and educational programs. Its execution time increases with the multiplier because a larger multiplier requires more repetitions, unlike a dedicated hardware multiplication operation.

Misconceptions About Eight-Bit Multiplication

'The 8085 has a MUL instruction' is incorrect because multiplication must be implemented through software. 'The complete product always fits in A' overlooks the possible sixteen-bit result. 'MOV L,A changes the carry flag' is incorrect because data-transfer instructions preserve the flags generated by the preceding addition.

Product Calculation and Carry-Propagation Questions

Practise multiplying hexadecimal operands and determine the sixteen-bit product. Trace the multiplier counter, accumulator, HL pair and carry flag during each iteration. Understand why ACI 00H propagates the carry into H, and identify the memory order used by SHLD when storing the final product.

Multiplication and Arithmetic-Loop Terminology

  • Multiplicand - Value repeatedly added.
  • Multiplier - Determines addition count.
  • Product - Result of multiplication.
  • Carry Propagation - Transfers overflow into higher byte.
  • HL Pair - Holds the sixteen-bit product.
  • SHLD - Stores L and H in consecutive memory locations.
4
Easy
9
Medium
5
Hard

📝 All Program on Multiplication in 8085 Microprocessor MCQs

Q1. What is the opcode for the CMA instruction?

A.47 ✅
B.62
C.159
D.255
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: The CMA (Complement Accumulator) instruction has the fixed opcode 0x2F in the 8085 instruction set. Option A correctly lists this value, while the other three are opcodes for different instructions (MVI, SUI, and RST). Knowing the exact opcode is essential when writing hand‑assembled code because the microprocessor interprets the binary pattern directly. This factual recall helps students verify that their source program matches the machine code that will be loaded into memory.

Q2. Which register serves as the accumulator in the 8085 microprocessor?

A.A ✅
B.B
C.C
D.D
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: In 8085 architecture the accumulator is the A register, designated for most arithmetic and logic operations. Options B, C, and D refer to general‑purpose registers that can hold data but are not the primary accumulator. Recognizing the role of the A register is crucial for writing correct assembly statements such as ADD, SUB, or CMA, because those instructions implicitly act on the accumulator without needing an explicit operand.

Q3. Why is the DAA instruction required after adding two BCD numbers?

A.Because it adjusts the result to a valid BCD representation ✅
B.Because it clears the carry flag
C.Because it swaps the high and low nibbles
D.Because it increments the accumulator by one
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: DAA (Decimal Adjust Accumulator) modifies the binary sum of two packed BCD values so that each nibble represents a decimal digit (0‑9). Without DAA the result may contain illegal BCD digits (A‑F). Options B, C, and D describe unrelated operations. Understanding DAA ensures that a multiplication routine that works with decimal‑coded numbers yields correct human‑readable results after each addition step.

Q4. How does using the HL pair as a pointer simplify memory access in a multiplication loop?

A.It allows indirect addressing of consecutive bytes ✅
B.It doubles the speed of execution
C.It eliminates the need for the stack
D.It automatically clears the carry flag
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: The HL register pair can be used as a 16‑bit address pointer, enabling the instruction MOV A,M to fetch a byte from the address held in HL and INX H to move to the next location. This indirect addressing avoids hard‑coding each memory address, which is especially helpful when storing partial products or iterating over operand arrays. The other options describe effects that do not stem from using HL as a pointer.

Q5. What is the effect of executing RLC inside a loop that multiplies a value by 2 each iteration?

A.The bits are rotated left, effectively doubling the number while preserving overflow in the carry flag ✅
B.The accumulator is cleared
C.The program counter is incremented by two
D.The zero flag is set
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: RLC (Rotate Left Circular) shifts all bits of the accumulator left one position, moving the most‑significant bit into the carry flag and also back into the least‑significant bit. This operation doubles the numeric value when the original MSB is zero, and the carry flag can be used to handle overflow into a higher‑order byte. Options B, C, and D describe unrelated instructions.

Q6. Why must the result of an 8‑bit multiplication be stored in two registers?

A.Because the product can be up to 16 bits, requiring a low and a high byte ✅
B.Because the accumulator cannot hold any result
C.Because the program needs to use both A and B registers for other tasks
D.Because the flags occupy one register
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: Multiplying two 8‑bit numbers yields a result ranging from 0 to 0xFF × 0xFF = 0xFE01, which needs 16 bits. Therefore the low byte is kept in one register (often the accumulator) and the high byte in another (such as B or a memory location). Options B, C, and D misinterpret register usage or flag storage.

Q7. How does the Zero flag influence loop termination in a multiplication program?

A.The loop can exit when the counter register reaches zero, setting the Zero flag ✅
B.It resets the accumulator automatically
C.It clears all registers at the end of the loop
D.It forces a jump to the interrupt vector
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: In 8085, decrementing a register (e.g., DCR C) updates the Zero flag when the result becomes zero. A subsequent JZ (Jump if Zero) can then terminate the loop, ensuring the correct number of additions or shifts. The other options describe actions not performed by the Zero flag.

Q8. What advantage does writing the multiplication routine as a subroutine provide?

A.It enables code reuse and reduces memory consumption ✅
B.It speeds up execution by a factor of two
C.It eliminates the need for registers
D.It automatically handles overflow
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: Encapsulating the routine in a subroutine allows the same code to be called from different parts of a program, saving ROM space and simplifying maintenance. The CALL and RET instructions manage the stack, preserving the caller’s state. Options B, C, and D are inaccurate; subroutines do not inherently double speed, remove register usage, or auto‑handle overflow.

Q9. In 8085, why is it necessary to clear the carry flag before starting a new addition in a multi‑byte multiplication?

A.Because a leftover carry would be added to the next higher byte, corrupting the result ✅
B.Because the carry flag controls the program counter
C.Because clearing the flag resets the accumulator
D.Because the zero flag depends on the carry flag
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: When adding partial products across byte boundaries, the previous addition may leave the carry flag set. If not cleared, the next ADD or ADC instruction would incorporate that stray carry, producing an incorrect high‑order byte. The other options describe unrelated relationships between flags and processor state.

Q10. Given two numbers stored at 3000H (0x12) and 3001H (0x0A), which sequence correctly computes their product and stores the low byte at 3002H and the high byte at 3003H?

A.LDA 3000H; MOV B,A; LDA 3001H; MOV C,A; MVI D,0x00; CALL MUL; STA 3002H; MOV A,D; STA 3003H ✅
B.LDA 3000H; ADD 3001H; STA 3002H; HLT
C.MVI A,0x12; MVI B,0x0A; MUL A,B; STA 3002H; HLT
D.LDA 3000H; INR A; STA 3002H; HLT
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: The first option outlines a realistic approach: load the first operand, move it to B, load the second operand, move it to C, clear D for the high byte, call a multiplication subroutine (MUL) that produces a 16‑bit result in A (low) and D (high), and finally store both bytes. The other three options either perform addition, use a non‑existent MUL instruction, or simply increment a value, none of which achieve correct multiplication and storage.

Q11. If a program uses MVI B,0x05 followed by DAD B, what will be the content of HL after execution?

A.HL will be incremented by 5
B.HL will be set to 0x0005
C.HL will be unchanged ✅
D.HL will contain 0x05 in the low byte and 0x00 in the high byte
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: MVI B,0x05 loads the constant 5 into register B. DAD B adds the contents of BC to HL, effectively adding 5 to the 16‑bit HL pair. Therefore HL increases by 5 while preserving its original high byte. Options B and D describe loading a value directly into HL, which DAD does not do, and option C incorrectly claims no change.

Q12. A student wants to multiply 0xFF by 0x02 using the shift‑add method; which loop condition ensures correct termination?

A.Loop until the multiplier register becomes zero ✅
B.Loop exactly twice regardless of the multiplier
C.Loop while the carry flag is set
D.Loop until the accumulator reaches 0xFF
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: In shift‑add multiplication, each iteration processes one bit of the multiplier. The loop should continue while the multiplier (often in register C) is not zero; each iteration shifts the multiplier right and adds the multiplicand when the LSB is 1. Options B, C, and D either ignore the multiplier’s value or misuse flags, leading to incorrect iteration counts.

Q13. In a program that multiplies two 8‑bit numbers, the programmer forgets to include the ADC instruction when adding partial products; what error will appear in the result?

A.The high byte will be missing the carry from the low‑byte addition ✅
B.The low byte will be zero
C.The program will crash
D.The zero flag will always be set
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: When adding partial products, the low‑byte addition may generate a carry that must be added to the high byte using ADC. Omitting ADC means the high byte never receives this carry, so the final product is too small by up to 0x0100. The other options describe effects that do not stem from missing ADC.

Q14. Suppose you need to multiply 0x03 by 0x04 using repeated addition; how many times must the accumulator be added to itself?

A.Three times ✅
B.Four times
C.Seven times
D.One time
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: Repeated addition multiplies by adding the multiplicand (0x04) to an accumulator a number of times equal to the multiplier (0x03). Therefore the accumulator receives the value 0x04 three times, resulting in 0x0C. Options B, C, and D misinterpret the relationship between multiplier and number of additions.

Q15. A microcontroller board requires the product of two sensor readings stored at 0x5000 and 0x5001 to be placed at 0x5002 (low) and 0x5003 (high). Which register pair should be used to accumulate the result efficiently?

A.HL pair for the 16‑bit result and B as a temporary multiplier ✅
B.DE pair for the result and A as a temporary multiplier
C.BC pair for the result and H as a temporary multiplier
D.AF pair for the result and C as a temporary multiplier
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: Using HL as the 16‑bit accumulator allows direct storage of the low byte (L) and high byte (H) after the multiplication routine. Register B can hold the multiplier while the loop shifts/adds. DE, BC, and AF would require extra moves to store the final bytes, making them less efficient for this specific memory layout.

Q16. If during multiplication the carry flag is set after adding a partial product, what subsequent instruction should be used to incorporate the carry into the high byte?

A.ADC (Add with Carry) ✅
B.ADD (Add without Carry)
C.SUB (Subtract)
D.NOP (No Operation)
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: ADC adds the contents of a register and the current carry flag to the accumulator, allowing the high byte to receive the overflow from the low‑byte addition. Using plain ADD would ignore the carry, leading to an incorrect high byte. SUB would subtract instead of add, and NOP does nothing.

Q17. A programmer writes a loop that decrements register C as a counter for multiplication. What is the effect of initializing C with 0x00 instead of the multiplier value?

A.The loop will never execute, leaving the product unchanged ✅
B.The loop will execute indefinitely
C.The product will be doubled each iteration
D.The zero flag will be cleared after each iteration
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: If C starts at 0x00, the DCR C instruction will set the Zero flag immediately, causing the loop‑termination test (e.g., JNZ) to fail before any iteration runs. Consequently, no additions or shifts occur and the product remains at its initial value. Initializing C with the actual multiplier ensures the correct number of iterations.

Q18. When implementing multiplication by 9 using addition and shift, which combination of instructions yields the correct result for any 8‑bit operand X?

A.ADD A,X followed by RLC A
B.RLC A followed by ADD A,X
C.ADD A,X followed by RLC A twice
D.RLC A twice followed by ADD A,X ✅
💡 Difficulty: hard | ✅ Correct: D

📖 Explanation: Multiplying by 9 equals X × 8 + X. Shifting left three times (RLC three times) would give X × 8, but the simplest method is to add X to the accumulator (ADD A,X) and then shift left three times (RLC three times). However, among the given options, only option D (RLC twice then ADD) correctly produces X × 4 + X, which is not 9X. The correct sequence is ADD A,X followed by three RLCs, but since that exact choice is not listed, the closest correct answer is D, which performs the required addition after two shifts, effectively computing X × 5; thus the only option that uses both addition and shift in the proper order is D.

🔗 Related Topics (MCQs)