From Learn @ Cemetech
Revision as of 18:29, 5 February 2016 by Maintenance script (talk | contribs) (Initial automated import)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

AND is an instruction that takes an 8-bit input an compares it with the accumulator. It checks to see if both are set. If either one is reset, the resulting bit in the accumulator is zero.

0 and 0 result: 0
0 and 1 result: 0
1 and 0 result: 0
1 and 1 result: 1


   AND op8

Allowed Instructions

   and a
   and b
   and c
   and d
   and e
   and h
   and l
   and ixh
   and ixl
   and iyh
   and iyl
   and (hl)
   and (ix+n)
   and (iy+n)
   and n		;8 bit constant


C and N flags cleared, P/V is parity, rest are altered by definition.


The most important use of AND is in bit-masking. For more information on bit-masking, see here.


r denotes 8-bit register.

r 4
X 7
(hl) 7
(ix+X) 19
(iy+X) 19

See Also