ADDΒΆ
- ADD M,N
- Add
- Description
- Adds
M
andN
and stores the result inM
.M += N
- Results
Register/Flag 8-bit 16-bit (non-ADL) 24-bit (ADL) M
Set to the result of M + N
S
flagSet if the result is negative; else reset Not affected Z
flagSet if the result is 0; else reset Not affected H
flagSet if carry from bit 3; else reset Set if carry from bit 11; else reset P/V
flagSet if overflow; else reset Not affected N
flagReset C
flagSet if carry from bit 7; else reset Set if carry from bit 15; else reset Set if carry from bit 23; else reset - Allowed Instructions
Instruction Opcode CC (ADL/non-ADL) CC (.S) CC (.L) add a,a $87 1F X X add a,b $80 1F X X add a,c $81 1F X X add a,d $82 1F X X add a,e $83 1F X X add a,h $84 1F X X add a,l $85 1F X X add a,ixh $DD, $84 2F X X add a,ixl $DD, $85 2F X X add a,iyh $FD, $84 2F X X add a,iyl $FD, $85 2F X X add a,(hl) $86 1F + 1R 2F + 1R 2F + 1R add a,(ix+n) $DD, $86, n 3F + 1R 4F + 1R 4F + 1R add a,(iy+n) $FD, $86, n 3F + 1R 4F + 1R 4F + 1R add a,n $C6, n 2F X X add hl,bc $0A 1F 2F 2F add hl,de $1A 1F 2F 2F add hl,hl $2A 1F 2F 2F add hl,sp $3A 1F 2F 2F add ix,bc $DD, $0A 2F 3F 2F add ix,de $DD, $1A 2F 3F 3F add ix,ix $DD, $2A 2F 3F 3F add ix,sp $DD, $3A 2F 3F 3F add iy,bc $FD, $0A 2F 3F 3F add iy,de $FD, $1A 2F 3F 3F add iy,iy $FD, $2A 2F 3F 3F add iy,sp $FD, $3A 2F 3F 3F - Notes
- Unlike ADC, this instruction does support using the index registers IX and IY as the first operand. This is the only difference in the allowed instructions between the two.
- This instruction does not modify the
S
,Z
, andP/V
flags when doing 16-bit and 24-bit addition. For that, you can use ADC. - Like most instructions, HL, IX, and IY are mutually exclusive. I.e. they cannot be used in the same instructions.
- See Also
- ADC, SBC, SUB