/**************************************** Jumb ********************************************* * jumb(char Reg1_Number, char Reg2_Number, char GotoLineN, ref Load obj, ref int iterat) * * this Function is used to act like if so if(Reg1_Number's values==Reg2_Number's values) * * it will execute the line with index (GotoLineN) and keep executing the Sequence again * *-Regn_Number: Represent the Index of Register place in memory n=(1 or 2) * *-GotoLineN: Represent the number of line that it will be executed if the Condition is True* *-iterat:Represent the current value of execution iterator, is passed by ref to be able to * * Modify it's value to the "GotoLineN" value which Represent the Line number that will be * * executed if the Condition is true * *******************************************************************************************/ private void jumb(char Reg1_Number, char Reg2_Number, char GotoLineN, ref Load obj, ref int iterat) { int Reg1_index = int.Parse(Reg1_Number.ToString()); int Reg2_index = int.Parse(Reg2_Number.ToString()); int temp1 = obj.Get_RegArray(Reg1_index); int temp2 = obj.Get_RegArray(Reg2_index); if (temp1 == temp2) { iterat = int.Parse(GotoLineN.ToString()) - 2; } }
/**************************************** Jumb ********************************************* * jumb(char Reg1_Number, char Reg2_Number, char GotoLineN, ref Load obj, ref int iterat) * * this Function is used to act like if so if(Reg1_Number's values==Reg2_Number's values) * * it will execute the line with index (GotoLineN) and keep executing the Sequence again * *-Regn_Number: Represent the Index of Register place in memory n=(1 or 2) * *-GotoLineN: Represent the number of line that it will be executed if the Condition is True* *-iterat:Represent the current value of execution iterator, is passed by ref to be able to * * Modify it's value to the "GotoLineN" value which Represent the Line number that will be * * executed if the Condition is true * *******************************************************************************************/ private void jumb(char Reg1_Number, char Reg2_Number, char GotoLineN, ref Load obj, ref int iterat) { int Reg1_index = int.Parse(Reg1_Number.ToString()); int Reg2_index = int.Parse(Reg2_Number.ToString()); int temp1 = obj.Get_RegArray(Reg1_index); int temp2 = obj.Get_RegArray(Reg2_index); if (temp1 == temp2) { iterat = int.Parse(GotoLineN.ToString()) - 2; } }
/***************************Successor*********************************** * Successor(char RegNumber, ref Load obj, ref GroupBox gb) Function is * * used to increase the current value in Register by 1 * *- RegNumber: Represent the Index of Register place in memory * ************************************************************************/ private void Successor(char RegNumber, ref Load obj, ref GroupBox gb) { int index = int.Parse(RegNumber.ToString()); int Regvalue = obj.Get_RegArray(index); Regvalue++; obj.Set_RegArray(index, Regvalue.ToString()); }
/********************************* Trans ********************************************* * Trans(char Reg1_Number, char Reg2_Number, ref Load obj, ref GroupBox gb) Function is* * used to Transfere the value from Reg1_number and place it Reg2_Number * * RegNumber: Represent the Index of Register place in memory * *************************************************************************************/ private void Trans(char Reg1_Number, char Reg2_Number, ref Load obj, ref GroupBox gb) { int Reg1_index = int.Parse(Reg1_Number.ToString()); int Reg2_index = int.Parse(Reg2_Number.ToString()); int temp = obj.Get_RegArray(Reg1_index); obj.Set_RegArray(Reg2_index, temp.ToString()); }
/***************************Successor*********************************** * Successor(char RegNumber, ref Load obj, ref GroupBox gb) Function is * * used to increase the current value in Register by 1 * *- RegNumber: Represent the Index of Register place in memory * ************************************************************************/ private void Successor(char RegNumber, ref Load obj, ref GroupBox gb) { int index = int.Parse(RegNumber.ToString()); int Regvalue = obj.Get_RegArray(index); Regvalue++; obj.Set_RegArray(index, Regvalue.ToString()); }
/********************************* Trans ********************************************* *Trans(char Reg1_Number, char Reg2_Number, ref Load obj, ref GroupBox gb) Function is* *used to Transfere the value from Reg1_number and place it Reg2_Number * *RegNumber: Represent the Index of Register place in memory * *************************************************************************************/ private void Trans(char Reg1_Number, char Reg2_Number, ref Load obj, ref GroupBox gb) { int Reg1_index = int.Parse(Reg1_Number.ToString()); int Reg2_index = int.Parse(Reg2_Number.ToString()); int temp = obj.Get_RegArray(Reg1_index); obj.Set_RegArray(Reg2_index, temp.ToString()); }