- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
8085 Block movement with overlap
In this program, we will see how to move blocks of data from one place to another.
Write 8085 Assembly language program to move a data block. The blocks are assumed to be overlapping. The block size is given, the block is starting from Xand we have to move it to the location Y.
The overlapping block movement is tricky; we need to use some special tricks to move a block in overlapping address locations. Here the block is starting at position X, we have to move it to position Y. The location Y is inside the block. So Y < X + block size.
In this program, the data are stored at location 8010H, and we will place it 8014H. The block size is stored at location 8000H.
To move a block into some overlapping locations, we will start from the end element of the block. So at first the last element of the block is moved, then the previous bytes are moved.
|F000||21, 00, 80||LXI H, 8000H||Load the location to find block size|
|F003||4E||MOV C, M||store block size into C register|
|F004||06, 00||MVI B,00H||clear B register|
|F006||21,10, 80||LXI H,8010H||load the source address to HL pair|
|F009||11, 14, 80||LXI D, 8014H||load the destination address to DE pair|
|F00C||09||DAD B||Add BC with HL to point next location of the end of the source block|
|F00D||2B||DCX H||Point last element|
|F00E||EB||XCHG||Swap DE and HL pair content|
|F00F||09||DAD B||Add BC with HL to point next location of the end of dest block|
|F010||2B||DCX H||Point last element|
|F011||EB||XCH G||Swap DE and HL pair content|
|F012||7E||LOOP||MOV A, M||Load Acc with the memory element|
|F013||12||STAX D||Store acc content to the memory pointed by D|
|F014||1B||DCX D||Decrease DE register pair|
|F015||2B||DCX H||Decrease HL register pair|
|F016||0D||DCR C||Decrease C register|
|F017||C2, 12, F0||JNZ LOOP||Jump to Loop|
|F01A||76||HLT||Terminate the program|
- 8085 Block movement without overlap
- Block movement without overlap in Z-80
- Overlap Elements with CSS
- 8085 program to transfer a block in reverse order
- 8085 program to exchange a block of bytes in memory
- Rectangle Overlap in Python
- Create block level button with Bootstrap
- Working with Display Block in CSS
- Display Inline-Block Working with CSS
- Create a block level button with Bootstrap
- Create a block element with Bootstrap 4
- How to perform mouse movement to an element in Selenium with python?
- Interfacing ADC with 8085 Microprocessor
- Find if two rectangles overlap using C++.
- Block-level Elements and Block Boxes in CSS