public void OnFetchWillReturnFetchedValue()
        {
            ushort absoluteAddress = 0x1944;

            cpu.AbsoluteAddress = absoluteAddress;

            byte fetchedValue         = 0x52;
            byte startingFetchedValue = 0xd1;

            cpu.Fetched = startingFetchedValue;

            A.CallTo(() => cpu.Read(absoluteAddress)).Returns(fetchedValue);

            var fetchResult = addressMode.Fetch();

            VerifyFetchResult(fetchResult, fetchedValue, startingFetchedValue);
        }
        protected AddressModeTests()
        {
            cpu = A.Fake <ICpu>();

            cpu.ProgramCounter = ProgramCounter;

            A.CallTo(() => cpu.Read(ProgramCounter)).Returns(ReadValue);
        }
示例#3
0
        protected byte ReadFromStack()
        {
            cpu.StackPointer++;

            return(cpu.Read((ushort)(0x0100 + cpu.StackPointer)));
        }