Section: Arithmetic & Logic Operations
Aim: To multiply two 8 bit numbers stored at consecutive memory locations and also to verify the result.
Apparatus Required: 8085 microprocessor kit, key board.
Algorithm:
- Initialize memory pointer to data location.
- Move multiplicand to a register.
- Move the multiplier to another register.
- Clear the accumulator.
- Add multiplicand to accumulator.
- Decrement multiplier.
- Repeat step 5 till multiplier comes to zero.
- The result, which is in the accumulator, is stored in a memory location.
Program:
| Address | Label | Mnemonics | Operand | Comment |
|---|---|---|---|---|
| 4100 | START | LXI | H, 4200 | Initialize HL reg. to 4500 |
| 4103 | MOV | B, M | Transfer first data to reg. B | |
| 4104 | INX | H | Increment HL reg. to point next mem. Location. | |
| 4105 | MVI | A, 00H | Clear the acc. | |
| 4107 | MVI | C, 00H | Clear C reg for carry | |
| 4109 | L1 | ADD | M | Add multiplicand multiplier times. |
| 410A | JNC | NEXT | Jump to NEXT if there is no carry | |
| 410D | INR | C | Increment C reg | |
| 410E | NEXT | DCR | B | Decrement B reg |
| 410F | JNZ | L1 | Jump to L1 if B is not zero. | |
| 4112 | INX | H | Increment HL reg. to point next mem. Location. | |
| 4113 | MOV | M, A | Transfer the result from acc. to memory. | |
| 4114 | INX | H | Increment HL reg. to point next mem. Location. | |
| 4115 | MOV | M, C | Transfer the result from C reg. to memory. | |
| 4116 | HLT | Stop the program |
Observation:
- Input:
- Address
4200:02 - Address
4201:04
- Address
- Output:
- Address
4202:08 - Address
4203:00
- Address
Result: Thus the 8-bit multiplication was done in 8085 μp using repeated addition method and also the result is verified.
Flowchart:
+-------------------+
| START |
+---------+---------+
|
v
+-------------------+
| [HL] <- 4200H |
+---------+---------+
|
v
+-------------------+
| [B] <- [M] |
+---------+---------+
|
v
+-------------------+
| [HL] <- [HL] + 1 |
+---------+---------+
|
v
+-------------------+
| [A] <- 00H |
| [C] <- 00H |
+---------+---------+
|
v <------------------+
+-------------------+ |
| [A] <- [A] + [M] | |
+---------+---------+ |
| |
v |
/ \ |
/ Is \ |
/ there a \ |
< Carry? > |
\ / |
\ / |
\ / |
| |
+-----------+-----------+ |
| | |
YES NO |
| | |
v | |
+-------------------+ | |
| [C] <- [C] + 1 | | |
+---------+---------+ | |
| | |
+-----------+-----------+ |
| |
v |
+-------------------+ |
| [B] <- [B] - 1 | |
+---------+---------+ |
| |
v |
/ \ |
/ Is \ |
/ [B] = 0? \ |
< > |
\ Is zero? / -- NO --------+
\ /
\ /
| YES
v
+-------------------+
| [HL] <- [HL] + 1 |
+---------+---------+
|
v
+-------------------+
| [M] <- [A] |
+---------+---------+
|
v
+-------------------+
| [HL] <- [HL] + 1 |
+---------+---------+
|
v
+-------------------+
| [M] <- [C] |
+---------+---------+
|
v
+-------------------+
| STOP |
+-------------------+
Viva Questions:
- Define two’s complement of an 8-bit numbers.
- What is meant by instruction ADC M?
- What is the use of the instruction MOV A,M?
- What is the function of program counter?
- Mention the types of 8085 instruction set.
- How will you perform multiplication using ADD instruction?
- Describe about DAD B instruction.
- What is the purpose of the instruction MOV M,A?
For all 2026 published articles list: click here:
…till the next post, bye-bye & take care