Download - programa4.doc

Transcript

Microprocessor 8085 Appendix A Explanation : Wearegiventwonumbers at memorylocationsD000HandD001H. Let thesenumbers be50 H and 20 H. We have to subtract the byte at memory location D000 H (50 H) with the byte at memory locationD000 H (20 H). nitially we will store the !irst number in the accumulator. "sing#"$instructionsubtract the twocontents. %esult o! subtractionwill bestoredinthe& register. #tore the result at memory location D002 H.'or e(am)le * D000 H+ 50 H 50 HD001 H+ 20 H , 20 H-0 H Algorithm :Step I : #tartStep II : .et the !irst number in & register.Step III : .et the second number in memory.Step IV : #ubtract the two numbers.Step V : #tore the result at memory location D002 H.Step VI : #to) Flowchart : %e!er !lowchart 5. Program :InstructionCommentLXIH, D000 H ; L points to the memory location ; D000 HMOVA, M ; Get the contents of location ; D000 H into the accumulator.IXH ; Increment HL to point to ne!t memory; location i.e. D00"H#$% M ; A & A ' M i.e. compute the su(tractionIX H ; Increment HL to point to ne!t memory ; location i.e. D00)HMOVM, A ; #tore the result at memory location ; D00) HHL* Flowchart 5


Top Related