Exemple #1
0
        public int GetCurrentInstructionLength()
        {
            var fetcher     = new Fetcher8086(_cpu);
            var instruction = OpCodeManager.Decode(fetcher);

            return(fetcher.GetBytesFetched());
        }
Exemple #2
0
        public int ProcessSingleInstruction(bool debug = false)
        {
            var i = _pic.GetNextInterrupt();

            if (i != null)
            {
                Interrupt((byte)i.Value, false);
            }

            var fetcher     = new Fetcher8086(this);
            var instruction = OpCodeManager.Decode(fetcher);

            IncRegister(Register.IP, fetcher.GetBytesFetched());

            if (instruction.Type == OpCodeManager.InstructionType.Invalid)
            {
                return(0);
            }

            if (debug)
            {
                string instructionText = $"{GetRegister(Register.CS):X4}:{GetRegister(Register.IP):X4} ";
                instructionText += InstructionStringHelper.OutputInstruction(instruction);
                DebugLineEmitted?.Invoke(instructionText);
                Console.WriteLine(instructionText);
            }

            instructions[(int)instruction.Type].Dispatch(this, instruction);

            return(instruction.Clocks);
        }
Exemple #3
0
        public string GetCurrentInstructionString()
        {
            var fetcher         = new Fetcher8086(_cpu);
            var instruction     = OpCodeManager.Decode(fetcher);
            var instructionText = $"{_cpu.GetRegister(Register.CS):X4}:{_cpu.GetRegister(Register.IP):X4} ";

            instructionText += InstructionStringHelper.OutputInstruction(instruction);
            return(instructionText);
        }
        override public bool Init(string confDirectory, ref string errorMessage)
        {
            OpManager = new OpCodeManager();

            if (!OpManager.Init(confDirectory + "\\" + PatchConfFileName, ref errorMessage))
            {
                return(false);
            }

            RegisterExplorers();

            return(true);
        }
Exemple #5
0
        virtual public bool Init(string ConfDirectory, ref string ErrorMessage)
        {
            OpManager = new OpCodeManager();

            return(false);
        }