## Experiment-6: 8085 ALP to multiply two 8-bit numbers

### 6.1 Write a program to perform Multiplication of two 8 bit numbers.

#### Objective:

1. To understand the multiplication using repeated addition
2. To develop flowchart for multiplication using addition process
3. To develop 8085 assembly program for multiplication of two 8-bit numbers
4. To analyse and debug the assembly program

#### Algorithm

1. Load multiplicand in one register say Register B
2. Load multiplier in register C
3. Clear accumulator
4. Add accumulator and register B
5. decrement count (multiplier value)
6. go to step-4 and repeat if count not zero
7. stop

Program for multiplying two 8-bit numbers

 Addr Opcode Operands Label mnemonic Remarks 4200 C3 06 042 jmp start ;data 4203 multiplicand: db 12 4204 08 (1 bytes) multiplier: db 8 4205 <1 bytes> product: ds 1 ;code 4206 00 start: nop 4207 3A 03 042 LDA multiplicand 420A 47 MOV B, A Save multiplicand in B 420B 3A 04 042 LDA multiplier 420E 4F MOV C, A ; save multiplier in C 420F AF XRA A ; clear Acc 4210 00 again: nop 4211 80 ADD B ; A= A+B 4212 0D DCR C ;decrement count/multiplier 4213 C2 10 42 JNZ again ; repeat if not zero 4216 32 05 042 STA product ; save product 4219 76 hlt

Output: ### Example-6.2: Write the multiplication table of a number

Aim : to develop assembly program for 8085 microprocessor to find multiplication table of a number

#### Objective

1. To understand the multiplication using repeated addition
2. To develop flowchart for multiplication using addition process
3. To develop 8085 assembly program for multiplication of two 8-bit numbers
4. To analyse and debug the assembly program

Steps in writing the program:

1. Load a number in Accumulator

2. Make a copy in register B

3. Set count to 9 in register C

4. Set the HL pair to Point to Y

5. save Acc (1st data) in Y at index(0)

6. increment pointer to point to next position in Y

8. save Acc at address in HL

9. decrement countable

10. go to step ‘7’ if count not zero

11. stop

Program for generating multiplication table of a number

 Address OP-CODE AND OPERANDS Label Mnemonic Comments 4203 4 X: DB 4 4204 – 420D Y: DS 10 ; storage for multiplication table 420E 00 START: nop 420F 3A,03,42 LDA X Load accumulator with numble whose multiplication table is to be found 4212 47 MOV B,A ;copy in register B 4213 21,04,42 LXI H, Y ; set memory pointer 4216 77 MOV M, A ; copy the muber at index(0) 4217 0E, 9 MVI C, 9 ; set count 4219 80 NEXT: ADD B ; add number 421A 23 INX H 421B 77 MOV M, A ; save product at next location 421C 0D DCR C ; decrement count 421D C2,19.42 JNZ NEXT ; if not zero go to next 4220 76 HLT RESULT

OUTPUT: error: Content is protected !!