コード例 #1
0
ファイル: Execution.cs プロジェクト: MohameaHalawa/Csharp
 /***************************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());
 }
コード例 #2
0
        /********************************* 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());
        }
コード例 #3
0
        /***************************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());
        }
コード例 #4
0
ファイル: Execution.cs プロジェクト: MohameaHalawa/Csharp
 /********************************* 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());
 }
コード例 #5
0
ファイル: Execution.cs プロジェクト: MohameaHalawa/Csharp
 /******************* Funcitions-Documentation ***********************
 *- obj: is where the Function get or set the Data of Register       *
 * and is passed by Ref to apply the modification to the original    *
 * Load object.                                                      *
 *-gb: is the group box that contain the textbox controls            *
 * that Represent the Registers(set Data or Show its Contained Value *
 * passed by Ref to apply changes to the original controls(textbox's)*
 *********************************************************************/
 /******************************Zero**********************************
 * Zero(char RegNumber,,ref Load obj,ref GroupBox gb) Function is    *
 * used to convert the Register Value Form n to zero                 *
 *- RegNumber: Represent the Index of Register place in memory       *
 ********************************************************************/
 private void Zero(char RegNumber, ref Load obj, ref GroupBox gb)
 {
     int index = int.Parse(RegNumber.ToString());
     obj.Set_RegArray(index, "0");
 }
コード例 #6
0
        /******************* Funcitions-Documentation ***********************
         *- obj: is where the Function get or set the Data of Register       *
         * and is passed by Ref to apply the modification to the original    *
         * Load object.                                                      *
         *-gb: is the group box that contain the textbox controls            *
         * that Represent the Registers(set Data or Show its Contained Value *
         * passed by Ref to apply changes to the original controls(textbox's)*
         *********************************************************************/
        /******************************Zero**********************************
        * Zero(char RegNumber,,ref Load obj,ref GroupBox gb) Function is    *
        * used to convert the Register Value Form n to zero                 *
        *- RegNumber: Represent the Index of Register place in memory       *
        ********************************************************************/
        private void Zero(char RegNumber, ref Load obj, ref GroupBox gb)
        {
            int index = int.Parse(RegNumber.ToString());

            obj.Set_RegArray(index, "0");
        }