예제 #1
0
        //Read from memory into an 8 bit register

        public bool Read(Register8 register, ushort location)
        {
            if (location > 0xffff)
            {
                //Sets the overflow flag on the status register
                statusRegister.SetOverflow();
                return(false);
            }

            register.Set(memory[location]);
            return(true);
        }
예제 #2
0
 //Function for the Stack Pointer to read from memory
 //Probably not needed as reads from stack are fine
 //with normal Read, but here for symmetry
 public bool StackRead(Register8 register, ushort location)
 {
     register.Set(memory[location]);
     return(true);
 }