예제 #1
0
        public void SetRegisterValue(Register16Bit register, ushort value)
        {
            switch (register)
            {
            case Register16Bit.SP: SP = value; break;

            case Register16Bit.PC: PC = value; break;

            case Register16Bit.AF: AF = value; break;

            case Register16Bit.BC: BC = value; break;

            case Register16Bit.DE: DE = value; break;

            case Register16Bit.HL: HL = value; break;

            default: throw new ArgumentException("16-bit register does not exist: " + register.ToString());
            }
        }
예제 #2
0
        public ushort GetRegisterValue(Register16Bit register)
        {
            switch (register)
            {
            case Register16Bit.SP: return(SP);

            case Register16Bit.PC: return(PC);

            case Register16Bit.AF: return(AF);

            case Register16Bit.BC: return(BC);

            case Register16Bit.DE: return(DE);

            case Register16Bit.HL: return(HL);

            default: throw new ArgumentException("16-bit register does not exist: " + register.ToString());
            }
        }