WRITE A 8085 ASSEMBLY LANGUAGE PROGRAM TO DIVIDE TWO 8-BIT NUMBERS USING 8085 MICROPROCESSOR AND PERFORM THE OPERATION BETWEEN PREDEFINED LOCATION. 3:2

 

THEORY :      In 8085 microprocessor, There is no division operation. To get the result of the division, we should use the repetitive subtraction method. By using this program, we will get the quotient and the reminder. Here we also can be store the carry value. Then store the value of that performed resultant value.

ALGORITHM :
Step 1: LXI H,2000h; to point source memory location, register pair H-L is initialized.Step 2: MOV A, M; to move the value of memory to the accumulator.Step 3: INX H; to increment the value by 1 for the H-L register pair.Step 4:  MOV B, M; to move the value of memory to the B register.Step 5: MVI C,00h; to load the value 00h in register C.Step 6: CMP B; to compare the value of the accumulator and the B register.Step 7: JC ; to jump on carry in step 11.Step 8: SUB B; to subtract the accumulator and B register value.Step 9: INR C; to increment the value of C register.Step 10: JMP; to jump on step 6 Step 11: INX H; to increment the value of H-L register pair.Step 12: MOV M, C; to store the value of C register into a memory location.Step 13: STA 2003h; to store the accumulator value into 2003h memory location.Step 14: HLT; to stop the program.

 IMPLEMENTATION :

LocationMnemonicsHex Code
3000LXI H 21
300100h00
30022020
3003MOV A, M7E
3004INX H23
3005MOV B, M46
3006MVI C,00H0E
30070000
3008CMP BBB
3009JCDA
300A1111
300B3030
300CSUB B90
300DINR C0C
300EJMPC3
300F0808
30103030
3011INX H23
3012MOV M, C71
3013STA 200332
30140303
30152020
3016HLT76

INPUT AND OUTPUT :

LocationInput
2000FF
200102
LocationOutput
20027F
200301

DISCUSSION :
In this program, We tried to solve the division problem, where we took a kind of value and that's resultant value will give a carry value. Firstly, we've taken the location where the value is stored with LXI H and moves the value to the accumulator. Then we've incremented the value of H-L pair to take the next of B register.Then we send 00h value to store carry value in C register. Then we compare the value between Accumulator and B register. Then in comparison, we got a high value of carry flag, and store in C register.Then subtract the value of the accumulator and B register, and store it into a memory location. Then Stop the program.

Comments

Popular posts from this blog

IMPORTANT INTERVIEW RELATED QUESTION

INTERVIEW QUS ON AUTOMATA

Survey Paper

C++ Interview Questions

Git Cheat Sheet: A Beginner to Intermediate Guide

Laravel Session

Java Interview Questions

OPERATION RESEARCH SYLLABUS