コード例 #1
0
        protected override CpuState GetInstructionPart(MachineCycleNames machineCycle)
        {
            if (!ExecutionEngine.Opcode.Definition.HasParameters)
            {
                throw Errors.NoParameters();
            }

            switch (machineCycle)
            {
            case MachineCycleNames.M2:
                InstructionM2 = new ReadT3InstructionPart(Die, machineCycle);
                return(InstructionM2);

            case MachineCycleNames.M3:
                if (ExecutionEngine.Opcode.Definition.ParameterCount <= 1)
                {
                    throw Errors.InvalidMachineCycle(machineCycle);
                }

                InstructionM3 = new ReadT3InstructionPart(Die, machineCycle);
                return(InstructionM3);

            default:
                throw Errors.InvalidMachineCycle(machineCycle);
            }
        }
コード例 #2
0
        protected override CpuState GetInstructionPart(MachineCycleNames machineCycle)
        {
            switch (machineCycle)
            {
            case MachineCycleNames.M2:
                // read d
                _instructionM2 = new ReadT3InstructionPart(Cpu, machineCycle);
                return(_instructionM2);

            case MachineCycleNames.M3:
                // we postpone inc/dec operation until M4
                return(new AutoCompleteInstructionPart(Cpu, machineCycle));

            case MachineCycleNames.M4:
                _instructionM4 = new ReadT3InstructionPart(Cpu, machineCycle, GetAddress());
                return(_instructionM4);

            case MachineCycleNames.M5:
                _instructionM5      = new WriteT3InstructionPart(Cpu, machineCycle, GetAddress());
                _instructionM5.Data = IncDecValue(_instructionM4.Data);
                return(_instructionM5);

            default:
                throw Errors.InvalidMachineCycle(machineCycle);
            }
        }
コード例 #3
0
ファイル: PopInstruction.cs プロジェクト: DualBrain/Zim80
        protected override CpuState GetInstructionPart(MachineCycleNames machineCycle)
        {
            switch (machineCycle)
            {
            case MachineCycleNames.M2:
                _instructionM2 = new ReadT3InstructionPart(Die, machineCycle, Registers.SP);
                return(_instructionM2);

            case MachineCycleNames.M3:
                _instructionM3 = new ReadT3InstructionPart(Die, machineCycle, Registers.SP);
                return(_instructionM3);

            default:
                throw Errors.InvalidMachineCycle(machineCycle);
            }
        }
コード例 #4
0
 private CpuState CreateReadDataPart(MachineCycleNames machineCycle)
 {
     _readPart = new ReadT3InstructionPart(Cpu, machineCycle, Registers.HL);
     return(_readPart);
 }
コード例 #5
0
 private CpuState CreateReadIndirectValueInstructionPart(MachineCycleNames machineCycle)
 {
     _instructionPart = new ReadT3InstructionPart(Cpu, machineCycle, GetAddress());
     return(_instructionPart);
 }