MULTIPLY

 

In 8085 mp there is no multiplication operation. To MULTIPLY TWO 8 BIT NUMBERS STORED IN MEMORY LOCATION we use repetative addition operation

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
Implementation of Program

INPUT AND OUTPUT :

LocationInput
2000FF
2001FF
Input
LocationOutput
200201
2003FE
Output with carry

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:

https://www.shoutcoders.com/copy-data-from-one-16-bit-location-to-another-mp-8085a/?preview_id=1736&preview_nonce=f3e899d4c4&preview=true&_thumbnail_id=1865
Copy data from one location to another

FAQ:

Which of the following is a 2nd generation of compute?

A - Vaccume tube

B - Microprocessor

C - Intigrated circuit (IC)

D - Transistor

ANS: D

EXPLANATION:

1 First Generation The period of the first generation: 1946-1959. Vacuum tube-based.

2 Second Generation The period of the second generation: 1959-1965. Transistor-based.

3 Third Generation The period of the third generation: 1965-1971. Integrated Circuit based.

4 Fourth Generation The period of fourth-generation: 1971-1980. VLSI microprocessor-based.

5 Fifth Generation The period of fifth-generation: 1980-onwards. ULSI microprocessor-based.

What is the first microprocessor invented?

Ans: Intel 4004 in 1971.

Comments

Popular posts from this blog

MEMORY MANAGEMENT NOTE

MULTIPLY WITHOUT CARRY

SUBTRACTION