Mnemonics

ADD

8-bit Arithmetic Group | 16-Bit Arithmetic Group
Expansion:
ADDition
Usage:
add [r,|rr,]{r|rr}

The ADD operation

Adds two numbers together in a register that supports the add function. The registers that support this are A (8-bit accumulator), HL (16-bit accumulator), IX and IY which have been tied into some of the arithmetic functionality. Note: SP was specifically exluded due to the nature of the register and how it would be used.

A immediate value can be used with register A as well as an 8-bit register including register A itself. All other registers as mentioned above that support the ADD mnemonic require a 16-bit register pair to hold the value to use.

Z80.CPU instructions
Instruction Description Opcode
ADD A, A | ADD A ADD A to the value in register A 87
ADD A, B | ADD B ADD B to the value in register A 80
ADD A, C | ADD C ADD C to the value in register A 81
ADD A, D | ADD D ADD D to the value in register A 82
ADD A, E | ADD E ADD E to the value in register A 83
ADD A, H | ADD H ADD H to the value in register A 84
ADD A, L | ADD L ADD L to the value in register A 85
ADD A, ?? (no short hand) ADD ?? number to the value in register A C6 {??}
ADD HL, HL Add 16-bit register pair HL 29
ADD HL, BC Add 16-bit register pair BC 09
ADD HL, DE Add 16-bit register pair DE 19
ADD HL, SP Add 16-bit register pair SP 39
ADD IX, IX Add 16-bit register pair IX DD29
ADD IX, BC Add 16-bit register pair BC DD09
ADD IX, DE Add 16-bit register pair DE DD19
ADD IX, SP Add 16-bit register pair SP DD39
ADD IY, IY Add 16-bit register pair IY FD29
ADD IY, BC Add 16-bit register pair BC FD09
ADD IY, DE Add 16-bit register pair DE FD19
ADD IY, SP Add 16-bit register pair SP FD39
ADD A, (HL) Add 16-bit value at location in memory of HL 86
ADD (IX + ±??) Add 8-bit number displacement to IX DD86 ??
ADD (IY + ±??) Add 8-bit number displacement to IY FD86 ??

Example

; Example ld a, 2 ; load the value 2 into register A ld b, 3 ; load the value 3 into register B add a, b ; add the contents of register B to register A ; register A will contain 5

See also