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

5 Likes Comment

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

THEORY : 

In 8085 microprocessor, there is no multiplication operation. To get the result of multiplication, we should use the repetitive addition method. After multiplying (repetitive addition) two 8bit numbers are store in the next memory location. We are saving the data at location 2000h and 2001h. The resultant value will be stored at the location in 2002h.

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: 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 7: DCR C, To decrement the value of the C register.

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

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

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

Step 11: HLT; to stop the program.

 IMPLEMENTATION :

LocationMnemonicsHex Code
3000 LXI H 21
30010000
30022020
3003MOV B,M46
3004INX H23
3005MOV C,M4E
3006XRA AAF
3007ADD B80
3008DCR C0D
3009JNZC2
300A0707
300B3030
300CINX H23
300DMOV M,A77
300EHLT76

INPUT AND OUTPUT :

LocationInput
200004
200102
LocationOutput
200208

DISCUSSION :
In this program, we perform multiplication by taking inputs from the user. In this case, 04h is stored at memory location 2000h and 02h at location 2001h. The drawback is that it cannot store carry value. If the result is in 18 bit with carry then it cannot store that value.

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