Exemplo n.º 1
0
        public Process(List <Instruction> store)
        {
            this.storage = store;

            //Create an object Register
            Register reg = new Register();

            //Read ach line of Primary Storage and Process
            foreach (Instruction inst in storage)
            {
                //Process program line
                reg.opc(inst);

                //Output
                Console.WriteLine("****** Output Line " + storage.IndexOf(inst).ToString() + " *********");
                Console.WriteLine(inst.Opcode.ToString() + "  " + inst.Operand.ToString());
                Console.WriteLine("ACC ------>" + reg.ACC.ToString());
                Console.WriteLine("MIR ------>" + reg.MIR.ToString());
                Console.WriteLine("CSIAR----->" + reg.CSIAR.ToString());
                Console.WriteLine("SAR ------>" + reg.SAR.ToString());
                Console.WriteLine("Opcode --->" + inst.Opcode.ToString());
                Console.WriteLine("Operand -->" + inst.Operand.ToString());
                Console.WriteLine("------------------------------------------------------");
            }
        }
Exemplo n.º 2
0
        public void process(ArrayList store)
        {
            //Create process ID from instList
            this.processID = store.GetHashCode();

            //Create an object Register
            Register reg = new Register();

            //Read ach line of Primary Storage and Process
            foreach (Instruction inst in store)
            {
                if (inst != null)
                {
                    //Process program line
                    reg.opc(inst);

                    //Update instruction flag
                    inst.Status = true;

                    //Update instructions counter
                    count++;

                    //Output
                    //Console.WriteLine("");
                    Console.WriteLine("****** Output Line " + count.ToString() + " *********");
                    Console.WriteLine("Opcode: " + inst.Opcode.ToString() + "  " + "Operand: " + inst.Operand.ToString());
                    Console.WriteLine("ACC ------> " + reg.ACC.ToString());
                    Console.WriteLine("MIR ------> " + reg.MIR.ToString());
                    Console.WriteLine("CSIAR ----> " + reg.CSIAR.ToString());
                    Console.WriteLine("PSIAR ----> " + reg.PSIAR.ToString());
                    Console.WriteLine("TMPR -----> " + reg.CSIAR.ToString());
                    Console.WriteLine("SAR ------> " + reg.SAR.ToString());
                    Console.WriteLine("------------------------------------------------------");
                }
            }



            //Update process counter
            processCounter++;

            //returns information about the process
            this.processInf();
        }