Exemple #1
0
 public CPU(Main _parent)
 {
     accumulator = "0";
     programCounter = "0";
     zeroFlag = false;
     carryFlag = false;
     overflowFlag = false;
     negativeSignFlag = false;
     parent = _parent;
     instructionFailed = false;
 }
        // Initialisation Code
        public InstructionView(string name, string detail, string OPCODE, int colour, string vI, Main p)
        {
            InitializeComponent();
            labelName.Text = name;
            labelDetail.Text = detail;
            labelOPCODESmall.Text = OPCODE;

            switch (colour)
            {
                case 1:
                    changeColour(Color.PowderBlue);
                    break;

                case 2:
                    changeColour(Color.Gold);
                    break;

                case 3:
                    changeColour(Color.OrangeRed);
                    break;

                case 4:
                    changeColour(Color.Orchid);
                    break;

                default:
                    changeColour(Color.FromName("GradientInactiveCaption"));
                    break;
            }

            if (vI == "yes")
            {
                validatedInput = true;
            } else {
                validatedInput = false;
            }

            parent = p;
            // Set other values

            this.Height = 25;
        }