gb-emu-lib/CPU.cpp
unsigned long CPU::POPrr(const byte& opCode)
{
    ushort* rr = GetUShortRegister(opCode >> 4, true);
    (*rr) = PopUShort();

    if (((opCode >> 4) & 0x03) == 0x03)
    {
        (*rr) &= 0xFFF0;
    }

    return 12;
}
/*
    POP rr
    11qq0001

    The top two bytes of the external memory stack are popped into register pair qq.
    The stack pointer holds the 16-bit address of the current top of the stack. This
    instruction first loads to the low order portion of rr. The SP is incremented and
    the contents of the corresponding adjacent memory ocation are loaded into the high
    order portion of rr. The SP is then incremented again. The operand rr identifies
    register pair BC, DE, HL, or AF.

    12 Cycles

    Flags affected(znhc): ----
*/


The top two bytes of the external memory stack are popped into register pair qq.
The stack pointer holds the 16-bit address of the current top of the stack. This
instruction first loads to the low order portion of rr. The SP is incremented and
the contents of the corresponding adjacent memory ocation are loaded into the high
order portion of rr. The SP is then incremented again.

12 Cycles


The top two bytes of the external memory stack are popped into register pair qq . The stack pointer holds the 16 - bit address of the current top of the stack . This instruction first loads to the low order portion of rr . The SP is incremented and the contents of the corresponding adjacent memory ocation are loaded into the high order portion of rr . The SP is then incremented again . 12 Cycles
unsigned long CPU::POPrr(const byte& opCode)
{
    ushort* rr = GetUShortRegister(opCode >> 4, true);
    (*rr) = PopUShort();
    if (((opCode >> 4) & 0x03) == 0x03)
    {
        (*rr) &= 0xFFF0;
    }
    return 12;
}
unsigned long CPU :: POPrr ( const byte & opCode ) { ushort * rr = GetUShortRegister ( opCode >> 4 , true ) ; ( * rr ) = PopUShort ( ) ; if ( ( ( opCode >> 4 ) & 0x03 ) == 0x03 ) { ( * rr ) &= 0xFFF0 ; } return 12 ; }
POP rr
11qq0001
POP rr 11qq0001