gb-emu-lib/CPU.cpp
/*
    OR (HL) - 0xB6

    The logical OR operation is performed between the value at memory location (HL)
    and the byte contained in the accumulator. The result is stored in the accumulator.

    8 Cycles

    Flags affected(znhc): z000
*/
OR (HL) - 0xB6
The logical OR operation is performed between the value at memory location (HL)
and the byte contained in the accumulator. The result is stored in the accumulator.

8 Cycles


OR ( HL ) - 0xB6 The logical OR operation is performed between the value at memory location ( HL ) and the byte contained in the accumulator . The result is stored in the accumulator . 8 Cycles
unsigned long CPU::OR_HL_(const byte& opCode)
{
    byte r = m_MMU->Read(m_HL);
    SetHighByte(&m_AF, r | GetHighByte(m_AF));
    if (GetHighByte(m_AF) == 0x00)
    {
        SetFlag(ZeroFlag);
    }
    else
    {
        ClearFlag(ZeroFlag);
    }
    ClearFlag(SubtractFlag);
    ClearFlag(HalfCarryFlag);
    ClearFlag(CarryFlag);
    return 8;
}
unsigned long CPU :: OR_HL_ ( const byte & opCode ) { byte r = m_MMU -> Read ( m_HL ) ; SetHighByte ( & m_AF , r | GetHighByte ( m_AF ) ) ; if ( GetHighByte ( m_AF ) == 0x00 ) { SetFlag ( ZeroFlag ) ; } else { ClearFlag ( ZeroFlag ) ; } ClearFlag ( SubtractFlag ) ; ClearFlag ( HalfCarryFlag ) ; ClearFlag ( CarryFlag ) ; return 8 ; }
OR (HL) - 0xB6
The logical OR operation is performed between the value at memory location (HL)
and the byte contained in the accumulator.
OR ( HL ) - 0xB6 The logical OR operation is performed between the value at memory location ( HL ) and the byte contained in the accumulator .
// Affects Z and clears NHC