The DAD instruction
The DAD (double addition) instruction is used for 16-bit addition operations. It adds the contents of the specified 16-bit register pair to the contents of the HL register pair.
The DAD instruction format
| Instruction | Description |
|---|---|
| DAD B | Adds the 16-bit value stored in the BC register pair to the 16-bit value stored in the HL register pair. |
| DAD D | Adds the 16-bit value stored in the DE register pair to the 16-bit value stored in the HL register pair. |
| DAD H | Adds the 16-bit value stored in the HL register pair to itself (multiplies the value in HL by 2). |
| DAD SP | Adds the 16-bit value stored in the stack pointer (SP) to the 16-bit value stored in the HL register pair. |
Usage example
; Author: Evgeny Sergeevich Dovgopolov main: lxi b, 2020h ; Load the value 2020h into the BC register pair lxi h, 1010h ; Load the value 1010h into the HL register pair dad b ; Add the contents of the BC register pair to the contents of the HL register pair hlt ; Stop program execution
Example taken from the textbook "HANDYFAR - MASM (Evgeny Sergeevich Dovgopolov)".
Processor status flags
S
NoZ
NoAC
NoP
NoCY
Yes