예제 #1
0
 private void CheckEaContentsMemory(
     CpuInstruction instruction, UInt16 regValue, UInt16 eaContents, UInt16 address,
     UInt16 expected, String message)
 {
     ExecuteEaContentsInstruction(instruction, regValue, eaContents);
     MemoryTest.Check(m_memory, address, expected, message);
 }
예제 #2
0
        public void CallSubroutine()
        {
            SP.Value = SpValue;
            ExecuteEaContentsInstruction(CpuInstruction.CallSubroutine, DontCareUInt16, DontCareUInt16);

            CpuRegisterTest.Check(
                SP, SpValueMinusOne, "SP の値が 1 減る");
            MemoryTest.Check(
                m_memory, SpValueMinusOne, NextAddressPlusOne,   "SP の指すアドレスに PR の値を書き込む");
            CpuRegisterTest.Check(
                PR, EffectiveAddress, "PR に実効アドレスの値が設定される");
        }
예제 #3
0
        public void Push()
        {
            SP.Value = SpValue;

            ExecuteEaContentsInstruction(CpuInstruction.Push, DontCareUInt16, DontCareUInt16);

            CpuRegisterTest.Check(
                SP, SpValueMinusOne, "SP の値が 1 減る");
            MemoryTest.Check(
                m_memory, SpValueMinusOne, EffectiveAddress,
                "SP の指すアドレスに実効アドレスの値を書き込む");
        }
예제 #4
0
        public void CallSubroutine()
        {
            const UInt16 PrValue  = 0x1357;
            const UInt16 OprValue = 0x9bdf;

            SP.Value = SpValue;
            PR.Value = PrValue;

            Operate(Operator.CallSubroutine, DontCareUInt16, OprValue);

            CpuRegisterTest.Check(SP, SpValueMinusOne, "SP の値が 1 減る");
            MemoryTest.Check(m_memory, SpValueMinusOne, PrValue, "(SP - 1) に PR の値が書き込まれる");
            CpuRegisterTest.Check(PR, OprValue, "PR にオペランドの値が設定される");
        }
예제 #5
0
 private void CheckMemory(UInt16 address, UInt16 expected, String message)
 {
     MemoryTest.Check(m_memory, address, expected, message);
 }