To MULTIPLY TWO 8-BIT NUMBERS WITHOUT CARRY MP 8085A we use repetitive addition, here we can not consider CARRY, Thus Output size is 8 bit.
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.
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.
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.
INPUT AND OUTPUT :
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.