8085 program to multiply two 8 bit numbers using logical instructions
Prerequisite – Logical instructions in 8085 microprocessor
Problem – Write a assembly language program multiply two 8 bit numbers and store the result at memory address 3050 in 8085 microprocessor.
Example –

The value of accumulator(A) after using RLC instruction is:
A = 2n*A
Where n = number of times RLC instruction is used.
Assumptions –
Assume that the first number is stored at register B, and second number is stored at register C. And the result must not have any carry.
Algorithm –
- Assign the value 05 to register B
- Assign the value 04 to register C
- Move the content of B in A
- Rotate accumulator left without carry
- Rotate accumulator left without carry
- Store the content of accumulator at memory address 3050
- Halt of the program
Program –
| MEMORY ADDRESS | MNEMONICS | COMMENTS |
|---|---|---|
| 2000 | MVI B 05 | B <- 05 |
| 2002 | MVI C 04 | C <- 04 |
| 2004 | MOV A, B | A <- B |
| 2005 | RLC | rotate the content of A without carry |
| 2006 | RLC | rotate the content of A without carry |
| 2007 | STA 3050 | 3050 <- A |
| 200A | HLT | End of the program |
Explanation –
- MVI B 05: assign the value 05 to B register.
- MVI C 04: assign the value 04 to C register.
- MOV A, B: move the content of register B to register A.
- RLC: rotate the content of accumulator left without carry.
- RLC: rotate the content of accumulator left without carry.
- STA 3050: store the content of register A at memory location 3050
- HLT: stops the execution of the program.
Recommended Posts:
- Logical instructions in 8085 microprocessor
- 8085 program to multiply two 16-bit numbers
- 8085 program to multiply two 8 bit numbers
- COMPARE Instructions in 8085
- ROTATE Instructions in 8085
- Branching instructions in 8085 microprocessor
- Arithmetic instructions in 8085 microprocessor
- Data transfer instructions in 8085 microprocessor
- Logical instructions in 8086 microprocessor
- 8085 program to count total even numbers in series of 10 numbers
- 8085 program to count total odd numbers in series of 10 numbers
- 8086 program to multiply two 16-bit numbers
- 8086 program to multiply two 8 bit numbers
- 8085 program to add two 16 bit numbers
- 8085 program to add 2-BCD numbers
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



