コード例 #1
0
        private void tool_Clicked(object sender, ToolStripItemClickedEventArgs e)
        {
            switch (e.ClickedItem.AccessibleName)
            {
            case "Nuevo":
                if (saveFileSIC.ShowDialog().Equals(DialogResult.OK))
                {
                    this.nombre  = saveFileSIC.FileName;
                    this.archivo = new List <string>();
                    MetodosAuxiliares.grabaArchivoSIC(this.nombre, this.archivo);
                }
                break;

            case "Abrir":
                if (openFileSIC.ShowDialog().Equals(DialogResult.OK))
                {
                    this.nombre  = openFileSIC.FileName;
                    this.archivo = MetodosAuxiliares.leeArchivo(nombre);
                    this.actualizaDataGrid();
                }
                break;

            case "Guardar":
                if (this.archivo != null)
                {
                    MetodosAuxiliares.grabaArchivoSIC(this.nombre, this.archivo);
                }
                break;
            }
        }
コード例 #2
0
 public Ensamblador(string nombre)
 {
     this.nombre  = nombre;
     this.archivo = MetodosAuxiliares.leeArchivo(nombre);
     #region Agregamos Instrucciones
     this.instrucciones = new Dictionary <string, string>();
     this.instrucciones.Add("ADD", "18");
     this.instrucciones.Add("AND", "40");
     this.instrucciones.Add("COMP", "28");
     this.instrucciones.Add("DIV", "24");
     this.instrucciones.Add("J", "3C");
     this.instrucciones.Add("JEQ", "30");
     this.instrucciones.Add("JGT", "34");
     this.instrucciones.Add("JLT", "38");
     this.instrucciones.Add("JSUB", "48");
     this.instrucciones.Add("LDA", "00");
     this.instrucciones.Add("LDCH", "50");
     this.instrucciones.Add("LDL", "08");
     this.instrucciones.Add("LDX", "04");
     this.instrucciones.Add("MUL", "20");
     this.instrucciones.Add("OR", "44");
     this.instrucciones.Add("RD", "D8");
     this.instrucciones.Add("RSUB", "4C");
     this.instrucciones.Add("STA", "0C");
     this.instrucciones.Add("STCH", "54");
     this.instrucciones.Add("STL", "14");
     this.instrucciones.Add("STSW", "E8");
     this.instrucciones.Add("STX", "10");
     this.instrucciones.Add("SUB", "1C");
     this.instrucciones.Add("TD", "E0");
     this.instrucciones.Add("TIX", "2C");
     this.instrucciones.Add("WD", "DC");
     this.paso1Logrado = false;
     #endregion
 }