MICROPROCESSOR 8085A PROGRAM | WRITE 8085 ASSEMBLY LANGUAGE PROGRAM TO MULTIPLY TWO 8 BIT NUMBERS STORED IN MEMORY LOCATION AND STORE THE 16 BIT RESULT INTO THE MEMORY WITH CARRY.

5 Likes Comment

WRITE 8085 ASSEMBLY LANGUAGE PROGRAM TO MULTIPLY TWO 8 BIT NUMBERS STORED IN MEMORY LOCATION AND STORE THE 16 BIT RESULT INTO THE MEMORY WITH CARRY.

THEORY :  

   In 8085 microprocessor, there is no multiplication operation. To get the result of multiplication, we should use the repetitive addition method. It has dedicated arithmetic instruction for addition, subtraction, increment, and decrement. If we want to perform a multiplication operation then we need a program for doing the repeated addition.

ALGORITHM :

Step 1: LXI H,2000h, to load the address in H-L register pair using LXI H from 16-bit location 2000h.

Step 2: MOV B, M to move the value of 2000h memory address value into the register B.

Step 3: INX H, to increase the value of the H-L register pair to get the next memory location.

Step 4: MOV C, M to move the value of the 2001h memory location to register C.

Step 5: XRA A; to make sure and turn the value of the accumulator to zero by X-OR operation.

Step 6: XRA D; to make sure and turn the value of the D register to zero by X-OR operation.

Step 7: ADD B,  for we need to perform addition with the value of accumulator with the content of B register and store the result into the accumulator.

Step 8: JNC; to jump on no carry to the mentioned location at step 10.

Step 9: INR D; To increment the D register.

Step 10: DCR C, To decrement the value of the C register.

Step 11: JNZ to make a loop and back to step 6.

Step 12: INX H, done to the H-L pair of the register will be increased and pointed to store the addition result.

Step 13: MOV M, A; to store the value of the accumulator into a memory location in 2002h.

Step 14: INX H; to increment the HL register pair to store the value.

Step 15: MOV M, D; To store the value of multiplication value(carry value).

Step 16: HLT; to stop the program.

 IMPLEMENTATION :

LocationMnemonicsHex Code
3000 LXI H 21
30010000
30022020
3003MOV B, M46
3004INX H23
3005MOV C, M4E
3006XRA AAF
3007XRA DAA
3008ADD B80
3009JNCD2
300A0D0D
300B3030
300CINR D14
300DDCR C0D
300EJNZC2
300F0808
30103030
3011INX H23
3012MOV M, A77
3013INX H23
3014MOV M, D72
3015HLT76

INPUT AND OUTPUT :

LocationInput
2000FF
2001FF
LocationOutput
200201
2003FE

DISCUSSION :
In this program, We store the carry bit ( another 8-bit) that can be stored in 2002h memory location. In this example carry value is 01h. Inputed values are FFh and FFh respectively. According the input, output is generated. 

YOU MIGHT LIKE:

You might like

Saif

About the Author: Saif

Leave a Reply

Your email address will not be published. Required fields are marked *

Close Bitnami banner
Bitnami