gb-emu-lib/CPU.cpp
/*
    OR n - 0xF6

    The logical OR operation is performed between the byte in n and the byte contained in the
    accumulator. The result is stored in the accumulator.

    8 Cycles

    Flags affected(znhc): z000
*/
OR n - 0xF6
The logical OR operation is performed between the byte in n and the byte contained in the
accumulator. The result is stored in the accumulator.

8 Cycles


OR n - 0xF6 The logical OR operation is performed between the byte in n and the byte contained in the accumulator . The result is stored in the accumulator . 8 Cycles
unsigned long CPU::ORn(const byte& opCode)
{
    byte n = ReadBytePC();
    SetHighByte(&m_AF, n | GetHighByte(m_AF));
    if (GetHighByte(m_AF) == 0x00)
    {
        SetFlag(ZeroFlag);
    }
    else
    {
        ClearFlag(ZeroFlag);
    }
    ClearFlag(SubtractFlag);
    ClearFlag(HalfCarryFlag);
    ClearFlag(CarryFlag);
    return 8;
}
unsigned long CPU :: ORn ( const byte & opCode ) { byte n = ReadBytePC ( ) ; SetHighByte ( & m_AF , n | GetHighByte ( m_AF ) ) ; if ( GetHighByte ( m_AF ) == 0x00 ) { SetFlag ( ZeroFlag ) ; } else { ClearFlag ( ZeroFlag ) ; } ClearFlag ( SubtractFlag ) ; ClearFlag ( HalfCarryFlag ) ; ClearFlag ( CarryFlag ) ; return 8 ; }
OR n - 0xF6
The logical OR operation is performed between the byte in n and the byte contained in the
accumulator.
OR n - 0xF6 The logical OR operation is performed between the byte in n and the byte contained in the accumulator .
// Affects Z and clears NHC