Exemplo n.º 1
0
        public override void ExecuteInstruction(Interrupts IOInterrupts, State ProcessorState)
        {
            uint ValueSource    = ProcessorState.ReadRegister(RegisterSource);
            uint ValueTemporary = ProcessorState.ReadRegister(RegisterTemporary);

            ProcessorState.WriteRegister(RegisterDestination, ValueSource | ValueTemporary);
        }
Exemplo n.º 2
0
        public override void ExecuteInstruction(Interrupts IOInterrupts, State ProcessorState)
        {
            uint ValueSource = ProcessorState.ReadRegister(RegisterSource);
            uint Result      = (uint)(((int)ValueSource < (short)Immediate) ? 1 : 0);

            ProcessorState.Zero = (Result == 0);
            ProcessorState.WriteRegister(RegisterDestination, Result);
        }
Exemplo n.º 3
0
        public override void ExecuteInstruction(Interrupts IOInterrupts, State ProcessorState)
        {
            uint ValueSource    = ProcessorState.ReadRegister(RegisterSource);
            uint ValueTemporary = ProcessorState.ReadRegister(RegisterTemporary);
            uint Result         = (uint)(ValueSource < ValueTemporary ? 1 : 0);

            SetFlags(ProcessorState, ValueSource, ValueTemporary, Result);
            ProcessorState.WriteRegister(RegisterDestination, Result);
        }
Exemplo n.º 4
0
        public override void ExecuteInstruction(Interrupts IOInterrupts, State ProcessorState)
        {
            uint ValueSource = ProcessorState.ReadRegister(RegisterSource);
            uint Result      = (uint)(ValueSource + (short)Immediate);

            DetectOverflow(ValueSource, Immediate, Result, ProcessorState);
            ProcessorState.Zero = (Result == 0);
            ProcessorState.WriteRegister(RegisterDestination, Result);
        }
Exemplo n.º 5
0
        public override void ExecuteInstruction(Interrupts IOInterrupts, State ProcessorState)
        {
            int ValueSource      = (int)ProcessorState.ReadRegister(RegisterSource);
            int ValueDestination = (int)ProcessorState.ReadRegister(RegisterDestination);

            if (ValueSource == ValueDestination)
            {
                ProcessorState.UpdateProgramCounterFromOffset((short)Immediate);
                ProcessorState.Zero = true;
            }
            else
            {
                ProcessorState.Zero = false;
            }
        }
Exemplo n.º 6
0
 public GUISimulator(MainForm GUIForm)
 {
     form       = GUIForm;
     state      = new State(MEMORY_SIZE);
     interrupts = new Interrupts();
     interrupts.AddInterruptHandler(new Interrupt()
     {
         Handler = PrintStringInterruptHandler, InterruptID = (int)InterruptIDs.PRINT_STRING
     });
     interrupts.AddInterruptHandler(new Interrupt()
     {
         Handler = PrintIntegerInterruptHandler, InterruptID = (int)InterruptIDs.PRINT_INTEGER
     });
     interrupts.AddInterruptHandler(new Interrupt()
     {
         Handler = ExitInterruptHandler, InterruptID = (int)InterruptIDs.EXIT
     });
 }
Exemplo n.º 7
0
        public override void ExecuteInstruction(Interrupts IOInterrupts, State ProcessorState)
        {
            uint ValueSource = ProcessorState.ReadRegister(RegisterSource);

            ProcessorState.WriteRegister(RegisterDestination, (uint)(ValueSource & (short)Immediate));
        }
Exemplo n.º 8
0
 public virtual void ExecuteInstruction(Interrupts IOInterrupts, State ProcessorState)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 9
0
 protected override void AddExtraInformation(Interrupts IOInterrupts, State ProcessState)
 {
     ProcessState.WriteRegister(ra, (uint)ProcessState.ProgramCounter);
 }
Exemplo n.º 10
0
        public override void ExecuteInstruction(Interrupts IOInterrupts, State ProcessorState)
        {
            uint ValueSource = ProcessorState.ReadRegister(RegisterSource);

            ProcessorState.WriteByte((int)(ValueSource + Immediate), (byte)ProcessorState.ReadRegister(RegisterDestination));
        }
Exemplo n.º 11
0
        public override void ExecuteInstruction(Interrupts IOInterrupts, State ProcessorState)
        {
            uint ValueSource = ProcessorState.ReadRegister(RegisterSource);

            ProcessorState.WriteRegister(RegisterDestination, ValueSource << ShiftAmount);
        }
Exemplo n.º 12
0
 public override void ExecuteInstruction(Interrupts IOInterrupts, State ProcessorState)
 {
     IOInterrupts.ExecuteInterruptHandler((int)ProcessorState.ReadRegister(V_0), ProcessorState);
 }
Exemplo n.º 13
0
 protected virtual void AddExtraInformation(Interrupts IOInterrupts, State ProcessState)
 {
 }
Exemplo n.º 14
0
 public override void ExecuteInstruction(Interrupts IOInterrupts, State ProcessorState)
 {
     AddExtraInformation(IOInterrupts, ProcessorState);
     ProcessorState.ProgramCounter = (int)(Target);
 }
Exemplo n.º 15
0
        public override void ExecuteInstruction(Interrupts IOInterrupts, State ProcessorState)
        {
            uint Result = (uint)(Immediate << 16);

            ProcessorState.WriteRegister(RegisterDestination, Result);
        }
Exemplo n.º 16
0
        public override void ExecuteInstruction(Interrupts IOInterrupts, State ProcessorState)
        {
            uint ValueSource = ProcessorState.ReadRegister(RegisterSource);

            ProcessorState.ProgramCounter = (int)ValueSource;
        }