Problem – Multiply two 8 bit numbers stored at address 2050 and 2051. Result is stored at address 3050 and 3051. Starting address of program is taken as 2000.
- We are taking adding the number 43 seven(7) times in this example.
- As the multiplication of two 8 bit numbers can be maximum of 16 bits so we need register pair to store the result.
|2000||LHLD 2050||H←2051, L←2050|
|2004||MOV C, D||C←D|
|2005||MVI D 00||D←00|
|2007||LXI H 0000||H←00, L←00|
|200C||JNZ 200A||If Zero Flag=0, goto 200A|
|200F||SHLD 3050||H→3051, L→3050|
Explanation – Registers used: A, H, L, C, D, E
- LHLD 2050 loads content of 2051 in H and content of 2050 in L
- XCHG exchanges contents of H with D and contents of L with E
- MOV C, D copies content of D in C
- MVI D 00 assigns 00 to D
- LXI H 0000 assigns 00 to H and 00 to L
- DAD D adds HL and DE and assigns the result to HL
- DCR C decreaments C by 1
- JNZ 200A jumps program counter to 200A if zero flag = 0
- SHLD stores value of H at memory location 3051 and L at 3050
- HLT stops executing the program and halts any further execution
Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.
- 8085 program to multiply two 8 bit numbers using logical instructions
- 8085 program to multiply two 16-bit numbers
- 8086 program to multiply two 16-bit numbers
- 8086 program to multiply two 8 bit numbers
- 8085 program to find maximum of two 8 bit numbers
- 8085 program to add two 8 bit numbers
- 8085 program to add two 16 bit numbers
- 8085 program to swap two 8-bit numbers
- 8085 program to subtract two 8-bit numbers with or without borrow
- 8085 program to find larger of two 8 bit numbers
- 8085 program to swap two 16 bit numbers using Direct addressing mode
- 8085 program to swap two 8 bit numbers using Direct addressing mode
- 8085 program to divide two 8 bit numbers
- 8085 program to subtract two 16-bit numbers with or without borrow
- 8085 program to divide two 16 bit numbers
- 8085 program to sum of two 8 bit numbers without carry
- 8085 program to add three 16 bit numbers stored in registers
- 8085 program to convert an 8 bit number into Grey number
- 8085 program to find 1's and 2's complement of 8-bit number
- 8085 program to convert 8 bit BCD number into ASCII Code
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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.
Improved By : nidhi_biet