Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #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;
            }
        }
Beispiel #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
     });
 }
Beispiel #7
0
        public override void ExecuteInstruction(Interrupts IOInterrupts, State ProcessorState)
        {
            uint ValueSource = ProcessorState.ReadRegister(RegisterSource);

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

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

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

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

            ProcessorState.ProgramCounter = (int)ValueSource;
        }