Statement:Write
an 8085 assembly language program to insert a string of four characters
from the tenth location in the given array of 50 characters.
Solution: Step 1: Move bytes from location 10 till the end of array by four bytes downwards. Step 2: Insert four bytes at locations 10, 11, 12 and 13. Source program :
LXI H, 2l31H: Initialize pointer at the last location of array.
LXI D, 2l35H: Initialize another pointer to point the last location of array after insertion.
AGAIN: MOV A, M : Get the character
STAX D : Store at the new location
DCX D : Decrement destination pointer
DCX H : Decrement source pointer
MOV A, L : [check whether desired
CPI 05H bytes are shifted or not]
JNZ AGAIN : if not repeat the process
INX H : adjust the memory pointer
LXI D, 2200H : Initialize the memory pointer to point the string to be inserted
This Page is a little effort to make you Sharing of some own materials .This is just a Kick-Start to make the aware of Practical World !!! Best of luck.-DHRUVANG SUTHAR
0 Comments