예제 #1
0
 public void Dispatch(Cpu8086 cpu, OpCodeManager.Instruction instruction)
 {
     cpu.SetRegister(Register.IP, cpu.Pop());
     cpu.SetRegister(Register.CS, cpu.Pop());
     cpu.SetRegister(Register.FLAGS, cpu.Pop());
     //cpu._interruptStack.Pop();
 }
예제 #2
0
        public void Dispatch(Cpu8086 cpu, OpCodeManager.Instruction instruction)
        {
            switch (instruction.Argument1)
            {
            case (int)Register.AX:
            case (int)Register.CX:
            case (int)Register.DX:
            case (int)Register.BX:
            case (int)Register.SP:
            case (int)Register.BP:
            case (int)Register.SI:
            case (int)Register.DI:
            case (int)Register.IP:
            case (int)Register.CS:
            case (int)Register.DS:
            case (int)Register.ES:
            case (int)Register.SS:
                //case unchecked((int)Register.FLAGS):
                cpu.SetRegister((Register)instruction.Argument1, cpu.Pop());
                break;

            case unchecked ((int)Register.FLAGS):
                cpu.SetRegister((Register)instruction.Argument1, cpu.Pop());
                break;

            case OpCodeManager.ARG_DEREFERENCE:
            case OpCodeManager.ARG_MEMORY:
                var address = InstructionHelper.GetInstructionRealAddress(cpu, instruction.SegmentPrefix, instruction.Argument1, instruction.Argument1Value, instruction.Argument1Displacement);
                cpu.WriteU16(address, cpu.Pop());
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
예제 #3
0
 public void Dispatch(Cpu8086 cpu, OpCodeManager.Instruction instruction)
 {
     cpu.SetRegister(Register.IP, cpu.Pop());
     cpu.SetRegister(Register.CS, cpu.Pop());
     if (instruction.Argument1 == OpCodeManager.ARG_CONSTANT)
     {
         cpu.SetRegister(Register.SP, (ushort)(cpu.GetRegister(Register.SP) + instruction.Argument1Value));
     }
     else
     {
         Debug.Assert(instruction.Argument1 == OpCodeManager.ARG_NONE);
     }
 }