The LXI instruction
The LXI (Load Extended Immediate) instruction is used to directly load a 16-bit value (constant) into the specified register pair of the Intel 8085 processor.
The LXI instruction format
| Instruction | Description |
|---|---|
| LXI RP, data16 | This format is used to load a 16-bit immediate value into a register pair. Available pairs: BC, DE, HL, SP. When the LXI instruction executes, the 16-bit immediate value is loaded into the selected register pair. The low-order byte is loaded into the low-order register of the pair, and the high-order byte into the high-order register. |
Usage example
; Author: Evgeny Sergeevich Dovgopolov data: db 00h main: mvi b, 30h ; Load the value 30h into register B lxi h, data ; Load the address of the variable data into the HL register pair mov m, b ; Copy the value of register B into memory (data) pointed to by HL mov c, m ; Copy the value from memory (data) into register C hlt ; Stop program execution
Example taken from the textbook "HANDYFAR - MASM (Evgeny Sergeevich Dovgopolov)".
Processor status flags
S
NoZ
NoAC
NoP
NoCY
No