Example #1
0
 public static void ExeIInstruction(RiscVProgramResult res, string exeCommand, List <string> args)
 {
     if (exeCommand == "jalr")
     {
         res.Register[registersOpcode[args[0]]].Value = res.Register[registersOpcode["pc"]].Value;
         res.Register[registersOpcode["pc"]].Value    =
             res.Register[registersOpcode[args[1]]].Value + Convert.ToInt32(args[1]);
     }
     else
     {
         if (registersOpcode[args[0]] != 0)
         {
             res.Register[registersOpcode[args[0]]].Value =
                 Healper.CalculatIComand(res.Register[registersOpcode[args[1]]].Value, int.Parse(args[2]) & 4095,
                                         exeCommand);
         }
     }
 }
Example #2
0
 public static void ExeShamtIInstruction(RiscVProgramResult res, string exeCommand, List <string> args)
 {
     res.Register[registersOpcode[args[0]]].Value =
         Healper.CalculatIComand(res.Register[registersOpcode[args[1]]].Value, int.Parse(args[2]) & 31,
                                 exeCommand);
 }