gb-emu-lib/CPU.cpp
unsigned long CPU::XOR_HL_(const byte& opCode)
{
    byte r = m_MMU->Read(m_HL);
    SetHighByte(&m_AF, r ^ GetHighByte(m_AF));

    // Affects Z and clears NHC
    if (GetHighByte(m_AF) == 0x00)
    {
        SetFlag(ZeroFlag);
    }
    else
    {
        ClearFlag(ZeroFlag);
    }

    ClearFlag(SubtractFlag);
    ClearFlag(HalfCarryFlag);
    ClearFlag(CarryFlag);

    return 8;
}
/*
    XOR (HL) - 0xAE

    The logical exclusive-OR operation is performed between the byte pointed to by the HL register
    and the byte contained in the accumulator. The result is stored in the accumulator.

    8 Cycles

    Flags affected(znhc): z000
*/
XOR (HL) - 0xAE
The logical exclusive-OR operation is performed between the byte pointed to by the HL register
and the byte contained in the accumulator. The result is stored in the accumulator.

8 Cycles


XOR ( HL ) - 0xAE The logical exclusive - OR operation is performed between the byte pointed to by the HL register and the byte contained in the accumulator . The result is stored in the accumulator . 8 Cycles
unsigned long CPU::XOR_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 :: XOR_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 ; }
XOR (HL) - 0xAE
The logical exclusive-OR operation is performed between the byte pointed to by the HL register
and the byte contained in the accumulator.
XOR ( HL ) - 0xAE The logical exclusive - OR operation is performed between the byte pointed to by the HL register and the byte contained in the accumulator .
// Affects Z and clears NHC