- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Instruction type XCHG in 8085 Microprocessor
In 8085 Instruction set, there is one mnemonic XCHG, which stands for eXCHanGe. This is an instruction to exchange contents of HL register pair with DE register pair. This instruction uses implied addressing mode. As it is1-Byte instruction, so It occupies only 1-Byte in the memory. After execution of this instruction, the content between H and D registers and L and E registers will get swapped respectively.
Mnemonics, Operand | Opcode(in HEX) | Bytes |
---|---|---|
XCHG | EB | 1 |
Let us suppose, HL and DE register pairs are having ABCDH and 6789H contents respectively. After execution of instruction XCHG the contents of HL and DS register pairs will be 6789H and ABCDH respectively. Here is the content training table for the better understanding.
Before | After | |
---|---|---|
(HL) | ABCDH | 6789H |
(DE) | 6789H | ABCDH |
Address | Hex Codes | Mnemonic | Comment |
---|---|---|---|
2006 | EB | XCHG | Swapping the contents of DE and HL register pairs |
Let us see the timing diagram of this instruction XCHG as below −

Summary − So this instruction XCHG requires 1-Byte, 4-Machine Cycles (Opcode Fetch) and 4 T-States for execution as shown in the timing diagram.
- Related Articles
- Instruction type CMC in 8085 Microprocessor
- Instruction type STC in 8085 Microprocessor
- Instruction type RLC in 8085 Microprocessor
- Instruction type RAL in 8085 Microprocessor
- Instruction type RRC in 8085 Microprocessor
- Instruction type RAR in 8085 Microprocessor
- Instruction type SPHL in 8085 Microprocessor
- Instruction type XTHL in 8085 Microprocessor
- Instruction type NOP in 8085 Microprocessor
- Instruction type LDA a16 in 8085 Microprocessor
- Instruction type STA a16 in 8085 Microprocessor
- Instruction type LDAX rp in 8085 Microprocessor
- Instruction type STAX rp in 8085 Microprocessor
- Instruction type LHLD a16 in 8085 Microprocessor
- Instruction type SHLD a16 in 8085 Microprocessor
