gb-emu-lib/CPU.cpp
unsigned long CPU::XORn(const byte& opCode)
{
    byte n = ReadBytePC();
    SetHighByte(&m_AF, n ^ 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 n - 0xEE

    The logical exclusive-OR operation is performed between the 8-bit operand and
    the byte contained in the accumulator. The result is stored in the accumulator.

    8 Cycles

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

8 Cycles


XOR n - 0xEE The logical exclusive - OR operation is performed between the 8 - bit operand and the byte contained in the accumulator . The result is stored in the accumulator . 8 Cycles
unsigned long CPU::XORn(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 :: XORn ( 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 ; }
XOR n - 0xEE
The logical exclusive-OR operation is performed between the 8-bit operand and
the byte contained in the accumulator.
XOR n - 0xEE The logical exclusive - OR operation is performed between the 8 - bit operand and the byte contained in the accumulator .
// Affects Z and clears NHC