private void btnRun_Click(object sender, EventArgs e) { AsmCl tre = new AsmCl(); string[] text = new string[txbCode.Lines.Length]; for (int i = 0; i < txbCode.Lines.Length; i++) { text[i] = txbCode.Lines[i]; } byte[] registr = new byte[16]; registr = tre.runCode(text, txbCode.Lines.Length); string Resultreg = ""; for (int i = 0; i < registr.Length; i++) { Resultreg += "Регистр " + i + " = " + registr[i] + "\r\n"; } Result.Text = Resultreg; }
public void djigurda() { string[] text = new string[10]; text[0] = "ld r1,#dfjdfjsdbf"; text[1] = "ld r0,#dnjfdjf"; text[2] = "ld r2,#15"; text[3] = "metka m10"; text[4] = "sub r2,r0"; text[5] = "add r1,r0"; text[6] = "brgz metka1,r2"; text[7] = ""; text[8] = ""; text[9] = ""; AsmCl tre1 = new AsmCl(); var x = tre1.runCode(text, 10); byte[] registr = { 1, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; CollectionAssert.AreEquivalent(registr, x); }