Difference between revisions of "ADD"

From GbdevWiki
Jump to: navigation, search
(add a,reg8)
(add a,reg8)
Line 12: Line 12:
 
*$86: add a,(hl)
 
*$86: add a,(hl)
 
*$87: add a,a
 
*$87: add a,a
 +
 +
Returns:
 +
*Z - Set if result is zero.
 +
*N - Reset.
 +
*H - Set if carry from bit 3.
 +
*C - Set if carry from bit 7.

Revision as of 12:14, 25 February 2008

ADD is an assembly opcode.

add a,reg8

Adds the contents of an 8-bit register to the contents of accumulator and stores the result in accumulator.

  • $80: add a,b
  • $81: add a,c
  • $82: add a,d
  • $83: add a,e
  • $84: add a,h
  • $85: add a,l
  • $86: add a,(hl)
  • $87: add a,a

Returns:

  • Z - Set if result is zero.
  • N - Reset.
  • H - Set if carry from bit 3.
  • C - Set if carry from bit 7.