programa18.doc
TRANSCRIPT
Microprocessor 8085 Appendix A Explanation : Consider that a block of data of N bytes is present at source location. Now this block of N bytes is tobe moved from source location to a destination location. Let the number of bytes N = 10. We will have to initialize this as count in the C reister. We know that source address is in the !L reister and destination address is in the "# reister. $et the byte from source memory block and store the byte in the destination memory block. %ransfer data byte by byte from source to destination block till all the bytes are transferred. Algorithm :Step I : &nitialize the reister C with count.Step II: &nitialize !L and "# with source and destination address.Step III: $et the byte from source memory block.Step IV:%ransfer the data to destination block.Step V : &ncrement source memory pointerStep VI:&ncrement destination memory pointer.Step VII: "ecrement Count.Step VIII: Check for count in C' if not zero oto step &&& Step IX: (top. Flowchart : )efer flowchart *0. Program :Instruction CommentMVIC, 0AH; Initialize counterLXIH, D000H; Initialize source ; memory pointerLXID, E000H; Initialize destination ; memory pointerBAC! M"VA, M; #et $yte %rom source ; memory $loc&'(AXD; 'tore $yte in t)e ; destination ;memory $loc&I*XH; Increment source ; memory pointerI*XD; Increment destination ; memory pointerDC+C; Decrement counter ,*-BAC; I% counter . 0 repeatFlowchart 20HL( ; (erminate pro/ram e0ecution