answersLogoWhite

0

In the 8085 instruction set, 16-bit multiplication is typically performed using the MUL instruction. This instruction multiplies the 8-bit value in the accumulator with the 8-bit value in the specified register pair (BC, DE, HL). The result is a 16-bit product stored in the register pair designated for the operation. The MUL instruction is a complex operation that involves multiple steps, including shifting and adding the partial products to generate the final result.

User Avatar

ProfBot

3mo ago

Still curious? Ask our experts.

Chat with our AI personalities

JudyJudy
Simplicity is my specialty.
Chat with Judy
RossRoss
Every question is just a happy little opportunity.
Chat with Ross
DevinDevin
I've poured enough drinks to know that people don't always want advice—they just want to talk.
Chat with Devin
More answers

Since the 8080/8085 is an 8 bit computer, 16 bit multiplication must be done in pieces. Its the same concept as doing long hand decimal multiplication on a piece of paper. Problem is, the 8080/8085 does not have an 8 bit multiply instruction either, so you have to do successive addition. Also, since the product of two 16 bit integers could theoretically be a 32 bit result, you have to either limit the values of the input integers or you have to provide for the 32 bit case. Start by initializing a 32 bit accumulator in memory to zero, and by making copies of the two input integers. Setup a loop of 16 iterations. For each iteration, examine a bit of one of the the inputs for 1. If set, add the other input to the result. Then shift the first input one way and the other input the other way. When done, the result will be the product of the two inputs. We shift one input one way so we can examine each bit in turn. We shift the other input the other way because each bit of the first has a higher value as the partial multiplicand. (You could also rotate the result to the right, but you would need to remember to rotate it another 16 bits when done.) That was the case for unsigned integers. For signed integers, you use the normal rules for multiplying numbers. Record the sign of each number, and then convert it into its two's-complement positive value. Perform the multiplication as usual for the unsigned case. Then inspect the recorded signs and, if they are different, take the two's-complement of the result. Don't worry about overflow in either case. It's not possible if you provide for a 32 bit result. If, however, you want to convert the result back to 16 bit form, you have to consider overflow.

User Avatar

Wiki User

15y ago
User Avatar

Add your answer:

Earn +20 pts
Q: 16 bit multiplication using 8085 instruction set?
Write your answer...
Submit
Still have questions?
magnify glass
imp