Statement: Write an 8085 assembly language program to delete a string of 4 characters from the tenth location in the given array of 50 characters.
| Solution: Shift bytes from location 14 till the end of array upwards by 4 characters i.e. from location 10 onwards. Source program : - LXI H, 2l0DH :Initialize source memory pointer at the 14thlocation of the array.
- LXI D, 2l09H : Initialize destination memory pointer at the 10th location of the array.
- MOV A, M : Get the character
- STAX D : Store character at new location
- INX D : Increment destination pointer
- INX H : Increment source pointer
- MOV A, L : [check whether desired
- CPI 32H bytes are shifted or not]
- JNZ REPE : if not repeat the process
- HLT : stop
|
Related Programs for Beginners: (Click down)
Calculate the sum of series of odd numbers
Find the square of given number
Multiply two 8-bit numbers
Find the largest of given numbers