MULTIPLY WITHOUT CARRY

 

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 Maths, Large Number multiplication shortcut trick
In Maths, Large Number multiplication shortcut trick

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.

In Maths, Closure, Commutative, Associative, Distributive are the properties. Multiplication and Division Set Belongs to Which Property shown here.
In Maths, Closure, Commutative, Associative, Distributive are the properties. Multiplication and Division Set Belongs to Which Property shown here.

 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
Code of this program

INPUT AND OUTPUT :

LocationInput
200004
200102
Input
LocationOutput
200208
Output
8085A MP CHIPSET
8085A MP CHIPSET

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:

https://www.shoutcoders.com/copy-data-from-one-16-bit-location-to-another-mp-8085a/
Data Copy From one location to another program

Comments

Popular posts from this blog

MEMORY MANAGEMENT NOTE

SUBTRACTION