Moved project files to /src
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace processor
|
||||
{
|
||||
internal static class Extensions
|
||||
{
|
||||
internal static string RemoveComment(string text)
|
||||
{
|
||||
int idx = text.LastIndexOf("#");
|
||||
return idx > 0 ? text.Substring(0, idx) : text;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Removes leading 0x prefix in hexadecimal instructions, only returning 4 char part
|
||||
/// </summary>
|
||||
/// <param name="text"></param>
|
||||
/// <returns></returns>
|
||||
internal static string RemoveLeading(string text)
|
||||
{
|
||||
if (text.Contains("0x")) return text.Remove(0, 2);
|
||||
MessageBox.Show("Error while parsing code:\nHexadecimal instruction codes must start with \"0x\"!", "Vole Language Parser");
|
||||
return "";
|
||||
}
|
||||
|
||||
public static IEnumerable<string> Split2(this string text)
|
||||
{
|
||||
for (int i = 0; i < text.Length; i += 2)
|
||||
yield return text.Substring(i, Math.Min(2, text.Length - i));
|
||||
}
|
||||
|
||||
internal static IEnumerable<string> Split4(this string text)
|
||||
{
|
||||
for (int i = 0; i < text.Length; i += 4)
|
||||
yield return text.Substring(i, Math.Min(4, text.Length - i));
|
||||
}
|
||||
|
||||
internal static string[] Split1(this string text)
|
||||
{
|
||||
char[] a = text.ToCharArray();
|
||||
string[] r = new string[text.Length];
|
||||
for (int i = 0; i < text.Length; i++)
|
||||
{
|
||||
r[i] = a[i].ToString();
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
internal static string ToBin(this int value) => Convert.ToString(value, 2).PadLeft(8, '0');
|
||||
|
||||
internal static string ToHex(this int value) => Convert.ToString(value, 16);
|
||||
|
||||
internal static string ToHex2(this int value) => value.ToHex().PadLeft(2, '0');
|
||||
|
||||
internal static int Hex2Int(this string value) => Convert.ToInt32(value, 8);
|
||||
}
|
||||
}
|
||||
Generated
+822
@@ -0,0 +1,822 @@
|
||||
|
||||
namespace processor
|
||||
{
|
||||
partial class MainForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
||||
this.groupBox2 = new System.Windows.Forms.GroupBox();
|
||||
this.radHex = new System.Windows.Forms.RadioButton();
|
||||
this.radBin = new System.Windows.Forms.RadioButton();
|
||||
this.btnClear = new System.Windows.Forms.Button();
|
||||
this.btnLoad = new System.Windows.Forms.Button();
|
||||
this.txtCode = new System.Windows.Forms.RichTextBox();
|
||||
this.groupBox6 = new System.Windows.Forms.GroupBox();
|
||||
this.lblStatus = new System.Windows.Forms.Label();
|
||||
this.btnStart = new System.Windows.Forms.Button();
|
||||
this.btnStep = new System.Windows.Forms.Button();
|
||||
this.btnHalt = new System.Windows.Forms.Button();
|
||||
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.splitContainer3 = new System.Windows.Forms.SplitContainer();
|
||||
this.groupBox4 = new System.Windows.Forms.GroupBox();
|
||||
this.lblOpcode = new System.Windows.Forms.Label();
|
||||
this.lblOpcodeDesc = new System.Windows.Forms.Label();
|
||||
this.groupBox5 = new System.Windows.Forms.GroupBox();
|
||||
this._lblrc = new System.Windows.Forms.Label();
|
||||
this.txtrf = new System.Windows.Forms.TextBox();
|
||||
this._lblrf = new System.Windows.Forms.Label();
|
||||
this.txtr8 = new System.Windows.Forms.TextBox();
|
||||
this._lblre = new System.Windows.Forms.Label();
|
||||
this.txtr9 = new System.Windows.Forms.TextBox();
|
||||
this._lblrd = new System.Windows.Forms.Label();
|
||||
this.txtra = new System.Windows.Forms.TextBox();
|
||||
this._lblrb = new System.Windows.Forms.Label();
|
||||
this.txtrb = new System.Windows.Forms.TextBox();
|
||||
this._lblra = new System.Windows.Forms.Label();
|
||||
this.txtrc = new System.Windows.Forms.TextBox();
|
||||
this._lblr9 = new System.Windows.Forms.Label();
|
||||
this.txtrd = new System.Windows.Forms.TextBox();
|
||||
this._lblr8 = new System.Windows.Forms.Label();
|
||||
this.txtre = new System.Windows.Forms.TextBox();
|
||||
this.txtrInstReg = new System.Windows.Forms.TextBox();
|
||||
this._lblIR = new System.Windows.Forms.Label();
|
||||
this.txtProgCounter = new System.Windows.Forms.TextBox();
|
||||
this._lblPC = new System.Windows.Forms.Label();
|
||||
this._lblr7 = new System.Windows.Forms.Label();
|
||||
this.txtr7 = new System.Windows.Forms.TextBox();
|
||||
this._lblr6 = new System.Windows.Forms.Label();
|
||||
this.txtr0 = new System.Windows.Forms.TextBox();
|
||||
this._lblr5 = new System.Windows.Forms.Label();
|
||||
this.txtr1 = new System.Windows.Forms.TextBox();
|
||||
this._lblr4 = new System.Windows.Forms.Label();
|
||||
this.txtr2 = new System.Windows.Forms.TextBox();
|
||||
this._lblr3 = new System.Windows.Forms.Label();
|
||||
this.txtr3 = new System.Windows.Forms.TextBox();
|
||||
this._lblr2 = new System.Windows.Forms.Label();
|
||||
this.txtr4 = new System.Windows.Forms.TextBox();
|
||||
this._lblr1 = new System.Windows.Forms.Label();
|
||||
this.txtr5 = new System.Windows.Forms.TextBox();
|
||||
this._lblr0 = new System.Windows.Forms.Label();
|
||||
this.txtr6 = new System.Windows.Forms.TextBox();
|
||||
this.groupBox3 = new System.Windows.Forms.GroupBox();
|
||||
this.ramList = new System.Windows.Forms.ListBox();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
|
||||
this.splitContainer1.Panel1.SuspendLayout();
|
||||
this.splitContainer1.Panel2.SuspendLayout();
|
||||
this.splitContainer1.SuspendLayout();
|
||||
this.groupBox2.SuspendLayout();
|
||||
this.groupBox6.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit();
|
||||
this.splitContainer2.Panel1.SuspendLayout();
|
||||
this.splitContainer2.Panel2.SuspendLayout();
|
||||
this.splitContainer2.SuspendLayout();
|
||||
this.groupBox1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).BeginInit();
|
||||
this.splitContainer3.Panel1.SuspendLayout();
|
||||
this.splitContainer3.Panel2.SuspendLayout();
|
||||
this.splitContainer3.SuspendLayout();
|
||||
this.groupBox4.SuspendLayout();
|
||||
this.groupBox5.SuspendLayout();
|
||||
this.groupBox3.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// splitContainer1
|
||||
//
|
||||
this.splitContainer1.Cursor = System.Windows.Forms.Cursors.Arrow;
|
||||
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.splitContainer1.IsSplitterFixed = true;
|
||||
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
|
||||
this.splitContainer1.Name = "splitContainer1";
|
||||
//
|
||||
// splitContainer1.Panel1
|
||||
//
|
||||
this.splitContainer1.Panel1.Controls.Add(this.groupBox2);
|
||||
//
|
||||
// splitContainer1.Panel2
|
||||
//
|
||||
this.splitContainer1.Panel2.Controls.Add(this.splitContainer2);
|
||||
this.splitContainer1.Size = new System.Drawing.Size(967, 450);
|
||||
this.splitContainer1.SplitterDistance = 349;
|
||||
this.splitContainer1.TabIndex = 0;
|
||||
//
|
||||
// groupBox2
|
||||
//
|
||||
this.groupBox2.Controls.Add(this.radHex);
|
||||
this.groupBox2.Controls.Add(this.radBin);
|
||||
this.groupBox2.Controls.Add(this.btnClear);
|
||||
this.groupBox2.Controls.Add(this.btnLoad);
|
||||
this.groupBox2.Controls.Add(this.txtCode);
|
||||
this.groupBox2.Controls.Add(this.groupBox6);
|
||||
this.groupBox2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.groupBox2.Location = new System.Drawing.Point(0, 0);
|
||||
this.groupBox2.Name = "groupBox2";
|
||||
this.groupBox2.Size = new System.Drawing.Size(349, 450);
|
||||
this.groupBox2.TabIndex = 0;
|
||||
this.groupBox2.TabStop = false;
|
||||
this.groupBox2.Text = "Input";
|
||||
//
|
||||
// radHex
|
||||
//
|
||||
this.radHex.AutoSize = true;
|
||||
this.radHex.Checked = true;
|
||||
this.radHex.Location = new System.Drawing.Point(70, 318);
|
||||
this.radHex.Name = "radHex";
|
||||
this.radHex.Size = new System.Drawing.Size(94, 19);
|
||||
this.radHex.TabIndex = 10;
|
||||
this.radHex.TabStop = true;
|
||||
this.radHex.Text = "Hexadecimal";
|
||||
this.radHex.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// radBin
|
||||
//
|
||||
this.radBin.AutoSize = true;
|
||||
this.radBin.Location = new System.Drawing.Point(6, 318);
|
||||
this.radBin.Name = "radBin";
|
||||
this.radBin.Size = new System.Drawing.Size(58, 19);
|
||||
this.radBin.TabIndex = 9;
|
||||
this.radBin.TabStop = true;
|
||||
this.radBin.Text = "Binary";
|
||||
this.radBin.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// btnClear
|
||||
//
|
||||
this.btnClear.Location = new System.Drawing.Point(187, 316);
|
||||
this.btnClear.Name = "btnClear";
|
||||
this.btnClear.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnClear.TabIndex = 8;
|
||||
this.btnClear.Text = "Clear";
|
||||
this.btnClear.UseVisualStyleBackColor = true;
|
||||
this.btnClear.Click += new System.EventHandler(this.btnClear_Click);
|
||||
//
|
||||
// btnLoad
|
||||
//
|
||||
this.btnLoad.Location = new System.Drawing.Point(268, 316);
|
||||
this.btnLoad.Name = "btnLoad";
|
||||
this.btnLoad.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnLoad.TabIndex = 7;
|
||||
this.btnLoad.Text = "Load";
|
||||
this.btnLoad.UseVisualStyleBackColor = true;
|
||||
this.btnLoad.Click += new System.EventHandler(this.btnLoad_Click);
|
||||
//
|
||||
// txtCode
|
||||
//
|
||||
this.txtCode.Location = new System.Drawing.Point(6, 23);
|
||||
this.txtCode.Name = "txtCode";
|
||||
this.txtCode.Size = new System.Drawing.Size(337, 291);
|
||||
this.txtCode.TabIndex = 6;
|
||||
this.txtCode.Text = "";
|
||||
//
|
||||
// groupBox6
|
||||
//
|
||||
this.groupBox6.Controls.Add(this.lblStatus);
|
||||
this.groupBox6.Controls.Add(this.btnStart);
|
||||
this.groupBox6.Controls.Add(this.btnStep);
|
||||
this.groupBox6.Controls.Add(this.btnHalt);
|
||||
this.groupBox6.Location = new System.Drawing.Point(9, 338);
|
||||
this.groupBox6.Name = "groupBox6";
|
||||
this.groupBox6.Size = new System.Drawing.Size(337, 100);
|
||||
this.groupBox6.TabIndex = 4;
|
||||
this.groupBox6.TabStop = false;
|
||||
//
|
||||
// lblStatus
|
||||
//
|
||||
this.lblStatus.AutoSize = true;
|
||||
this.lblStatus.Location = new System.Drawing.Point(6, 19);
|
||||
this.lblStatus.Name = "lblStatus";
|
||||
this.lblStatus.Size = new System.Drawing.Size(84, 15);
|
||||
this.lblStatus.TabIndex = 4;
|
||||
this.lblStatus.Text = "Status: {status}";
|
||||
//
|
||||
// btnStart
|
||||
//
|
||||
this.btnStart.Location = new System.Drawing.Point(256, 71);
|
||||
this.btnStart.Name = "btnStart";
|
||||
this.btnStart.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnStart.TabIndex = 2;
|
||||
this.btnStart.Text = "Start";
|
||||
this.btnStart.UseVisualStyleBackColor = true;
|
||||
this.btnStart.Click += new System.EventHandler(this.btnStart_Click);
|
||||
//
|
||||
// btnStep
|
||||
//
|
||||
this.btnStep.Location = new System.Drawing.Point(94, 71);
|
||||
this.btnStep.Name = "btnStep";
|
||||
this.btnStep.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnStep.TabIndex = 3;
|
||||
this.btnStep.Text = "Step";
|
||||
this.btnStep.UseVisualStyleBackColor = true;
|
||||
this.btnStep.Click += new System.EventHandler(this.btnStep_Click);
|
||||
//
|
||||
// btnHalt
|
||||
//
|
||||
this.btnHalt.Enabled = false;
|
||||
this.btnHalt.Location = new System.Drawing.Point(175, 71);
|
||||
this.btnHalt.Name = "btnHalt";
|
||||
this.btnHalt.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnHalt.TabIndex = 1;
|
||||
this.btnHalt.Text = "Halt";
|
||||
this.btnHalt.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// splitContainer2
|
||||
//
|
||||
this.splitContainer2.Cursor = System.Windows.Forms.Cursors.Arrow;
|
||||
this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.splitContainer2.IsSplitterFixed = true;
|
||||
this.splitContainer2.Location = new System.Drawing.Point(0, 0);
|
||||
this.splitContainer2.Name = "splitContainer2";
|
||||
//
|
||||
// splitContainer2.Panel1
|
||||
//
|
||||
this.splitContainer2.Panel1.Controls.Add(this.groupBox1);
|
||||
//
|
||||
// splitContainer2.Panel2
|
||||
//
|
||||
this.splitContainer2.Panel2.Controls.Add(this.groupBox3);
|
||||
this.splitContainer2.Size = new System.Drawing.Size(614, 450);
|
||||
this.splitContainer2.SplitterDistance = 405;
|
||||
this.splitContainer2.TabIndex = 0;
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Controls.Add(this.splitContainer3);
|
||||
this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.groupBox1.Location = new System.Drawing.Point(0, 0);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Size = new System.Drawing.Size(405, 450);
|
||||
this.groupBox1.TabIndex = 0;
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "CPU";
|
||||
//
|
||||
// splitContainer3
|
||||
//
|
||||
this.splitContainer3.Cursor = System.Windows.Forms.Cursors.HSplit;
|
||||
this.splitContainer3.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.splitContainer3.IsSplitterFixed = true;
|
||||
this.splitContainer3.Location = new System.Drawing.Point(3, 19);
|
||||
this.splitContainer3.Name = "splitContainer3";
|
||||
this.splitContainer3.Orientation = System.Windows.Forms.Orientation.Horizontal;
|
||||
//
|
||||
// splitContainer3.Panel1
|
||||
//
|
||||
this.splitContainer3.Panel1.Controls.Add(this.groupBox4);
|
||||
//
|
||||
// splitContainer3.Panel2
|
||||
//
|
||||
this.splitContainer3.Panel2.Controls.Add(this.groupBox5);
|
||||
this.splitContainer3.Size = new System.Drawing.Size(399, 428);
|
||||
this.splitContainer3.SplitterDistance = 155;
|
||||
this.splitContainer3.TabIndex = 0;
|
||||
//
|
||||
// groupBox4
|
||||
//
|
||||
this.groupBox4.Controls.Add(this.lblOpcode);
|
||||
this.groupBox4.Controls.Add(this.lblOpcodeDesc);
|
||||
this.groupBox4.Cursor = System.Windows.Forms.Cursors.Arrow;
|
||||
this.groupBox4.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.groupBox4.Location = new System.Drawing.Point(0, 0);
|
||||
this.groupBox4.Name = "groupBox4";
|
||||
this.groupBox4.Size = new System.Drawing.Size(399, 155);
|
||||
this.groupBox4.TabIndex = 0;
|
||||
this.groupBox4.TabStop = false;
|
||||
this.groupBox4.Text = "Control";
|
||||
//
|
||||
// lblOpcode
|
||||
//
|
||||
this.lblOpcode.AutoSize = true;
|
||||
this.lblOpcode.Location = new System.Drawing.Point(16, 30);
|
||||
this.lblOpcode.Name = "lblOpcode";
|
||||
this.lblOpcode.Size = new System.Drawing.Size(55, 15);
|
||||
this.lblOpcode.TabIndex = 2;
|
||||
this.lblOpcode.Text = "{opcode}";
|
||||
//
|
||||
// lblOpcodeDesc
|
||||
//
|
||||
this.lblOpcodeDesc.AutoSize = true;
|
||||
this.lblOpcodeDesc.Location = new System.Drawing.Point(16, 55);
|
||||
this.lblOpcodeDesc.Name = "lblOpcodeDesc";
|
||||
this.lblOpcodeDesc.Size = new System.Drawing.Size(117, 15);
|
||||
this.lblOpcodeDesc.TabIndex = 1;
|
||||
this.lblOpcodeDesc.Text = "{opcode description}";
|
||||
//
|
||||
// groupBox5
|
||||
//
|
||||
this.groupBox5.Controls.Add(this._lblrc);
|
||||
this.groupBox5.Controls.Add(this.txtrf);
|
||||
this.groupBox5.Controls.Add(this._lblrf);
|
||||
this.groupBox5.Controls.Add(this.txtr8);
|
||||
this.groupBox5.Controls.Add(this._lblre);
|
||||
this.groupBox5.Controls.Add(this.txtr9);
|
||||
this.groupBox5.Controls.Add(this._lblrd);
|
||||
this.groupBox5.Controls.Add(this.txtra);
|
||||
this.groupBox5.Controls.Add(this._lblrb);
|
||||
this.groupBox5.Controls.Add(this.txtrb);
|
||||
this.groupBox5.Controls.Add(this._lblra);
|
||||
this.groupBox5.Controls.Add(this.txtrc);
|
||||
this.groupBox5.Controls.Add(this._lblr9);
|
||||
this.groupBox5.Controls.Add(this.txtrd);
|
||||
this.groupBox5.Controls.Add(this._lblr8);
|
||||
this.groupBox5.Controls.Add(this.txtre);
|
||||
this.groupBox5.Controls.Add(this.txtrInstReg);
|
||||
this.groupBox5.Controls.Add(this._lblIR);
|
||||
this.groupBox5.Controls.Add(this.txtProgCounter);
|
||||
this.groupBox5.Controls.Add(this._lblPC);
|
||||
this.groupBox5.Controls.Add(this._lblr7);
|
||||
this.groupBox5.Controls.Add(this.txtr7);
|
||||
this.groupBox5.Controls.Add(this._lblr6);
|
||||
this.groupBox5.Controls.Add(this.txtr0);
|
||||
this.groupBox5.Controls.Add(this._lblr5);
|
||||
this.groupBox5.Controls.Add(this.txtr1);
|
||||
this.groupBox5.Controls.Add(this._lblr4);
|
||||
this.groupBox5.Controls.Add(this.txtr2);
|
||||
this.groupBox5.Controls.Add(this._lblr3);
|
||||
this.groupBox5.Controls.Add(this.txtr3);
|
||||
this.groupBox5.Controls.Add(this._lblr2);
|
||||
this.groupBox5.Controls.Add(this.txtr4);
|
||||
this.groupBox5.Controls.Add(this._lblr1);
|
||||
this.groupBox5.Controls.Add(this.txtr5);
|
||||
this.groupBox5.Controls.Add(this._lblr0);
|
||||
this.groupBox5.Controls.Add(this.txtr6);
|
||||
this.groupBox5.Cursor = System.Windows.Forms.Cursors.Arrow;
|
||||
this.groupBox5.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.groupBox5.Location = new System.Drawing.Point(0, 0);
|
||||
this.groupBox5.Name = "groupBox5";
|
||||
this.groupBox5.Size = new System.Drawing.Size(399, 269);
|
||||
this.groupBox5.TabIndex = 16;
|
||||
this.groupBox5.TabStop = false;
|
||||
this.groupBox5.Text = "Registers";
|
||||
//
|
||||
// _lblrc
|
||||
//
|
||||
this._lblrc.AutoSize = true;
|
||||
this._lblrc.Location = new System.Drawing.Point(124, 145);
|
||||
this._lblrc.Name = "_lblrc";
|
||||
this._lblrc.Size = new System.Drawing.Size(41, 15);
|
||||
this._lblrc.TabIndex = 35;
|
||||
this._lblrc.Text = "Reg C:";
|
||||
//
|
||||
// txtrf
|
||||
//
|
||||
this.txtrf.Enabled = false;
|
||||
this.txtrf.Location = new System.Drawing.Point(168, 229);
|
||||
this.txtrf.Name = "txtrf";
|
||||
this.txtrf.Size = new System.Drawing.Size(56, 23);
|
||||
this.txtrf.TabIndex = 27;
|
||||
this.txtrf.Text = "00000000";
|
||||
//
|
||||
// _lblrf
|
||||
//
|
||||
this._lblrf.AutoSize = true;
|
||||
this._lblrf.Location = new System.Drawing.Point(124, 232);
|
||||
this._lblrf.Name = "_lblrf";
|
||||
this._lblrf.Size = new System.Drawing.Size(39, 15);
|
||||
this._lblrf.TabIndex = 34;
|
||||
this._lblrf.Text = "Reg F:";
|
||||
//
|
||||
// txtr8
|
||||
//
|
||||
this.txtr8.Enabled = false;
|
||||
this.txtr8.Location = new System.Drawing.Point(168, 27);
|
||||
this.txtr8.Name = "txtr8";
|
||||
this.txtr8.Size = new System.Drawing.Size(56, 23);
|
||||
this.txtr8.TabIndex = 20;
|
||||
this.txtr8.Text = "00000000";
|
||||
//
|
||||
// _lblre
|
||||
//
|
||||
this._lblre.AutoSize = true;
|
||||
this._lblre.Location = new System.Drawing.Point(124, 203);
|
||||
this._lblre.Name = "_lblre";
|
||||
this._lblre.Size = new System.Drawing.Size(39, 15);
|
||||
this._lblre.TabIndex = 33;
|
||||
this._lblre.Text = "Reg E:";
|
||||
//
|
||||
// txtr9
|
||||
//
|
||||
this.txtr9.Enabled = false;
|
||||
this.txtr9.Location = new System.Drawing.Point(168, 55);
|
||||
this.txtr9.Name = "txtr9";
|
||||
this.txtr9.Size = new System.Drawing.Size(56, 23);
|
||||
this.txtr9.TabIndex = 21;
|
||||
this.txtr9.Text = "00000000";
|
||||
//
|
||||
// _lblrd
|
||||
//
|
||||
this._lblrd.AutoSize = true;
|
||||
this._lblrd.Location = new System.Drawing.Point(124, 174);
|
||||
this._lblrd.Name = "_lblrd";
|
||||
this._lblrd.Size = new System.Drawing.Size(41, 15);
|
||||
this._lblrd.TabIndex = 32;
|
||||
this._lblrd.Text = "Reg D:";
|
||||
//
|
||||
// txtra
|
||||
//
|
||||
this.txtra.Enabled = false;
|
||||
this.txtra.Location = new System.Drawing.Point(168, 84);
|
||||
this.txtra.Name = "txtra";
|
||||
this.txtra.Size = new System.Drawing.Size(56, 23);
|
||||
this.txtra.TabIndex = 22;
|
||||
this.txtra.Text = "00000000";
|
||||
//
|
||||
// _lblrb
|
||||
//
|
||||
this._lblrb.AutoSize = true;
|
||||
this._lblrb.Location = new System.Drawing.Point(123, 116);
|
||||
this._lblrb.Name = "_lblrb";
|
||||
this._lblrb.Size = new System.Drawing.Size(40, 15);
|
||||
this._lblrb.TabIndex = 31;
|
||||
this._lblrb.Text = "Reg B:";
|
||||
//
|
||||
// txtrb
|
||||
//
|
||||
this.txtrb.Enabled = false;
|
||||
this.txtrb.Location = new System.Drawing.Point(168, 113);
|
||||
this.txtrb.Name = "txtrb";
|
||||
this.txtrb.Size = new System.Drawing.Size(56, 23);
|
||||
this.txtrb.TabIndex = 23;
|
||||
this.txtrb.Text = "00000000";
|
||||
//
|
||||
// _lblra
|
||||
//
|
||||
this._lblra.AutoSize = true;
|
||||
this._lblra.Location = new System.Drawing.Point(123, 87);
|
||||
this._lblra.Name = "_lblra";
|
||||
this._lblra.Size = new System.Drawing.Size(41, 15);
|
||||
this._lblra.TabIndex = 30;
|
||||
this._lblra.Text = "Reg A:";
|
||||
//
|
||||
// txtrc
|
||||
//
|
||||
this.txtrc.Enabled = false;
|
||||
this.txtrc.Location = new System.Drawing.Point(168, 142);
|
||||
this.txtrc.Name = "txtrc";
|
||||
this.txtrc.Size = new System.Drawing.Size(56, 23);
|
||||
this.txtrc.TabIndex = 24;
|
||||
this.txtrc.Text = "00000000";
|
||||
//
|
||||
// _lblr9
|
||||
//
|
||||
this._lblr9.AutoSize = true;
|
||||
this._lblr9.Location = new System.Drawing.Point(123, 58);
|
||||
this._lblr9.Name = "_lblr9";
|
||||
this._lblr9.Size = new System.Drawing.Size(39, 15);
|
||||
this._lblr9.TabIndex = 29;
|
||||
this._lblr9.Text = "Reg 9:";
|
||||
//
|
||||
// txtrd
|
||||
//
|
||||
this.txtrd.Enabled = false;
|
||||
this.txtrd.Location = new System.Drawing.Point(168, 171);
|
||||
this.txtrd.Name = "txtrd";
|
||||
this.txtrd.Size = new System.Drawing.Size(56, 23);
|
||||
this.txtrd.TabIndex = 25;
|
||||
this.txtrd.Text = "00000000";
|
||||
//
|
||||
// _lblr8
|
||||
//
|
||||
this._lblr8.AutoSize = true;
|
||||
this._lblr8.Location = new System.Drawing.Point(123, 30);
|
||||
this._lblr8.Name = "_lblr8";
|
||||
this._lblr8.Size = new System.Drawing.Size(39, 15);
|
||||
this._lblr8.TabIndex = 28;
|
||||
this._lblr8.Text = "Reg 8:";
|
||||
//
|
||||
// txtre
|
||||
//
|
||||
this.txtre.Enabled = false;
|
||||
this.txtre.Location = new System.Drawing.Point(168, 200);
|
||||
this.txtre.Name = "txtre";
|
||||
this.txtre.Size = new System.Drawing.Size(56, 23);
|
||||
this.txtre.TabIndex = 26;
|
||||
this.txtre.Text = "00000000";
|
||||
//
|
||||
// txtrInstReg
|
||||
//
|
||||
this.txtrInstReg.Enabled = false;
|
||||
this.txtrInstReg.Location = new System.Drawing.Point(287, 229);
|
||||
this.txtrInstReg.Name = "txtrInstReg";
|
||||
this.txtrInstReg.Size = new System.Drawing.Size(106, 23);
|
||||
this.txtrInstReg.TabIndex = 19;
|
||||
this.txtrInstReg.Text = "0000000000000000";
|
||||
//
|
||||
// _lblIR
|
||||
//
|
||||
this._lblIR.AutoSize = true;
|
||||
this._lblIR.Location = new System.Drawing.Point(284, 211);
|
||||
this._lblIR.Name = "_lblIR";
|
||||
this._lblIR.Size = new System.Drawing.Size(109, 15);
|
||||
this._lblIR.TabIndex = 18;
|
||||
this._lblIR.Text = "Instruction register:";
|
||||
//
|
||||
// txtProgCounter
|
||||
//
|
||||
this.txtProgCounter.Enabled = false;
|
||||
this.txtProgCounter.Location = new System.Drawing.Point(287, 48);
|
||||
this.txtProgCounter.Name = "txtProgCounter";
|
||||
this.txtProgCounter.Size = new System.Drawing.Size(56, 23);
|
||||
this.txtProgCounter.TabIndex = 17;
|
||||
this.txtProgCounter.Text = "00000000";
|
||||
//
|
||||
// _lblPC
|
||||
//
|
||||
this._lblPC.AutoSize = true;
|
||||
this._lblPC.Location = new System.Drawing.Point(287, 30);
|
||||
this._lblPC.Name = "_lblPC";
|
||||
this._lblPC.Size = new System.Drawing.Size(100, 15);
|
||||
this._lblPC.TabIndex = 16;
|
||||
this._lblPC.Text = "Program counter:";
|
||||
//
|
||||
// _lblr7
|
||||
//
|
||||
this._lblr7.AutoSize = true;
|
||||
this._lblr7.Location = new System.Drawing.Point(16, 232);
|
||||
this._lblr7.Name = "_lblr7";
|
||||
this._lblr7.Size = new System.Drawing.Size(39, 15);
|
||||
this._lblr7.TabIndex = 15;
|
||||
this._lblr7.Text = "Reg 7:";
|
||||
//
|
||||
// txtr7
|
||||
//
|
||||
this.txtr7.Enabled = false;
|
||||
this.txtr7.Location = new System.Drawing.Point(61, 229);
|
||||
this.txtr7.Name = "txtr7";
|
||||
this.txtr7.Size = new System.Drawing.Size(56, 23);
|
||||
this.txtr7.TabIndex = 7;
|
||||
this.txtr7.Text = "00000000";
|
||||
//
|
||||
// _lblr6
|
||||
//
|
||||
this._lblr6.AutoSize = true;
|
||||
this._lblr6.Location = new System.Drawing.Point(16, 203);
|
||||
this._lblr6.Name = "_lblr6";
|
||||
this._lblr6.Size = new System.Drawing.Size(39, 15);
|
||||
this._lblr6.TabIndex = 14;
|
||||
this._lblr6.Text = "Reg 6:";
|
||||
//
|
||||
// txtr0
|
||||
//
|
||||
this.txtr0.Enabled = false;
|
||||
this.txtr0.Location = new System.Drawing.Point(61, 27);
|
||||
this.txtr0.Name = "txtr0";
|
||||
this.txtr0.Size = new System.Drawing.Size(56, 23);
|
||||
this.txtr0.TabIndex = 0;
|
||||
this.txtr0.Text = "00000000";
|
||||
//
|
||||
// _lblr5
|
||||
//
|
||||
this._lblr5.AutoSize = true;
|
||||
this._lblr5.Location = new System.Drawing.Point(16, 174);
|
||||
this._lblr5.Name = "_lblr5";
|
||||
this._lblr5.Size = new System.Drawing.Size(39, 15);
|
||||
this._lblr5.TabIndex = 13;
|
||||
this._lblr5.Text = "Reg 5:";
|
||||
//
|
||||
// txtr1
|
||||
//
|
||||
this.txtr1.Enabled = false;
|
||||
this.txtr1.Location = new System.Drawing.Point(61, 55);
|
||||
this.txtr1.Name = "txtr1";
|
||||
this.txtr1.Size = new System.Drawing.Size(56, 23);
|
||||
this.txtr1.TabIndex = 1;
|
||||
this.txtr1.Text = "00000000";
|
||||
//
|
||||
// _lblr4
|
||||
//
|
||||
this._lblr4.AutoSize = true;
|
||||
this._lblr4.Location = new System.Drawing.Point(16, 145);
|
||||
this._lblr4.Name = "_lblr4";
|
||||
this._lblr4.Size = new System.Drawing.Size(39, 15);
|
||||
this._lblr4.TabIndex = 12;
|
||||
this._lblr4.Text = "Reg 4:";
|
||||
//
|
||||
// txtr2
|
||||
//
|
||||
this.txtr2.Enabled = false;
|
||||
this.txtr2.Location = new System.Drawing.Point(61, 84);
|
||||
this.txtr2.Name = "txtr2";
|
||||
this.txtr2.Size = new System.Drawing.Size(56, 23);
|
||||
this.txtr2.TabIndex = 2;
|
||||
this.txtr2.Text = "00000000";
|
||||
//
|
||||
// _lblr3
|
||||
//
|
||||
this._lblr3.AutoSize = true;
|
||||
this._lblr3.Location = new System.Drawing.Point(16, 116);
|
||||
this._lblr3.Name = "_lblr3";
|
||||
this._lblr3.Size = new System.Drawing.Size(39, 15);
|
||||
this._lblr3.TabIndex = 11;
|
||||
this._lblr3.Text = "Reg 3:";
|
||||
//
|
||||
// txtr3
|
||||
//
|
||||
this.txtr3.Enabled = false;
|
||||
this.txtr3.Location = new System.Drawing.Point(61, 113);
|
||||
this.txtr3.Name = "txtr3";
|
||||
this.txtr3.Size = new System.Drawing.Size(56, 23);
|
||||
this.txtr3.TabIndex = 3;
|
||||
this.txtr3.Text = "00000000";
|
||||
//
|
||||
// _lblr2
|
||||
//
|
||||
this._lblr2.AutoSize = true;
|
||||
this._lblr2.Location = new System.Drawing.Point(16, 87);
|
||||
this._lblr2.Name = "_lblr2";
|
||||
this._lblr2.Size = new System.Drawing.Size(39, 15);
|
||||
this._lblr2.TabIndex = 10;
|
||||
this._lblr2.Text = "Reg 2:";
|
||||
//
|
||||
// txtr4
|
||||
//
|
||||
this.txtr4.Enabled = false;
|
||||
this.txtr4.Location = new System.Drawing.Point(61, 142);
|
||||
this.txtr4.Name = "txtr4";
|
||||
this.txtr4.Size = new System.Drawing.Size(56, 23);
|
||||
this.txtr4.TabIndex = 4;
|
||||
this.txtr4.Text = "00000000";
|
||||
//
|
||||
// _lblr1
|
||||
//
|
||||
this._lblr1.AutoSize = true;
|
||||
this._lblr1.Location = new System.Drawing.Point(16, 58);
|
||||
this._lblr1.Name = "_lblr1";
|
||||
this._lblr1.Size = new System.Drawing.Size(39, 15);
|
||||
this._lblr1.TabIndex = 9;
|
||||
this._lblr1.Text = "Reg 1:";
|
||||
//
|
||||
// txtr5
|
||||
//
|
||||
this.txtr5.Enabled = false;
|
||||
this.txtr5.Location = new System.Drawing.Point(61, 171);
|
||||
this.txtr5.Name = "txtr5";
|
||||
this.txtr5.Size = new System.Drawing.Size(56, 23);
|
||||
this.txtr5.TabIndex = 5;
|
||||
this.txtr5.Text = "00000000";
|
||||
//
|
||||
// _lblr0
|
||||
//
|
||||
this._lblr0.AutoSize = true;
|
||||
this._lblr0.Location = new System.Drawing.Point(16, 30);
|
||||
this._lblr0.Name = "_lblr0";
|
||||
this._lblr0.Size = new System.Drawing.Size(39, 15);
|
||||
this._lblr0.TabIndex = 8;
|
||||
this._lblr0.Text = "Reg 0:";
|
||||
//
|
||||
// txtr6
|
||||
//
|
||||
this.txtr6.Enabled = false;
|
||||
this.txtr6.Location = new System.Drawing.Point(61, 200);
|
||||
this.txtr6.Name = "txtr6";
|
||||
this.txtr6.Size = new System.Drawing.Size(56, 23);
|
||||
this.txtr6.TabIndex = 6;
|
||||
this.txtr6.Text = "00000000";
|
||||
//
|
||||
// groupBox3
|
||||
//
|
||||
this.groupBox3.Controls.Add(this.ramList);
|
||||
this.groupBox3.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.groupBox3.Location = new System.Drawing.Point(0, 0);
|
||||
this.groupBox3.Name = "groupBox3";
|
||||
this.groupBox3.Size = new System.Drawing.Size(205, 450);
|
||||
this.groupBox3.TabIndex = 1;
|
||||
this.groupBox3.TabStop = false;
|
||||
this.groupBox3.Text = "RAM";
|
||||
//
|
||||
// ramList
|
||||
//
|
||||
this.ramList.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.ramList.FormattingEnabled = true;
|
||||
this.ramList.ItemHeight = 15;
|
||||
this.ramList.Items.AddRange(new object[] {
|
||||
"00000000: 00000000",
|
||||
"00000001: 00000000"});
|
||||
this.ramList.Location = new System.Drawing.Point(3, 19);
|
||||
this.ramList.Name = "ramList";
|
||||
this.ramList.Size = new System.Drawing.Size(199, 428);
|
||||
this.ramList.TabIndex = 0;
|
||||
//
|
||||
// MainForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(967, 450);
|
||||
this.Controls.Add(this.splitContainer1);
|
||||
this.Cursor = System.Windows.Forms.Cursors.Arrow;
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||
this.MaximizeBox = false;
|
||||
this.Name = "MainForm";
|
||||
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
|
||||
this.Text = "Vole by ferityigitbalaban";
|
||||
this.Load += new System.EventHandler(this.MainForm_Load);
|
||||
this.splitContainer1.Panel1.ResumeLayout(false);
|
||||
this.splitContainer1.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
|
||||
this.splitContainer1.ResumeLayout(false);
|
||||
this.groupBox2.ResumeLayout(false);
|
||||
this.groupBox2.PerformLayout();
|
||||
this.groupBox6.ResumeLayout(false);
|
||||
this.groupBox6.PerformLayout();
|
||||
this.splitContainer2.Panel1.ResumeLayout(false);
|
||||
this.splitContainer2.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
|
||||
this.splitContainer2.ResumeLayout(false);
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.splitContainer3.Panel1.ResumeLayout(false);
|
||||
this.splitContainer3.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).EndInit();
|
||||
this.splitContainer3.ResumeLayout(false);
|
||||
this.groupBox4.ResumeLayout(false);
|
||||
this.groupBox4.PerformLayout();
|
||||
this.groupBox5.ResumeLayout(false);
|
||||
this.groupBox5.PerformLayout();
|
||||
this.groupBox3.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.SplitContainer splitContainer1;
|
||||
private System.Windows.Forms.GroupBox groupBox1;
|
||||
private System.Windows.Forms.GroupBox groupBox2;
|
||||
private System.Windows.Forms.SplitContainer splitContainer2;
|
||||
private System.Windows.Forms.GroupBox groupBox3;
|
||||
private System.Windows.Forms.ListBox ramList;
|
||||
private System.Windows.Forms.Button btnStart;
|
||||
private System.Windows.Forms.Button btnHalt;
|
||||
private System.Windows.Forms.Button btnStep;
|
||||
private System.Windows.Forms.SplitContainer splitContainer3;
|
||||
private System.Windows.Forms.GroupBox groupBox4;
|
||||
private System.Windows.Forms.GroupBox groupBox5;
|
||||
private System.Windows.Forms.TextBox txtrInstReg;
|
||||
private System.Windows.Forms.Label _lblIR;
|
||||
private System.Windows.Forms.TextBox txtProgCounter;
|
||||
private System.Windows.Forms.Label _lblPC;
|
||||
private System.Windows.Forms.Label _lblr7;
|
||||
private System.Windows.Forms.TextBox txtr7;
|
||||
private System.Windows.Forms.Label _lblr6;
|
||||
private System.Windows.Forms.TextBox txtr0;
|
||||
private System.Windows.Forms.Label _lblr5;
|
||||
private System.Windows.Forms.TextBox txtr1;
|
||||
private System.Windows.Forms.Label _lblr4;
|
||||
private System.Windows.Forms.TextBox txtr2;
|
||||
private System.Windows.Forms.Label _lblr3;
|
||||
private System.Windows.Forms.TextBox txtr3;
|
||||
private System.Windows.Forms.Label _lblr2;
|
||||
private System.Windows.Forms.TextBox txtr4;
|
||||
private System.Windows.Forms.Label _lblr1;
|
||||
private System.Windows.Forms.TextBox txtr5;
|
||||
private System.Windows.Forms.Label _lblr0;
|
||||
private System.Windows.Forms.TextBox txtr6;
|
||||
private System.Windows.Forms.Label lblOpcodeDesc;
|
||||
private System.Windows.Forms.Label _lblrc;
|
||||
private System.Windows.Forms.TextBox txtrf;
|
||||
private System.Windows.Forms.Label _lblrf;
|
||||
private System.Windows.Forms.TextBox txtr8;
|
||||
private System.Windows.Forms.Label _lblre;
|
||||
private System.Windows.Forms.TextBox txtr9;
|
||||
private System.Windows.Forms.Label _lblrd;
|
||||
private System.Windows.Forms.TextBox txtra;
|
||||
private System.Windows.Forms.Label _lblrb;
|
||||
private System.Windows.Forms.TextBox txtrb;
|
||||
private System.Windows.Forms.Label _lblra;
|
||||
private System.Windows.Forms.TextBox txtrc;
|
||||
private System.Windows.Forms.Label _lblr9;
|
||||
private System.Windows.Forms.TextBox txtrd;
|
||||
private System.Windows.Forms.Label _lblr8;
|
||||
private System.Windows.Forms.TextBox txtre;
|
||||
private System.Windows.Forms.Label lblOpcode;
|
||||
private System.Windows.Forms.Button btnClear;
|
||||
private System.Windows.Forms.Button btnLoad;
|
||||
private System.Windows.Forms.RichTextBox txtCode;
|
||||
private System.Windows.Forms.GroupBox groupBox6;
|
||||
private System.Windows.Forms.Label lblStatus;
|
||||
private System.Windows.Forms.RadioButton radHex;
|
||||
private System.Windows.Forms.RadioButton radBin;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
namespace processor
|
||||
{
|
||||
public partial class MainForm
|
||||
{
|
||||
private void ResolveOpcode(int opcode, int r, int x, int y)
|
||||
{
|
||||
switch (opcode)
|
||||
{
|
||||
case 1:
|
||||
Op1(r, x, y);
|
||||
break;
|
||||
case 2:
|
||||
Op2(r, x, y);
|
||||
break;
|
||||
case 3:
|
||||
Op3(r, x, y);
|
||||
break;
|
||||
case 4:
|
||||
Op4(r, x, y);
|
||||
break;
|
||||
case 5:
|
||||
Op5(r, x, y);
|
||||
break;
|
||||
case 6:
|
||||
Op6(r, x, y);
|
||||
break;
|
||||
case 7:
|
||||
Op7(r, x, y);
|
||||
break;
|
||||
case 8:
|
||||
Op8(r, x, y);
|
||||
break;
|
||||
case 9:
|
||||
Op9(r, x, y);
|
||||
break;
|
||||
case 10:
|
||||
OpA(r, x, y);
|
||||
break;
|
||||
case 11:
|
||||
OpB(r, x, y);
|
||||
break;
|
||||
case 12:
|
||||
OpC(r, x, y);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#region Opcode Methods
|
||||
private void Op1(int r, int x, int y)
|
||||
{
|
||||
lblOpcode.Text = $"0x1";
|
||||
lblOpcodeDesc.Text = Resources._0x1En;
|
||||
}
|
||||
|
||||
private void Op2(int r, int x, int y)
|
||||
{
|
||||
lblOpcode.Text = $"0x2";
|
||||
lblOpcodeDesc.Text = Resources._0x2En;
|
||||
}
|
||||
|
||||
private void Op3(int r, int x, int y)
|
||||
{
|
||||
lblOpcode.Text = $"0x3";
|
||||
lblOpcodeDesc.Text = Resources._0x3En;
|
||||
}
|
||||
|
||||
private void Op4(int r, int x, int y)
|
||||
{
|
||||
lblOpcode.Text = $"0x4";
|
||||
lblOpcodeDesc.Text = Resources._0x4En;
|
||||
}
|
||||
|
||||
private void Op5(int r, int x, int y)
|
||||
{
|
||||
lblOpcode.Text = $"0x5";
|
||||
lblOpcodeDesc.Text = Resources._0x5En;
|
||||
}
|
||||
|
||||
private void Op6(int r, int x, int y)
|
||||
{
|
||||
lblOpcode.Text = $"0x6";
|
||||
lblOpcodeDesc.Text = Resources._0x6En;
|
||||
}
|
||||
|
||||
private void Op7(int r, int x, int y)
|
||||
{
|
||||
lblOpcode.Text = $"0x7";
|
||||
lblOpcodeDesc.Text = Resources._0x7En;
|
||||
}
|
||||
|
||||
private void Op8(int r, int x, int y)
|
||||
{
|
||||
lblOpcode.Text = $"0x8";
|
||||
lblOpcodeDesc.Text = Resources._0x8En;
|
||||
}
|
||||
|
||||
private void Op9(int r, int x, int y)
|
||||
{
|
||||
lblOpcode.Text = $"0x9";
|
||||
lblOpcodeDesc.Text = Resources._0x9En;
|
||||
}
|
||||
|
||||
private void OpA(int r, int x, int y)
|
||||
{
|
||||
lblOpcode.Text = $"0xA";
|
||||
lblOpcodeDesc.Text = Resources._0xAEn;
|
||||
}
|
||||
|
||||
private void OpB(int r, int x, int y)
|
||||
{
|
||||
lblOpcode.Text = $"0xB";
|
||||
lblOpcodeDesc.Text = Resources._0xBEn;
|
||||
}
|
||||
|
||||
private void OpC(int r, int x, int y)
|
||||
{
|
||||
lblOpcode.Text = $"0xC";
|
||||
lblOpcodeDesc.Text = Resources._0xCEn;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
+186
@@ -0,0 +1,186 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Reflection.Emit;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
using processor.Properties;
|
||||
|
||||
using static processor.Extensions;
|
||||
|
||||
namespace processor
|
||||
{
|
||||
public partial class MainForm : Form
|
||||
{
|
||||
public MainForm() => InitializeComponent();
|
||||
|
||||
private void MainForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
InitializeRamList();
|
||||
InitializeCpu();
|
||||
}
|
||||
|
||||
private void InitializeRamList()
|
||||
{
|
||||
ramList.Items.Clear();
|
||||
if (radHex.Checked is true)
|
||||
for (int i = 0; i < 256; i++)
|
||||
ramList.Items.Add(string.Format("{0}: {1}", Convert.ToString(i, 16).PadLeft(2, '0').ToUpper(), "00"));
|
||||
else
|
||||
for (int i = 0; i < 256; i++)
|
||||
ramList.Items.Add(string.Format("{0}: {1}", Convert.ToString(i, 2).PadLeft(8, '0'), "00000000"));
|
||||
}
|
||||
|
||||
private void InitializeCpu()
|
||||
{
|
||||
if (radHex.Checked is true)
|
||||
{
|
||||
txtrInstReg.Text = "00";
|
||||
txtProgCounter.Text = "00";
|
||||
for (int i = 0; i < 16; i++)
|
||||
Controls.Find($"txtr{i:x}", true)[0].Text = "00";
|
||||
}
|
||||
else
|
||||
{
|
||||
txtrInstReg.Text = "00000000";
|
||||
txtProgCounter.Text = "00000000";
|
||||
for (int i = 0; i < 16; i++)
|
||||
Controls.Find($"txtr{i:x}", true)[0].Text = "00000000";
|
||||
}
|
||||
}
|
||||
|
||||
#region RAM
|
||||
/// <summary>
|
||||
/// Returns data as integers hold in addressed memory cell
|
||||
/// </summary>
|
||||
/// <param name="address"></param>
|
||||
/// <returns></returns>
|
||||
private int ReadRam(int address) => CnvRespectfully(ramList.Items[address].ToString().Split(':', StringSplitOptions.TrimEntries)[1]);
|
||||
|
||||
/// <summary>
|
||||
/// Reads the amount of memory cells supplied in "count", starts reading from "address". 0 for count only reads addressed memory, 1 reads addressed and next cell
|
||||
/// </summary>
|
||||
/// <param name="address"></param>
|
||||
/// <param name="count"></param>
|
||||
/// <returns></returns>
|
||||
private int ReadRam(int address, int count = 0)
|
||||
{
|
||||
string append = string.Empty;
|
||||
for (int i = 0; i <= count; i++)
|
||||
append += ramList.Items[address + i].ToString().Split(':', StringSplitOptions.TrimEntries)[1];
|
||||
return CnvRespectfully(append);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Used by loader for writing hexadecimal/binary instructions
|
||||
/// </summary>
|
||||
/// <param name="address"></param>
|
||||
/// <param name="hexValue"></param>
|
||||
private void LoadProgram(int address, string value) => ramList.Items[address] = $"{CnvRespectfully(address)}: {value}";
|
||||
|
||||
/// <summary>
|
||||
/// Write data to addressed memory cell
|
||||
/// </summary>
|
||||
/// <param name="address"></param>
|
||||
/// <param name="value"></param>
|
||||
private void WriteRam(int address, int value) => ramList.Items[address] = $"{CnvRespectfully(address)}: {CnvRespectfully(value)}";
|
||||
#endregion
|
||||
|
||||
#region Registers
|
||||
|
||||
private int ReadRegister(int address) => CnvRespectfully(Controls.Find($"txtr{address:x}".ToLower(), true)[0].Text);
|
||||
|
||||
private void WriteRegister(int address, int value) => Controls.Find($"txtr{address:x}".ToLower(), true)[0].Text = CnvRespectfully(value);
|
||||
|
||||
private int ReadCounter() => CnvRespectfully(txtProgCounter.Text);
|
||||
|
||||
private void SetCounter(int value)
|
||||
{
|
||||
txtProgCounter.Text = CnvRespectfully(value);
|
||||
SetInstRegister(ReadRam(ReadCounter(), 1));
|
||||
}
|
||||
|
||||
private int[] ReadInstRegister()
|
||||
{
|
||||
int[] r = new int[4];
|
||||
string[] a = radHex.Checked ? txtrInstReg.Text.Split1() : txtrInstReg.Text.Split4().ToArray();
|
||||
for (int i = 0; i < 4; i++)
|
||||
r[i] = CnvRespectfully(a[i]);
|
||||
return r;
|
||||
}
|
||||
|
||||
private void SetInstRegister(int value) => txtrInstReg.Text = CnvRespectfully4(value);
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Converts integer to hexadecimal or binary representation in text according to selected view mode
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
private string CnvRespectfully(int value) => radHex.Checked ? Convert.ToString(value, 16).PadLeft(2, '0').ToUpper() : Convert.ToString(value, 2).PadLeft(8, '0');
|
||||
|
||||
private string CnvRespectfully4(int value) => radHex.Checked ? Convert.ToString(value, 16).PadLeft(4, '0').ToUpper() : Convert.ToString(value, 2).PadLeft(8, '0');
|
||||
|
||||
private string CnvRespectfully(int value, int hexPad = 2, int binPad = 8) => radHex.Checked ? Convert.ToString(value, 16).PadLeft(hexPad, '0').ToUpper() : Convert.ToString(value, 2).PadLeft(binPad, '0');
|
||||
|
||||
/// <summary>
|
||||
/// Converts hexadecimal or binary representation to integer according to selected view mode
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
private int CnvRespectfully(string value) => radHex.Checked ? Convert.ToInt32(value, 16) : Convert.ToInt32(value, 2);
|
||||
|
||||
private string AppendOperand(int x, int y) => radHex.Checked ? CnvRespectfully((x * 16) + y, 2, 8) : CnvRespectfully(5, 2, 4) + CnvRespectfully(3, 2, 4);
|
||||
|
||||
/// <summary>
|
||||
/// Parses and loads instructions to ramList
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void btnLoad_Click(object sender, EventArgs e)
|
||||
{
|
||||
List<string> instructionList = new();
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(txtCode.Text))
|
||||
{
|
||||
List<string> inputLines = txtCode.Text.Trim().Split((char)10, StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries).ToList();
|
||||
inputLines = (from x in inputLines select RemoveComment(x)).ToList(); // removes comments from lines
|
||||
instructionList = (from x in inputLines where string.IsNullOrEmpty(x) is false select x).ToList(); // drops empty elements
|
||||
}
|
||||
|
||||
if (radHex.Checked is true)
|
||||
{
|
||||
instructionList = (from x in instructionList select RemoveLeading(x)).ToList();
|
||||
int j = 0;
|
||||
for (int i = 0; i < instructionList.Count; i++)
|
||||
{
|
||||
string[] enm = instructionList[i].Split2().ToArray();
|
||||
LoadProgram(j, enm[0]);
|
||||
LoadProgram(j+1, enm[1]);
|
||||
j += 2;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void btnClear_Click(object sender, EventArgs e) => InitializeRamList();
|
||||
|
||||
private void btnStart_Click(object sender, EventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
private void btnStep_Click(object sender, EventArgs e)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
<root>
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace processor
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
Application.SetHighDpiMode(HighDpiMode.SystemAware);
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new MainForm());
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+217
@@ -0,0 +1,217 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// Bu kod araç tarafından oluşturuldu.
|
||||
// Çalışma Zamanı Sürümü:4.0.30319.42000
|
||||
//
|
||||
// Bu dosyada yapılacak değişiklikler yanlış davranışa neden olabilir ve
|
||||
// kod yeniden oluşturulursa kaybolur.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace processor.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Yerelleştirilmiş dizeleri aramak gibi işlemler için, türü kesin olarak belirtilmiş kaynak sınıfı.
|
||||
/// </summary>
|
||||
// Bu sınıf ResGen veya Visual Studio gibi bir araç kullanılarak StronglyTypedResourceBuilder
|
||||
// sınıfı tarafından otomatik olarak oluşturuldu.
|
||||
// Üye eklemek veya kaldırmak için .ResX dosyanızı düzenleyin ve sonra da ResGen
|
||||
// komutunu /str seçeneğiyle yeniden çalıştırın veya VS projenizi yeniden oluşturun.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Bu sınıf tarafından kullanılan, önbelleğe alınmış ResourceManager örneğini döndürür.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("processor.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tümü için geçerli iş parçacığının CurrentUICulture özelliğini geçersiz kular
|
||||
/// CurrentUICulture özelliğini tüm kaynak aramaları için geçersiz kılar.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// LOAD the register R with the bit pattern found in the
|
||||
///memory cell whose address is XY.
|
||||
///Example: 0x14A3 would cause the contents of the memory
|
||||
///cell located at address 0xA3 to be placed in register 0x4. benzeri yerelleştirilmiş bir dize arar.
|
||||
/// </summary>
|
||||
internal static string _0x1En {
|
||||
get {
|
||||
return ResourceManager.GetString("0x1En", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// LOAD the register R with the bit pattern XY.
|
||||
///Example: 0x20A3 would cause the value 0xA3 to be
|
||||
///placed in register 0. benzeri yerelleştirilmiş bir dize arar.
|
||||
/// </summary>
|
||||
internal static string _0x2En {
|
||||
get {
|
||||
return ResourceManager.GetString("0x2En", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// STORE the bit pattern found in register R in the memory
|
||||
///cell whose address is XY.
|
||||
///Example: 0x35B1 would cause the contents of register
|
||||
///0x5 to be placed in the memory cell whose address is
|
||||
///0xB1. benzeri yerelleştirilmiş bir dize arar.
|
||||
/// </summary>
|
||||
internal static string _0x3En {
|
||||
get {
|
||||
return ResourceManager.GetString("0x3En", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// MOVE the bit pattern found in register R to register S.
|
||||
///Example: 0x40A4 would cause the contents of register
|
||||
///0xA to be copied into register 0x4. benzeri yerelleştirilmiş bir dize arar.
|
||||
/// </summary>
|
||||
internal static string _0x4En {
|
||||
get {
|
||||
return ResourceManager.GetString("0x4En", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ADD the bit patterns in registers S and T as though they
|
||||
///were two’s complement representations and leave the
|
||||
///result in register R.
|
||||
///Example: 0x5726 would cause the binary values in registers 0x2 and 0x6 to be added and the sum placed in
|
||||
///register 0x7. benzeri yerelleştirilmiş bir dize arar.
|
||||
/// </summary>
|
||||
internal static string _0x5En {
|
||||
get {
|
||||
return ResourceManager.GetString("0x5En", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ADD the bit patterns in registers S and T as though they
|
||||
///represented values in floating-point notation and leave
|
||||
///the floating-point result in register R.
|
||||
///Example: 0x634E would cause the values in registers 0x4
|
||||
///and 0xE to be added as floating-point values and the
|
||||
///result to be placed in register 0x3. benzeri yerelleştirilmiş bir dize arar.
|
||||
/// </summary>
|
||||
internal static string _0x6En {
|
||||
get {
|
||||
return ResourceManager.GetString("0x6En", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// OR the bit patterns in registers S and T and place the
|
||||
///result in register R.
|
||||
///Example: 0x7CB4 would cause the result of ORing the
|
||||
///contents of registers 0xB and 0x4 to be placed in register
|
||||
///0xC. benzeri yerelleştirilmiş bir dize arar.
|
||||
/// </summary>
|
||||
internal static string _0x7En {
|
||||
get {
|
||||
return ResourceManager.GetString("0x7En", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// AND the bit patterns in registers S and T and place the
|
||||
///result in register R.
|
||||
///Example: 0x8045 would cause the result of ANDing the
|
||||
///contents of registers 0x4 and 0x5 to be placed in register
|
||||
///0x0. benzeri yerelleştirilmiş bir dize arar.
|
||||
/// </summary>
|
||||
internal static string _0x8En {
|
||||
get {
|
||||
return ResourceManager.GetString("0x8En", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// XOR the bit patterns in registers S and T and place the
|
||||
///result in register R.
|
||||
///Example: 0x95F3 would cause the result of XORing the
|
||||
///contents of registers 0xF and 0x3 to be placed in register
|
||||
///0x5. benzeri yerelleştirilmiş bir dize arar.
|
||||
/// </summary>
|
||||
internal static string _0x9En {
|
||||
get {
|
||||
return ResourceManager.GetString("0x9En", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ROTATE the bit pattern in register R one bit to the right
|
||||
///X times. Each time, place the bit that started at the loworder end at the high-order end.
|
||||
///Example: 0xA403 would cause the contents of register
|
||||
///0x4 to be rotated 3 bits to the right in a circular fashion. benzeri yerelleştirilmiş bir dize arar.
|
||||
/// </summary>
|
||||
internal static string _0xAEn {
|
||||
get {
|
||||
return ResourceManager.GetString("0xAEn", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// JUMP to the instruction located in the memory cell at
|
||||
///address XY if the bit pattern in register R is equal to the
|
||||
///bit pattern in register number 0. Otherwise, continue
|
||||
///with the normal sequence of execution. (The jump is
|
||||
///implemented by copying XY into the program counter
|
||||
///during the execute phase.)
|
||||
///Example: 0xB43C would first compare the contents of
|
||||
///register 0x4 with the contents of register 0x0. If the two
|
||||
///were equal, the pattern 0x3C would be placed in the
|
||||
///program counter so that the next instructi [dizenin kalan bölümü kesildi]"; benzeri yerelleştirilmiş bir dize arar.
|
||||
/// </summary>
|
||||
internal static string _0xBEn {
|
||||
get {
|
||||
return ResourceManager.GetString("0xBEn", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// HALT execution.
|
||||
///Example: 0xC000 would cause program execution to
|
||||
///stop. benzeri yerelleştirilmiş bir dize arar.
|
||||
/// </summary>
|
||||
internal static string _0xCEn {
|
||||
get {
|
||||
return ResourceManager.GetString("0xCEn", resourceCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,204 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="0x1En" xml:space="preserve">
|
||||
<value>LOAD the register R with the bit pattern found in the
|
||||
memory cell whose address is XY.
|
||||
Example: 0x14A3 would cause the contents of the memory
|
||||
cell located at address 0xA3 to be placed in register 0x4.</value>
|
||||
</data>
|
||||
<data name="0x2En" xml:space="preserve">
|
||||
<value>LOAD the register R with the bit pattern XY.
|
||||
Example: 0x20A3 would cause the value 0xA3 to be
|
||||
placed in register 0.</value>
|
||||
</data>
|
||||
<data name="0x3En" xml:space="preserve">
|
||||
<value>STORE the bit pattern found in register R in the memory
|
||||
cell whose address is XY.
|
||||
Example: 0x35B1 would cause the contents of register
|
||||
0x5 to be placed in the memory cell whose address is
|
||||
0xB1.</value>
|
||||
</data>
|
||||
<data name="0x4En" xml:space="preserve">
|
||||
<value>MOVE the bit pattern found in register R to register S.
|
||||
Example: 0x40A4 would cause the contents of register
|
||||
0xA to be copied into register 0x4.</value>
|
||||
</data>
|
||||
<data name="0x5En" xml:space="preserve">
|
||||
<value>ADD the bit patterns in registers S and T as though they
|
||||
were two’s complement representations and leave the
|
||||
result in register R.
|
||||
Example: 0x5726 would cause the binary values in registers 0x2 and 0x6 to be added and the sum placed in
|
||||
register 0x7.</value>
|
||||
</data>
|
||||
<data name="0x6En" xml:space="preserve">
|
||||
<value>ADD the bit patterns in registers S and T as though they
|
||||
represented values in floating-point notation and leave
|
||||
the floating-point result in register R.
|
||||
Example: 0x634E would cause the values in registers 0x4
|
||||
and 0xE to be added as floating-point values and the
|
||||
result to be placed in register 0x3.</value>
|
||||
</data>
|
||||
<data name="0x7En" xml:space="preserve">
|
||||
<value>OR the bit patterns in registers S and T and place the
|
||||
result in register R.
|
||||
Example: 0x7CB4 would cause the result of ORing the
|
||||
contents of registers 0xB and 0x4 to be placed in register
|
||||
0xC.</value>
|
||||
</data>
|
||||
<data name="0x8En" xml:space="preserve">
|
||||
<value>AND the bit patterns in registers S and T and place the
|
||||
result in register R.
|
||||
Example: 0x8045 would cause the result of ANDing the
|
||||
contents of registers 0x4 and 0x5 to be placed in register
|
||||
0x0.</value>
|
||||
</data>
|
||||
<data name="0x9En" xml:space="preserve">
|
||||
<value>XOR the bit patterns in registers S and T and place the
|
||||
result in register R.
|
||||
Example: 0x95F3 would cause the result of XORing the
|
||||
contents of registers 0xF and 0x3 to be placed in register
|
||||
0x5.</value>
|
||||
</data>
|
||||
<data name="0xAEn" xml:space="preserve">
|
||||
<value>ROTATE the bit pattern in register R one bit to the right
|
||||
X times. Each time, place the bit that started at the loworder end at the high-order end.
|
||||
Example: 0xA403 would cause the contents of register
|
||||
0x4 to be rotated 3 bits to the right in a circular fashion.</value>
|
||||
</data>
|
||||
<data name="0xBEn" xml:space="preserve">
|
||||
<value>JUMP to the instruction located in the memory cell at
|
||||
address XY if the bit pattern in register R is equal to the
|
||||
bit pattern in register number 0. Otherwise, continue
|
||||
with the normal sequence of execution. (The jump is
|
||||
implemented by copying XY into the program counter
|
||||
during the execute phase.)
|
||||
Example: 0xB43C would first compare the contents of
|
||||
register 0x4 with the contents of register 0x0. If the two
|
||||
were equal, the pattern 0x3C would be placed in the
|
||||
program counter so that the next instruction executed
|
||||
would be the one located at that memory address. Otherwise, nothing would be done and program execution
|
||||
would continue in its normal sequence.</value>
|
||||
</data>
|
||||
<data name="0xCEn" xml:space="preserve">
|
||||
<value>HALT execution.
|
||||
Example: 0xC000 would cause program execution to
|
||||
stop.</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -0,0 +1,24 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net5.0-windows</TargetFramework>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Update="Properties\Resources.Designer.cs">
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Update="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
Reference in New Issue
Block a user