Problem – Write a program to move blocks of bits from source location starting at 2500 to destination location starting from 2600 where size of blocks is 05 bytes.
Example –

Algorithm –
- Load register pair H-L with the address 2500H
- Load register pair D-E with the address 2600H
- Move the content at memory location into accumulator
- Store the content of accumulator into memory pointed by D-E
- Increment value of register pair H-L and D-E by 1
- Decrements value of register C by 1
- If zero flag not equal to 1, go to step 3
- Stop
Program –
| Memory | Mnemonics | Operands | Comment |
|---|---|---|---|
| 2000 | MVI | C, 05 | [C] <- 05 |
| 2002 | LXI | H, 2500 | [H-L] <- 2500 |
| 2005 | LXI | D, 2600 | [D-E] <- 2600 |
| 2008 | MOV | A, M | [A] <- [[H-L]] |
| 2009 | STAX | D | [A] -> [[D-E]] |
| 200A | INX | H | [H-L] <- [H-L] + 1 |
| 200B | INX | D | [D-E] <- [D-E] + 1 |
| 200C | DCR | C | [C] <- [C] – 1 |
| 200D | JNZ | 2008 | Jump if not zero to 2008 |
| 2010 | HLT | Stop |
Explanation – Registers A, D, E, H, L, C are used for general purpose:
- MOV is used to transfer the data from memory to accumulator (1 Byte)
- LXI is used to load register pair immediately using 16-bit address (3 Byte instruction)
- MVI is used to move data immediately into any of registers (2 Byte)
- STAX is used to store accumulator into register pair indirectly (3 Byte instruction)
- DCR is used to decrease register by 1 (1 Byte instruction)
- INX is used to increase register pair by 1 (1 Byte instruction)
- JNZ is used to jump if not zero to given memory location (3 Byte instruction)
- HLT is used to halt the program
Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.
Recommended Posts:
- 8085 program for Linear search | Set 2
- 8085 program to convert a BCD number to binary
- 8085 program to find the element that appears once
- 8085 program to find maximum and minimum of 10 numbers
- 8085 program to search a number in an array of n numbers
- 8085 program to find maximum of two 8 bit numbers
- 8085 program to add two 8 bit numbers
- 8085 program to multiply two 8 bit numbers
- 8085 program to convert an 8 bit number into Grey number
- 8085 program to find the factorial of a number
- 8085 program to count the number of ones in contents of register B
- 8085 program to add two 16 bit numbers
- 8085 program to exchange a block of bytes in memory
- 8085 program to find square root of a number
- 8085 program to find 1's and 2's complement of 8-bit number
- 8085 program to convert 8 bit BCD number into ASCII Code
- 8085 program to find 1’s and 2’s complement of 16-bit number
- 8085 program to swap two 8-bit numbers
- 8085 program to add three 16 bit numbers stored in registers
- 8085 program to access and exchange the content of Flag register with register B
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

