z80:Opcodes:OR

From Learn @ Cemetech
Jump to: navigation, search

Or is an instruction that takes an 8-bit input an compare sit with the accumulator. It checks to see if anything is set, and if neither are set, it results in a zero.

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

Syntax

   OR op8

Allowed Instructions

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

Effects

C and N flags cleared, P/V detects parity, and rest are modified by definition.

Uses

Used in bit-masking. For more information see here.

T-States

r denotes 8-bit register.

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

See Also

AND,BIT,CCF,CPL,RES,SCF,SET,XOR