diff --git a/SIC Simulator/.gitattributes b/.gitattributes similarity index 100% rename from SIC Simulator/.gitattributes rename to .gitattributes diff --git a/SIC Simulator/.gitignore b/.gitignore similarity index 100% rename from SIC Simulator/.gitignore rename to .gitignore diff --git a/README.md b/README.md index 396cf06..1e2f7c7 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ A SIC Virtual Machine, Emulator Assembler, loader and Linker Release Date | Version | Change(s) ----------------|-----------------------|------------------------------------------------------------------------------------ +08 Nov 2021 | 21.11.08.1 | Fixed Issue with About Dialog where columns were formatted incorrectly 05 Nov 2020 | 20.11.05.1 | Bugfixed issue with exception being thrown when stepping through high memory addresses 04 Nov 2020 | 20.11.04.1 | Bugfixed microcode for JEQ opcode. Bugfixes To Assembler. Improved Memory Display 02 Nov 2020 | 20.11.02.1 | Bugfixed microcode for JSUB opcode. Bugfixed Device Output display. @@ -33,3 +34,8 @@ Riley Strickland | Pass 1 & 2 of SIC Assembler Ellis Levine | Pass 1 & 2 of SIC Assembler Kris Wieben | GUI & VM Testing Brandon Woodrum | Absolute & Relocating SIC Loader +Francisco Romero | Decimal Memory View +Josselyn Munoz | Binary Memory View +Jake McGee | Ascii Memory View +Brittany Santos | Ascii Memory View +Carloes Garciagomez | Ascii Memory View diff --git a/SIC Simulator/Assembler.cs b/SIC Simulator/Assembler.cs deleted file mode 100644 index 758399d..0000000 --- a/SIC Simulator/Assembler.cs +++ /dev/null @@ -1,544 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text.RegularExpressions; -using System.Windows.Forms; - -namespace SIC_Simulator -{ - - // Assigned to Kris Wieben - class Instruction - { - public readonly string Symbol; - public readonly string OpCode; - public readonly string Operand; - public readonly int LineNumber; - public int MemoryAddress; - public Instruction(String Symbol, String OpCode, String Operand, int LineNumber) - { - this.Symbol = Symbol; - this.OpCode = OpCode; - this.Operand = Operand; - this.LineNumber = LineNumber; - } - } - - class ErrorMessage - { - public enum EXCEPTION - { - DUPLICATE_END, - SYMBOL_IN_DIRECTIVE, - SYMBOL_FORMAT, - SYMBOL_DUPLICATE_DECLARATION, - SYMBOL_NOT_DEFINED, - MEMORY_SIZE_, - START_NOT_DEFINED, - BYTE_DELIMITER, - BYTE_HEX_FORMAT, - BYTE_FLAG, - WORD_FORMAT, - WORD_SIZE_, - GENERIC - }; - private readonly EXCEPTION Message; - private readonly string Header = "ASSEMBLER ERROR"; - private readonly string Line; - - public ErrorMessage(string line, EXCEPTION message) - { - Line = line; - Message = message; - } - - private string GetMessage() - { - switch (Message) - { - case EXCEPTION.DUPLICATE_END: - return Header + "ENCOUNTERED END YET ADDITIONAL SCANNING OCCURRED."; - case EXCEPTION.SYMBOL_IN_DIRECTIVE: - return "LABEL {0} IS A DIRECTIVE"; - case EXCEPTION.SYMBOL_FORMAT: - return "LABEL {0} IS A DIRECTIVE"; - case EXCEPTION.SYMBOL_DUPLICATE_DECLARATION: - return "LABEL {0} IS A DIRECTIVE"; - case EXCEPTION.SYMBOL_NOT_DEFINED: - return "LABEL {0} IS A DIRECTIVE"; - case EXCEPTION.MEMORY_SIZE_: - return "LABEL {0} IS A DIRECTIVE"; - case EXCEPTION.START_NOT_DEFINED: - return "LABEL {0} IS A DIRECTIVE"; - case EXCEPTION.BYTE_DELIMITER: - return "LABEL {0} IS A DIRECTIVE"; - case EXCEPTION.BYTE_HEX_FORMAT: - return "LABEL {0} IS A DIRECTIVE"; - case EXCEPTION.BYTE_FLAG: - return "LABEL {0} IS A DIRECTIVE"; - case EXCEPTION.WORD_FORMAT: - return "LABEL {0} IS A DIRECTIVE"; - case EXCEPTION.WORD_SIZE_: - return "LABEL {0} IS A DIRECTIVE"; - case EXCEPTION.GENERIC: - return "LABEL {0} IS A DIRECTIVE"; - default: - return "UNKNOWN ERROR"; - } - } - - public override string ToString() - { - return String.Format(GetMessage(), Header, Line); - } - } - - class Assembler - { - - private static readonly char[] InvalidSymbolCharacters = { ' ', '$', '!', '=', '+', '-', '(', ')', '@' }; - - public static bool IsInstrcution(string who) => Assembler.Instructions.ContainsKey(who); - public static bool IsDirective(string who) => Assembler.Directives.Contains(who); - public static bool IsNotSymbol(string who) - { - if (String.IsNullOrEmpty(who)) - return false; - if (who.Length > 6) - return true; - if (Char.IsDigit(who[0])) - return true; - return InvalidSymbolCharacters.Any(x => who.Contains(x)); //contains any bad characters? TODO: Stricter Checking as C# is UFT-16... - } - - public static readonly Dictionary Instructions = new Dictionary - { - {"ADD", 0x18}, {"ADDF",0x58}, {"ADDR", 0x90}, {"AND", 0x40}, {"CLEAR", 0xB4}, {"COMP", 0x28}, {"COMPF", 0x88}, - {"COMPR", 0xA0}, {"DIV", 0x24}, {"DIVF", 0x64}, {"DIVR", 0x9C}, {"FIX", 0xC4}, {"FLOAT", 0xC0}, {"HIO", 0xC0}, - {"J", 0x3C}, {"JEQ", 0x30}, {"JGT", 0x34}, {"JLT", 0x38}, {"JSUB", 0x48}, {"LDA", 0x00}, {"LDB", 0x68}, {"LDCH", 0x50}, - {"LDF", 0x70}, {"LDL", 0x08}, {"LDS", 0x6C}, {"LDT", 0x74}, {"LDX", 0x04}, {"LPS", 0xD0}, {"MUL", 0x20}, {"MULF", 0x60}, - {"MULR", 0x98}, {"NORM",0xC8}, {"OR",0x44}, {"RD",0xD8}, {"RMO", 0xAC}, {"RSUB", 0x4C}, {"SHIFTL", 0xA4}, {"SHIFTR", 0xA8}, - {"SIO", 0xF0}, {"SSK", 0xEC}, {"STA", 0x0C}, {"STB", 0x78}, {"STCH", 0x54}, {"STF", 0x80}, {"STI", 0xD4}, - {"STL", 0x14}, {"STS", 0x7C}, {"STSW", 0xE8}, {"STT", 0x84}, {"STX", 0x10}, {"SUB", 0x1C}, {"SUBF", 0x5C}, - {"SUBR", 0x94},{"SVC", 0xB0}, {"TD", 0xE0}, {"TIO", 0xF8} ,{"TIX", 0x2C}, {"TIXR", 0xB8},{ "WD", 0xDC} - }; - - public static readonly HashSet Directives = new HashSet { "END", "BYTE", "WORD", "RESB", "RESW", "RESR", "EXPORTS", "START" }; - - - - public string ObjectCode { get; private set; } - public string SICSource { get; private set; } /* let's protect our variables from mutations */ - public string InstructionSource { get; private set; } /* let's protect our variables from mutations */ - - public Dictionary SymbolTable { get; private set; } = new Dictionary(); - public List InstructionList { get; private set; } = new List(); - - private enum PROCESS { INIT, END, START, ERROR } - PROCESS _process = PROCESS.INIT; - public Assembler(string filePath) - { - if (!File.Exists(filePath)) - { - MessageBox.Show($"Input file {Path.GetFileNameWithoutExtension(filePath)} does not exist."); - return; /* todo an error here */ - } - - /* - ______________ - < BEGIN PASS I > - -------------- - */ - StreamReader file = new StreamReader(filePath); - int memory_address = 0, line_counter = 0; - String output = "ASSEMBLY ERROR\n"; // error message header - String line, tmpLine; - pass_one(); - if (_process == PROCESS.ERROR) - { - ObjectCode = ""; - return; - } - - /* - _______________ - < BEGIN PASS II > - --------------- - */ - - Instruction head = InstructionList.First(); - Instruction tail = InstructionList.Last(); - ObjectCode += String.Format("H{0,-6}{1,6:X6}{2,6:X6}\n", head.Symbol, head.MemoryAddress, tail.MemoryAddress - head.MemoryAddress); - memory_address = line_counter = 0; - bool first = true, NotSkipping = true; - memory_address = head.MemoryAddress; - SICSource = ""; - pass_two(); - if (_process == PROCESS.ERROR) - { - ObjectCode = ""; - return; - } - - InstructionSource = String.Format("{0}\t{1}\t{2}\t{3}\t{4}\n", "Line", "Address", "Symbol", "OpCode", "Operand"); - - foreach (Instruction tmp in InstructionList) - { - InstructionSource += String.Format("{0}\t{1}\t{2}\t{3}\t{4}\n", tmp.LineNumber, tmp.MemoryAddress.ToString("X"), tmp.Symbol, tmp.OpCode, tmp.Operand); - } - - void pass_one() - { - while ((line = file.ReadLine()) != null) - { - tmpLine = line; - tmpLine = tmpLine.Trim(); - line_counter++; - - if (String.IsNullOrEmpty(tmpLine) || tmpLine[0] == 35) - { // skip comments and blank lines - continue; - } - - line = Regex.Replace(line, @"\s+(?=([^']*'[^']*')*[^']*$)", "\t"); // clean line for assembler - - if (_process == PROCESS.END) - { - output += String.Format("{0}\nLine {1}: REACHED END DIRECTIVE BUT STILL SCANNING CODE", line, line_counter); - MessageBox.Show(output); - _process = PROCESS.ERROR; - return; - } - - String[] lineArray = line.Split('\t'); - - if (lineArray[0] is null || lineArray[1] is null) - { // something is wrong with the SIC file format - output += String.Format("{0}\nLine {1}: MALFORMED SIC FILE", line, line_counter); - MessageBox.Show(output); - _process = PROCESS.ERROR; - return; - } - - string operand = (lineArray.Length == 2 ) ? "" : lineArray[2]; - Instruction instruction_line = new Instruction(lineArray[0], lineArray[1], operand, line_counter); - - if (instruction_line.Symbol.Length != 0) - { - if (IsDirective(instruction_line.Symbol)) - { - output += String.Format("{0}\nLine {1}: DIRECTIVE IN SYMBOL FIELD", line, line_counter); - MessageBox.Show(output); - _process = PROCESS.ERROR; - return; - } - - if (IsNotSymbol(instruction_line.Symbol)) - { - output += String.Format("{0}\nLine {1}: INVALID SYMBOL", line, line_counter); - MessageBox.Show(output); - _process = PROCESS.ERROR; - return; - } - - if (SymbolTable.ContainsKey(instruction_line.Symbol)) - { - output += String.Format("{0}\nLine {1}: DUPLICATE SYMBOL", line, line_counter); - MessageBox.Show(output); - _process = PROCESS.ERROR; - return; - } - - if (instruction_line.OpCode.Equals("START")) - { - _process = PROCESS.START; - - if (Int32.TryParse(instruction_line.Operand, System.Globalization.NumberStyles.HexNumber, null, out memory_address)) // check if hex value - { - instruction_line.MemoryAddress = memory_address; - if (instruction_line.MemoryAddress >= 32768) - { - //throwError(MEMORY_SIZE_); - } - - SymbolTable.Add(instruction_line.Symbol, instruction_line); - InstructionList.Add(instruction_line); - } - else - { - output += String.Format("{0}\nLine {1}: MALFORMED BYTE FLAG", line, line_counter); - MessageBox.Show(output); - _process = PROCESS.ERROR; - return; - } - - continue; - } - instruction_line.MemoryAddress = memory_address; - SymbolTable.Add(instruction_line.Symbol, instruction_line); - } - - InstructionList.Add(instruction_line); - - // DIDN'T FIND THE START DIRECTIVE ON THE FIRST PASS - if (_process != PROCESS.START) - { - output += String.Format("{0}\nLine {1}:", line, "START DIRECTIVE NOT DEFINED"); - MessageBox.Show(output); - _process = PROCESS.ERROR; - return; - } - - - instruction_line.MemoryAddress = memory_address; - - if (instruction_line.OpCode.Equals("END")) - { - _process = PROCESS.END; - continue; - } - - // START MEMORY INCREASE - int len = 0; // var for numbers.. - if (Instructions.ContainsKey(instruction_line.OpCode)) - { - memory_address += 3; - } - else if (instruction_line.OpCode.Equals("WORD")) - { - if (Int32.TryParse(instruction_line.Operand, out len)) - { - memory_address += 3; - } - else - { - output += String.Format("{0}\nLine {1} CONSTANT {2} FORMAT VALIDATION FAILED:", line, instruction_line.LineNumber, instruction_line.Operand); - MessageBox.Show(output); - _process = PROCESS.ERROR; - return; - } - - //if (len >= MAX_INT_SIZE || len <= MIN_INT_SIZE) // check max int size - // throwError(WORD_SIZE_); - } - else if (instruction_line.OpCode.Equals("RESW")) - { - if (Int32.TryParse(instruction_line.Operand, out len)) - { - memory_address += 3 * len; - } - else - { - output += String.Format("{0}\nLine {1} CONSTANT {2} FORMAT VALIDATION FAILED:", line, instruction_line.LineNumber, instruction_line.Operand); - MessageBox.Show(output); - _process = PROCESS.ERROR; - return; - } - } - else if (instruction_line.OpCode.Equals("BYTE")) - { - len = instruction_line.Operand.Length; - if (instruction_line.Operand[0] == 67) - { // char - //if (isNotByteDelimited(Operand, len)) - // throwError(BYTE_DELIMITER); - memory_address += (len - 3); - } - else if (instruction_line.Operand[0] == 88) - { // hex - //if (isNotByteDelimited(Operand, len)) - // throwError(BYTE_DELIMITER); - - //if (!isHexLiteralStrRange(Operand, 2, len)) - // throwError(BYTE_HEX_FORMAT); - - memory_address += (int)(len - 3) / 2; - } - else - { - output += String.Format("{0}\nLine {1}: UNKOWN BYTE FLAG", line, instruction_line.LineNumber); - MessageBox.Show(output); - _process = PROCESS.ERROR; - return; - } - } - else if (instruction_line.OpCode.Equals("RESB")) - { - if (Int32.TryParse(instruction_line.Operand, out len)) - { - memory_address += len; - } - else - { - output += String.Format("{0}\nLine {1} CONSTANT {2} FORMAT VALIDATION FAILED:", line, instruction_line.LineNumber, instruction_line.Operand); - MessageBox.Show(output); - _process = PROCESS.ERROR; - return; - } - } - else - { - output += String.Format("{0}\nLine {1}: UNKNOWN OPCODE OR DIRECTIVE {2}", line, instruction_line.LineNumber, instruction_line.OpCode); - MessageBox.Show(output); - _process = PROCESS.ERROR; - return; - } - - if (memory_address > 32768) - { - output += String.Format("{0}\nLine {1}: MEMORY ADDRESS EXCEEDS AVILABLE RAM", line, instruction_line.LineNumber); - MessageBox.Show(output); - _process = PROCESS.ERROR; - return; - } - } - } - - void pass_two() - { - foreach (Instruction row in InstructionList) - { - if (first) - { // skip the header record - first = !first; - continue; - } - - if (line_counter == 10) - { // save T record - saveTRecord(row.MemoryAddress); - } - - KeyValuePair OpCode = Instructions.FirstOrDefault(x => x.Key.Equals(row.OpCode)); - if (OpCode.Key != null) - { - setSkippedAddress(row); - String[] indexModeSplit = row.Operand.Split(','); - if (indexModeSplit[0].Length != 0 && !IsNotSymbol(indexModeSplit[0])) - { - KeyValuePair symbol = SymbolTable.FirstOrDefault(x => x.Key.Equals(indexModeSplit[0])); - if (symbol.Key != null) - { - int memoryAddres = symbol.Value.MemoryAddress; - if (indexModeSplit.Length != 1) - {// index mode - memoryAddres += 32768; // set X bit - } - SICSource += String.Format("{0,2:X2}{1,4:X4}", OpCode.Value, memoryAddres); - } - else - { - output += String.Format("{0} {1} {2}\nLine {3}: UNDEFINED SYMBOL {4}", row.Symbol, row.OpCode, row.Operand, row.LineNumber, row.Operand); - MessageBox.Show(output); - _process = PROCESS.ERROR; - return; - } - } - else - { - SICSource += String.Format("{0,2:X2}{1,4:X4}", OpCode.Value, 0); - } - } - else if (row.OpCode.Equals("WORD")) - { - setSkippedAddress(row); - int val = Int32.Parse(row.Operand) & 0xFFFFFF; - SICSource += String.Format("{0,6:X6}", val); - } - else if (row.OpCode.Equals("BYTE")) - { - setSkippedAddress(row); - if (row.Operand[0] == 67) - { // char - String[] tmp = row.Operand.Split('\''); - int counter = 0; - foreach (char ch in tmp[1]) - { - SICSource += String.Format("{0,2:X2}", (byte)ch); - counter++; - if (SICSource.Length == 60) - { - saveTRecord(row.MemoryAddress + counter); - counter = 0; - } - } - line_counter = (int)Math.Ceiling((double)(counter * 2) / 6); - } - else - { // hex - String[] tmp = row.Operand.Split('\''); - SICSource += String.Format("{0}", tmp[1]); - } - } - else if (row.OpCode.Equals("RESB") || row.OpCode.Equals("RESW")) - { - if (NotSkipping) - { - saveTRecord(row.MemoryAddress); - } - else - { - memory_address = row.MemoryAddress; - } - NotSkipping = false; - continue; - } - else if (row.OpCode.Equals("END")) - { - if (NotSkipping) - { // need to handle RESB and RESW directives placed at the bottom of the SIC code - saveTRecord(memory_address); - } - - KeyValuePair symbol = SymbolTable.FirstOrDefault(x => x.Key.Equals(row.Operand)); - if (symbol.Key != null) - { - Instruction firstInstruction = InstructionList.Where(x => x.MemoryAddress >= symbol.Value.MemoryAddress).FirstOrDefault(x => IsInstrcution(x.OpCode)); // lazy mode enabled - if (firstInstruction is null) - { - firstInstruction = head; - } - ObjectCode += String.Format("E{0,6:X6}", firstInstruction.MemoryAddress); // need the first instruction - } - else if (String.IsNullOrEmpty(row.Operand)) - { - ObjectCode += String.Format("E{0,6:X6}", head.MemoryAddress); // oops... this is optional.. defaulting to the start directive - } - else - { - output += String.Format("{0} {1} {2}\nLine {3}: UNDEFINED SYMBOL {4}", row.Symbol, row.OpCode, row.Operand, row.LineNumber, row.Operand); - MessageBox.Show(output); - _process = PROCESS.ERROR; - return; - } - } - - line_counter++; - } - } - - void setSkippedAddress(Instruction row) - { - if (!NotSkipping) - { - memory_address = row.MemoryAddress; - } - NotSkipping = true; - } - - void saveTRecord(int current_address) - { - int lineLength = (int)Math.Ceiling((double)(SICSource.Length / 2)); // count odd length bytes - ObjectCode += String.Format("T{0,6:X6}{1,2:X2}{2}\n", memory_address, lineLength, SICSource); - SICSource = ""; - NotSkipping = true; - memory_address = current_address; - line_counter = 0; - } - - //MessageBox.Show(ObjectCode); - } - } -} - diff --git a/SIC Simulator/AssemblerException.cs b/SIC Simulator/AssemblerException.cs deleted file mode 100644 index d3cc9e8..0000000 --- a/SIC Simulator/AssemblerException.cs +++ /dev/null @@ -1,131 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -// Assigned to Ellis Levine -// Can be tested after Assembler is finished - -// Uses inheritance so that, every Exception inherits AssemblerException, which inherits System.Exception class -// More exceptions can be added to this file as development continues - -// When calling an exception from another class (ex. AssemblerException ae) doing ae.HResult should return the line number (not tested yet) - -namespace SIC_Simulator -{ - class AssemblerException : Exception - { - public AssemblerException() { } - - public AssemblerException(string message) - : base(message) - { } - public AssemblerException(string message, Instruction inst) - : base(message) - { this.HResult = inst.LineNumber; } - } - - class AssemblerInvalidSymbolException: AssemblerException - { - public AssemblerInvalidSymbolException() { } - public AssemblerInvalidSymbolException(string message) - : base(message) - { } - public AssemblerInvalidSymbolException(string message, Instruction inst) - : base(message) - { this.HResult = inst.LineNumber; } - } - - class UndefinedSymbolException : AssemblerException - { - public UndefinedSymbolException() { } - public UndefinedSymbolException(string message) - : base(message) - { } - public UndefinedSymbolException(string message, Instruction inst) - : base(message) - { this.HResult = inst.LineNumber; } - } - - class InvalidOpcodeException : AssemblerException - { - public InvalidOpcodeException() { } - public InvalidOpcodeException(string message) - : base(message) - { } - public InvalidOpcodeException(string message, Instruction inst) - : base(message) - { this.HResult = inst.LineNumber; } - } - - class MultipleSymbolDefinitionException : AssemblerException - { - public MultipleSymbolDefinitionException() { } - public MultipleSymbolDefinitionException(string message) - : base(message) - { } - public MultipleSymbolDefinitionException(string message, Instruction inst) - : base(message) - { this.HResult = inst.LineNumber; } - } - - class InvalidHexConstantException : AssemblerException - { - public InvalidHexConstantException() { } - public InvalidHexConstantException(string message) - : base(message) - { } - public InvalidHexConstantException(string message, Instruction inst) - : base(message) - { this.HResult = inst.LineNumber; } - } - - class MissingOrExtraOperandException : AssemblerException - { - public MissingOrExtraOperandException() { } - public MissingOrExtraOperandException(string message) - : base(message) - { } - public MissingOrExtraOperandException(string message, Instruction inst) - : base(message) - { this.HResult = inst.LineNumber; } - } - - class InvalidFileTypeException : AssemblerException - { - public InvalidFileTypeException() { } - public InvalidFileTypeException(string message) - : base(message) - { } - } - - class OutofMemoryException : AssemblerException - { - public OutofMemoryException() { } - public OutofMemoryException(string message) - : base(message) - { } - public OutofMemoryException(string message, Instruction inst) - : base(message) - { this.HResult = inst.LineNumber; } - } - - // Optional, in case we want to add in errors for blank lines later - class BlankLineException : AssemblerException - { - public BlankLineException() { } - public BlankLineException(string message) - : base(message) - { } - public BlankLineException(string message, Instruction inst) - : base(message) - { this.HResult = inst.LineNumber; } - } - - - - - - -} diff --git a/SIC Simulator/Form1.cs b/SIC Simulator/Form1.cs deleted file mode 100644 index c87d12f..0000000 --- a/SIC Simulator/Form1.cs +++ /dev/null @@ -1,701 +0,0 @@ -using System; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; -using System.IO; -using System.Runtime.Serialization.Formatters.Soap; -using SIC_Simulator.Extensions; -using static System.Windows.Forms.ListViewItem; -using System.Diagnostics; - -namespace SIC_Simulator -{ - - public partial class Form1 : Form - { - - public String LastLoadedFileName = String.Empty; - public int LastLoadedStart = 0; - public int LastLoadedLength = 0; - - private SIC_CPU SICVirtualMachine; - - - public Form1() - { - InitializeComponent(); - - tsmAbout_About.Click += new EventHandler(tsmAbout_About_DropDownItemClicked); - tsmzeroAllMemory.Click += new EventHandler(tsmzeroAllMemory_Click); - randomizeAllMemory.Click += new EventHandler(randomizeAllMemory_Click); - this.SICVirtualMachine = new SIC_CPU(true); - - - //System.Threading.Thread St = new System.Threading.Thread( this.RefreshCPUDisplays); - - } - - - - private void tsmAbout_About_DropDownItemClicked(object sender, EventArgs e) - { - var menuItem = sender as ToolStripMenuItem; - var menuText = menuItem.Text; - - - switch (menuText) - { - case "About": - frmAbout fa = new frmAbout(); - fa.ShowDialog(); - break; - - case "Check for Updates": - - break; - - - } - } - - private void tsmzeroAllMemory_Click(object sender, EventArgs e) - { - this.SICVirtualMachine.ZeroizeMemory(); - this.RefreshCPUDisplays(); - } - - private void randomizeAllMemory_Click(object sender, EventArgs e) - { - this.SICVirtualMachine.RandomizeMemory(); - this.RefreshCPUDisplays(); - } - - static string ByteArrayToHexStringViaBitConverter(byte[] bytes) - { - string hex = BitConverter.ToString(bytes); - return hex.Replace("-", ""); - } - - - private void tsmSaveMachineState_Click(object sender, EventArgs e) - { - SaveFileDialog sfd = new SaveFileDialog(); - - sfd.AddExtension = true; - sfd.Filter = "SIC VM State Files|*.sicstate"; - - DialogResult Result; - - Result = sfd.ShowDialog(); - - - if (Result == DialogResult.OK) - { - using (var stream = File.Open(sfd.FileName, FileMode.Create)) - { - SoapFormatter sf = new SoapFormatter(); - sf.Serialize(stream, this.SICVirtualMachine); - } - } - - this.SICVirtualMachine.MachineStateIsNotSaved = false; - - - } - - private void btnStep_Click(object sender, EventArgs e) - { - - if ( this.SICVirtualMachine.PC == -1 ) - { - MessageBox.Show("Program Stepping Halted. L=0, RSUB, PC = -1", "Program Halted" ); - return ; - } - - this.SICVirtualMachine.PerformStep(); - - this.RefreshCPUDisplays(); - } - - - private async void RefreshCPUDisplays(){ - await RegRefreshAsync(); - await MemoryRefreshAsync(); - await DeviceRefreshAsync(); - - } - - private async Task DeviceRefreshAsync() - { - await Task.Run(() => { }); - for (int i = 0; i < this.lvDevices.Items.Count; i++) - { // update the sub list views with data found in the device array - this.lvDevices.Items[i].SubItems[1].Text = this.SICVirtualMachine.Devices[i].GetWriteBufferASCIIByteString; - } - } - - - /// - /// Refreshes Memory Display on background thread. Calls are marshalled to UI thread - /// - private async Task MemoryRefreshAsync() - { - if (rbMemHex.Checked == true) - { - String Blob = ByteArrayToHexStringViaBitConverter(this.SICVirtualMachine.MemoryBytes); - - StringBuilder sb = new StringBuilder((32768 * 2) + 512); - int StartIndex = 0; - int Line = 0; - - int PCLine = 0; - - await Task.Run(() => - { - sb.AppendLine("{\\rtf1\\ansi "); - sb.AppendLine("{\\colortbl ;\\red0\\green255\\blue0;\\red255\\green255\\blue0;}"); - - for (int Add = 0; Add < 32768; Add++) - { - if (Add == this.SICVirtualMachine.PC) - { - StartIndex = sb.ToString().Length; - if (Add == 0) - { - StartIndex += 6; - } - } - if ((Add % 16) == 0) - { - if (Add > 0) - { - sb.Append("\\line " + string.Format("{0:X4}: ", Add)); - Line += 1; - } - else - { - sb.Append(string.Format("{0:X4}: ", Add)); - } - } - if ((Add == this.SICVirtualMachine.PC) || (Add == this.SICVirtualMachine.PC + 1) || (Add == this.SICVirtualMachine.PC + 2)) - { - sb.Append(String.Format("\\fs24 \\b \\highlight2 {0:X2}\\highlight0\\b0 \\fs20 ", Blob.Substring(Add * 2, 2)) + " "); - PCLine = Line; - } - else - { - sb.Append(String.Format("{0:X2}", Blob.Substring(Add * 2, 2)) + " "); - } - - } - }); - sb.Append("}"); - rtfMemory.Rtf = sb.ToString(); - rtfMemory.Select(PCLine * 55, 0); - rtfMemory.ScrollToCaret(); - - - rtfMicroSteps.Text = this.SICVirtualMachine.MicrocodeSteps; - rtfMicroSteps.Select(rtfMicroSteps.Text.Length, 0); - rtfMicroSteps.ScrollToCaret(); - - } - else - { - // Show in Binary - - } - - } - - private async Task RegRefreshAsync() - { - await Task.Run(() => { }); //This is bad, but whatever. - txtX_Hex.Text = SICVirtualMachine.X.ToString("X6"); - txtA_Hex.Text = SICVirtualMachine.A.ToString("X6"); - txtL_Hex.Text = SICVirtualMachine.L.ToString("X6"); - txtPC_Hex.Text = SICVirtualMachine.PC.ToString("X6"); - txtSW_Hex.Text = SICVirtualMachine.SW.ToString("X6"); - - txtX_Dec.Text = SICVirtualMachine.X.ToString(); - txtA_Dec.Text = SICVirtualMachine.A.ToString(); - txtL_Dec.Text = SICVirtualMachine.L.ToString(); - txtPC_Dec.Text = SICVirtualMachine.PC.ToString(); - txtSW_Dec.Text = SICVirtualMachine.SW.ToString(); - - // Now do the binary bytes for each register and Status Word - String PC_BIN = this.SICVirtualMachine.PC.To24BITBinary(); - txtPC_BIN_MSB.Text = PC_BIN.Substring(0, 8); - txtPC_BIN_MIB.Text = PC_BIN.Substring(8, 8); - txtPC_BIN_LSB.Text = PC_BIN.Substring(16); - - - String L_BIN = SICVirtualMachine.L.To24BITBinary(); - txtL_BIN_MSB.Text = L_BIN.Substring(0, 8); - txtL_BIN_MIB.Text = L_BIN.Substring(8, 8); - txtL_BIN_LSB.Text = L_BIN.Substring(16); - - String A_BIN = SICVirtualMachine.A.To24BITBinary(); - txtA_BIN_MSB.Text = A_BIN.Substring(0, 8); - txtA_BIN_MIB.Text = A_BIN.Substring(8, 8); - txtA_BIN_LSB.Text = A_BIN.Substring(16); - - String X_BIN = SICVirtualMachine.X.To24BITBinary(); - txtX_BIN_MSB.Text = X_BIN.Substring(0, 8); - txtX_BIN_MIB.Text = X_BIN.Substring(8, 8); - txtX_BIN_LSB.Text = X_BIN.Substring(16); - - - - String SW_BIN = this.SICVirtualMachine.SW.To24BITBinary(); - txtSW_BIN_MSB.Text = SW_BIN.Substring(0, 8); - txtSW_BIN_MIB.Text = SW_BIN.Substring(8, 8); - txtSW_BIN_LSB.Text = SW_BIN.Substring(16); - txtSW_CC.Text = txtSW_BIN_LSB.Text.Substring(0,2); - lblComp_Result.Text = txtSW_BIN_LSB.Text[0] == 49 ? "Greater than" : txtSW_BIN_LSB.Text[1] == 49 ? "Less than" : "Equal"; - - String NextInstructionD; - - - if ( this.SICVirtualMachine.PC >= 0) - { - NextInstructionD = SICVirtualMachine.GetInstructionDescription(SICVirtualMachine.PC); - - String[] NextInstructionPieces; - - NextInstructionPieces = NextInstructionD.Split('|'); - - - lblNextInstruction.Text = NextInstructionPieces[0]; - lblNI_Description.Text = NextInstructionPieces[1]; - lblNextInstruction_Effect.Text = NextInstructionPieces[2]; - } else - { - lblNextInstruction.Text = "Program Halted"; - lblNI_Description.Text = "VM Halted by Software Instruction"; - lblNextInstruction_Effect.Text = "VM Halted"; - } - - - - } - - - private void loadSavedSICMachineStateToolStripMenuItem_Click(object sender, EventArgs e) - { - OpenFileDialog ofd = new OpenFileDialog(); - DialogResult Res; - ofd.Filter = "SIC VM State Files|*.sicstate"; - ofd.Multiselect = false; - - Res = ofd.ShowDialog(); - - if ( Res == DialogResult.OK) - { - using (var stream = File.Open(ofd.FileName, FileMode.Open)) - { - SoapFormatter osf = new SoapFormatter(); - this.SICVirtualMachine = (SIC_CPU) osf.Deserialize(stream); - } - // Refresh Memory and Register Displays to Show Saved State - this.RefreshCPUDisplays(); - - } - this.SICVirtualMachine.MachineStateIsNotSaved = false; - - } - - private void tsmsetMemoryBYTE_Click(object sender, EventArgs e) - { - dlgSetMemoryByte SetMemByte = new dlgSetMemoryByte(); - DialogResult Result; - - Result = SetMemByte.ShowDialog(); - - if ( Result == DialogResult.Cancel ) - { - return; - } - - this.SICVirtualMachine.StoreByte(SetMemByte.MemoryAddress, SetMemByte.ByteValue); - - this.RefreshCPUDisplays(); - - } - - - private int MemorizedLastMemoryWordAddress = 0; - - private void setMemoryWORDToolStripMenuItem_Click(object sender, EventArgs e) - { - - - - dlgSetMemoryWord SetMemWord; - - if (this.MemorizedLastMemoryWordAddress == 0 ) - { - SetMemWord = new dlgSetMemoryWord(); - } else - { - SetMemWord = new dlgSetMemoryWord( this.MemorizedLastMemoryWordAddress); - } - - DialogResult Result; - - Result = SetMemWord.ShowDialog(); - - if (Result == DialogResult.Cancel) - { - return; - } - this.MemorizedLastMemoryWordAddress = SetMemWord.MemoryAddress; - this.SICVirtualMachine.StoreWord(SetMemWord.MemoryAddress, SetMemWord.WordValue); - this.RefreshCPUDisplays(); - } - - private void tsmresetSICVirtualMachine_Click(object sender, EventArgs e) - { - DialogResult Result; - - Result = MessageBox.Show("This will zero all memory locations and reset all registers to zero. Are you sure you want to proceed?", "Confirm", MessageBoxButtons.YesNo); - - if ( Result == DialogResult.Yes ) - { - this.SICVirtualMachine = new SIC_CPU(true); - this.RefreshCPUDisplays(); - } - - } - - - private void ReadEndRecord( string line, ref int FirstExecIns) - { - int i = 1, num = 0; - while (i < 7) - { - char ch = line[i++]; - if (ch >= 'A') - { - ch -= (char)7; - } - - ch -= (char)48; - num += (int)ch; - num = num << 4; - } - FirstExecIns = num >> 4; - } - - - - private void ReadTextRecord( string line, ref int RecordStartAdd, ref int RecordLength) - { - int i = 1, num = 0; - while (i < 7) - { - char ch = line[i++]; - if (ch >= 'A') - { - ch -= (char)7; - } - - ch -= (char)48; - num += (int)ch; - num = num << 4; - } - num = num >> 4; - RecordStartAdd = num; - num = 0; - while (i < 9) - { - char ch = line[i++]; - if (ch >= 'A') - { - ch -= (char)7; - } - - ch -= (char)48; - num += (int)ch; - num = num << 4; - } - num = num >> 4; - RecordLength = num; - - } - - private void tsmOpen_SIC_Object_File_Click(object sender, EventArgs e) - { - OpenFileDialog ofd = new OpenFileDialog(); - DialogResult Res; - ofd.Filter = "SIC Object Files|*.sic.obj"; - ofd.Multiselect = false; - - Res = ofd.ShowDialog(); - - if (Res == DialogResult.OK) - { - System.IO.StreamReader file = new System.IO.StreamReader(ofd.FileName); - String fileText = file.ReadToEnd(); - this.txtObjectCode.Text = fileText; - LoadObjectFile(fileText.Split('\n')); - file.Close(); - - this.RefreshCPUDisplays(); - - } - } - - private void tsmloadAndAssembleSICSourceFIle_Click(object sender, EventArgs e) - { - if (loadSICSourceFD.ShowDialog() == DialogResult.OK) - { - Assembler assembler = new Assembler(loadSICSourceFD.FileName); - - if ( !String.IsNullOrEmpty(assembler.ObjectCode) ) - { - // We need to call the loader, or use the quick loader in this form - // to load the assembled code into memory - - this.txtSICInput.Text = assembler.InstructionSource; - this.txtObjectCode.Text = assembler.ObjectCode; - - String[] lines = assembler.ObjectCode.Split('\n'); - LoadObjectFile(lines); - } - this.RefreshCPUDisplays(); // refresh memory after object code is loaded - - - this.LastLoadedFileName = System.IO.Path.GetFileName(loadSICSourceFD.FileName); - - } - } - - private void LoadObjectFile(String[] lines) { - foreach (string line in lines) - { - if (String.IsNullOrWhiteSpace(line)) - { - continue; - } - - if (line[0] == 'H') - { - var firstAddress = line.Substring(7, 6); - var programSize = line.Substring(13, 6); - this.SICVirtualMachine.CurrentProgramEndAddress = Int32.Parse(firstAddress, System.Globalization.NumberStyles.HexNumber) + Int32.Parse(programSize, System.Globalization.NumberStyles.HexNumber); - // Read The Header Record - // In this context, not much to do here. - // from header record. - // The linker module and full-implementation loader - // will need to look at the H records - - - this.LastLoadedStart = Int32.Parse(firstAddress, System.Globalization.NumberStyles.HexNumber); - this.LastLoadedLength = Int32.Parse(programSize, System.Globalization.NumberStyles.HexNumber); - - } - if (line[0] == 'T') - { - // Read T Text Record - int RecordStartAddress = 0; - int RecordLength = 0; - ReadTextRecord(line, ref RecordStartAddress, ref RecordLength); - this.SICVirtualMachine.LoadToMemory(line, RecordStartAddress, RecordLength); - } - - if (line[0] == 'E') - { - // Read The End Record and Set PC - int AddressOfFirstInstruction = 0; - ReadEndRecord(line, ref AddressOfFirstInstruction); - this.SICVirtualMachine.PC = AddressOfFirstInstruction; - this.SICVirtualMachine.CurrentProgramStartAddress = AddressOfFirstInstruction; - } - } - } - - private void timer1_Tick(object sender, EventArgs e) - { - this.SICVirtualMachine.PerformStep(); - - this.RefreshCPUDisplays(); - } - - private void Form1_Load(object sender, EventArgs e) - { - lvDevices.Dock = DockStyle.Fill; - for (int i = 0; i < SIC_CPU.NumDevices; i++) - { //seed lsit view for devices with 64 items - ListViewItem lvItem = new ListViewItem(String.Format("{0,2:D2}", i)); - lvItem.SubItems.Add(""); - this.lvDevices.Items.Add(lvItem); - } - lvDevices.View = View.Details; - RefreshCPUDisplays(); - } - - private void tsmFile_Ext_Click(object sender, EventArgs e) - { - - if ( this.SICVirtualMachine.MachineStateIsNotSaved == false) - { - DialogResult NotProceed; - NotProceed = MessageBox.Show("The current machine state has not been saved. Do you want to cancel exit and save your machine state?", "Machine State Not Saved", MessageBoxButtons.YesNo); - - if ( NotProceed == DialogResult.Yes ) - { - return; - } - - } - Application.Exit(); - - } - - private void setProgramCounterToToolStripMenuItem_Click(object sender, EventArgs e) - { - dlgSetRegisterWord SetRegWord = new dlgSetRegisterWord( "PC"); - DialogResult Result; - - Result = SetRegWord.ShowDialog(); - - if (Result == DialogResult.Cancel) - { - return; - } - this.SICVirtualMachine.PC = SetRegWord.WordValue; - this.RefreshCPUDisplays(); - } - - private void btnRun_Click(object sender, EventArgs e) - { - int StopAtPCAddress = 0; - - DialogResult Result; - dlgStopAtMemoryAddress SetStop = new dlgStopAtMemoryAddress( this.LastLoadedFileName, this.LastLoadedStart, this.LastLoadedLength); - Result = SetStop.ShowDialog(); - - if ( Result == DialogResult.OK) - { - StopAtPCAddress = SetStop.HaltAtMemoryAddress; - while (this.SICVirtualMachine.PC != StopAtPCAddress ) - { - this.SICVirtualMachine.PerformStep(); - } - this.RefreshCPUDisplays(); - } - - - - } - - private void btnResetProgram_Click(object sender, EventArgs e) - { - LoadObjectFile(this.txtObjectCode.Text.Split('\n')); - this.RefreshCPUDisplays(); - } - - private void btnThreeStep_Click(object sender, EventArgs e) - { - this.SICVirtualMachine.PerformStep(); - this.RefreshCPUDisplays(); - this.SICVirtualMachine.PerformStep(); - this.RefreshCPUDisplays(); - this.SICVirtualMachine.PerformStep(); - this.RefreshCPUDisplays(); - } - - private void loadObjectFileToolStripMenuItem_Click(object sender, EventArgs e) - { - OpenFileDialog ofd; - System.Windows.Forms.DialogResult Result; - - ofd = new OpenFileDialog(); - ofd.Filter = "SIC Object Files|*.sic.obj"; - ofd.Multiselect = false; - ofd.Title = "Select SIC Object File"; - - Result = ofd.ShowDialog(); - - if ( Result == DialogResult.OK) - { - // we need to open ofd.FileName - // Find out where it was assembled - // Ask for new load location - int NewAddress = 0; - int StartAddress = 0; - int PLength = 0; - int ModRecordCount = 0; - String ObjectFileName = ofd.FileName; - String ProgramName = string.Empty; - - try - { - - String[] lines = System.IO.File.ReadAllLines(ofd.FileName); - - - foreach (string line in lines) - { - if (String.IsNullOrWhiteSpace(line)) - { - continue; - } - - - if (line[0] == 'H') - { - // We need to retrieve First address and program size - StartAddress = int.Parse(line.Substring(7, 6), System.Globalization.NumberStyles.HexNumber); - PLength= int.Parse(line.Substring(13, 6), System.Globalization.NumberStyles.HexNumber); - ProgramName = line.Substring(1,6).TrimEnd(); - //this.SICVirtualMachine.CurrentProgramEndAddress = Int32.Parse(firstAddress, System.Globalization.NumberStyles.HexNumber) + Int32.Parse(programSize, System.Globalization.NumberStyles.HexNumber); - } - if (line[0] == 'M') - { - ModRecordCount += 1; - - } - } - - } - catch (Exception Ex) - { - MessageBox.Show("There was an error reading the object file you specified: " + Ex.ToString(), "Error Opening Object File"); - return; - - } - - - DialogResult RelocationResult; - dlgRelocateObjectFile RelocationDialog = new dlgRelocateObjectFile(ProgramName, StartAddress, PLength, ModRecordCount); - - RelocationResult = RelocationDialog.ShowDialog(); - - if ( RelocationResult != DialogResult.OK) - { - return; - } - - - NewAddress = RelocationDialog.RelocatedToAddress; - - // Call the loader!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - - // Return address (absolute) of first instruction after relocation - // This will be placed in the PC - - //this.SICVirtualMachine.PC = (start value from relocated program code) - - - } - - - - - - } - } -} diff --git a/SIC Simulator/Properties/AssemblyInfo.cs b/SIC Simulator/Properties/AssemblyInfo.cs deleted file mode 100644 index 68679e2..0000000 --- a/SIC Simulator/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("SIC Simulator")] -[assembly: AssemblyDescription("SIC VM SImulator")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Scott Piersall and Students")] -[assembly: AssemblyProduct("SIC Simulator")] -[assembly: AssemblyCopyright("Copyright © 2020 2021")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("1be03959-6239-42b3-a318-02b849fe4ebc")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("21.10.28.1")] -[assembly: AssemblyFileVersion("21.10.28.1")] diff --git a/SIC Simulator/Properties/Resources.Designer.cs b/SIC Simulator/Properties/Resources.Designer.cs deleted file mode 100644 index 4819f96..0000000 --- a/SIC Simulator/Properties/Resources.Designer.cs +++ /dev/null @@ -1,71 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace SIC_Simulator.Properties -{ - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.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() - { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager - { - get - { - if ((resourceMan == null)) - { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SIC_Simulator.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get - { - return resourceCulture; - } - set - { - resourceCulture = value; - } - } - } -} diff --git a/SIC Simulator/Properties/Resources.resx b/SIC Simulator/Properties/Resources.resx deleted file mode 100644 index af7dbeb..0000000 --- a/SIC Simulator/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/SIC Simulator/Properties/Settings.Designer.cs b/SIC Simulator/Properties/Settings.Designer.cs deleted file mode 100644 index 002524f..0000000 --- a/SIC Simulator/Properties/Settings.Designer.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace SIC_Simulator.Properties -{ - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get - { - return defaultInstance; - } - } - } -} diff --git a/SIC Simulator/Properties/Settings.settings b/SIC Simulator/Properties/Settings.settings deleted file mode 100644 index 3964565..0000000 --- a/SIC Simulator/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/SIC Simulator/SICAssemblyException.cs b/SIC Simulator/SICAssemblyException.cs deleted file mode 100644 index ecc2ac5..0000000 --- a/SIC Simulator/SICAssemblyException.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace SIC_Simulator -{ - class SICAssemblyException : Exception - { - public SICAssemblyException( String Message) - : base(Message) - { - - } - } - - - class SICDivideByZeroException : Exception - { - public SICDivideByZeroException(String Message) - : base(Message) - { - - } - } - -} diff --git a/SIC Simulator/SICLoader.cs b/SIC Simulator/SICLoader.cs deleted file mode 100644 index 07a2b02..0000000 --- a/SIC Simulator/SICLoader.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace SIC_Simulator -{ - // Assigned to Brandon Woodrum - - // This class should have two constructors - // Zero Parameter (Absolute) - // Single Parameter (StartAddress) - > Relocate program to StartAddress - - class SICLoader - { - - - - } -} diff --git a/SIC Simulator/SIC_CPU.cs b/SIC Simulator/SIC_CPU.cs deleted file mode 100644 index ec2dd01..0000000 --- a/SIC Simulator/SIC_CPU.cs +++ /dev/null @@ -1,1073 +0,0 @@ -using System; -using System.Text; - -namespace SIC_Simulator -{ - - [Serializable()] - class SIC_CPU - - { - public readonly static int NumDevices = 65; - public int CurrentProgramEndAddress = 0; - public int CurrentProgramStartAddress = 0; - public int PC = 0; - public int A = 0; - public int X = 0; - public int L = 0; - public int SW = 0; - - public byte[] MemoryBytes; - - public SIC_Device[] Devices; - - - public bool MachineStateIsNotSaved = false; - - private StringBuilder MicroSteps; - - public String MicrocodeSteps - { - get { return this.MicroSteps.ToString(); } - } - - - /// - /// Constructs a SIC VM (CPU and Memory) - /// - /// - public SIC_CPU(bool ZeroizeBytes) - { - PC = A = X = L = SW = 0; - MemoryBytes = new byte[32768]; - - if (ZeroizeBytes == true) - { - this.ZeroizeMemory(); - } - else - { - this.RandomizeMemory(); - } - - this.Devices = new SIC_Device[NumDevices]; - - for (int i = 0; i < NumDevices; i++) - { - this.Devices[i] = new SIC_Device(i); - } - this.MicroSteps = new StringBuilder(); - MachineStateIsNotSaved = true; - } - - - - /// - /// Randomize all memory bytes in the SIC - /// Simulates filling memory with "JUNK" - /// Way to see if programs specifically set memory when needed - /// and do not rely on "JUNK" values - /// - public void RandomizeMemory() - { - Random rnd = new Random(Guid.NewGuid().GetHashCode()); - rnd.NextBytes(this.MemoryBytes); - MachineStateIsNotSaved = true; - } - - /// - /// Sets all memory bits to ZERO in the SIC - /// - public void ZeroizeMemory() - { - byte zero; - zero = 0; - for (int x = 0; x < 32768; x++) { this.MemoryBytes[x] = zero; } - MachineStateIsNotSaved = true; - } - - /// - /// Performs a "hard" reset of the virtual machine. - /// 1. All registers and SW are set to zero - /// 2. All Memory is zeroed. - /// - public void ResetVM() - { - this.PC = 0; - this.A = 0; - this.X = 0; - this.L = 0; - this.SW = 0; - this.ZeroizeMemory(); - this.MicroSteps = new StringBuilder(); - } - - - - /// - /// Fetches a 24-bit word from Memory and places it into an integer - /// - /// Address of Memory Location in SIC [0..32767] - /// - public int FetchWord(int Address) - { - int num1 = 0; - int num2 = 0; - for (int i = 0; i < 3; ++i) - { - char ch = (char)this.MemoryBytes[Address++]; - num2 = (int)ch; - num2 = num2 & 0x000000FF; - num1 = num1 | num2; - num1 = num1 << 8; - } - num1 = num1 >> 8; - - return num1; - - } - - /// - /// Fetches Byte in Memory and returns character type - /// - /// - /// - public char FetchByte(int Address) - { - return (char)this.MemoryBytes[Address]; - } - - - public void StoreWord(int Address, int data) - { - byte b; - for (int i = 2; i >= 0; --i) - { - b = (byte)(data & 0xFF); - MemoryBytes[Address + i] = b; - data = data >> 8; - } - MachineStateIsNotSaved = true; - } - - - public void StoreByte(int address, byte data) - { - this.MemoryBytes[address] = data; - MachineStateIsNotSaved = true; - } - - - //New Code Segment By Brandon And Nick - - /// Loader section Brandon Woodrum and Nick Konopko - /// Load's an Object File Representation from a File - /// into this SIC VM's Memory - /// NO RELOCATION IS PERFORMACE (ABSOLUTE LOADING) - /// - /// - public void LoadObjectFile(String AbsoluteFilePath) - { - //function that only loads from TRecords no mod - //int c = 0; - String l; - System.IO.StreamReader f = new System.IO.StreamReader(AbsoluteFilePath); - - while((l = f.ReadLine()) != null) - { - if(l[0] == 'H') - { - ReadHeaderRecord(l); - } - if (l[0] == 'T') - { - ReadTextRecord(l); - } - if (l[0] == 'E') - { - continue; - } - - } - - - } - //class for MOD constructor that holds info for Modification - class Mod - { - //data fields - int address = 0; - int half = 0; - bool flag = false; - Mod next = null; - bool error = false; - - - //if our head is which is a place holder is returned then nothing was found in search. this sets its boolean to true - public void seterr() - { - this.error = true; - } - //tells if its head or not - public bool geterr() - { - return this.error; - } - - //sets all values for created mod - public void set(int address, int half, bool flag) - { - this.address = address; - this.half = half; - this.flag = flag; - this.next = null; - } - //sets and gets for data fields - public void setNext(Mod t) - { - this.next = t; - } - public Mod getNext() - { - return this.next; - } - - public int getaddress() - { - return this.address; - } - public int gethalf() - { - return this.half; - } - public bool getbool() - { - return this.flag; - } - //searches linked list for Mod record matching T-record starting address, if head is returned as place holder nothing was found - public Mod search(Mod head, int add) - { - Mod error = new Mod(); - error.seterr(); - while(head.next != null) - { - if(add != head.address) - { - head = head.next; - } - else - { - return head; - } - } - return error; - - } - } - //relocation function for MOD records - private void NotAbs(int x, String AbsoluteFilePath) - { - Mod head = new Mod(); - - Mod last = head; - - int c = 0; - String l; - System.IO.StreamReader f = new System.IO.StreamReader(AbsoluteFilePath); - int y = 0; - //reads file to create MOD record objects - while ((l = f.ReadLine()) != null) - - { - if (l[0] == 'H') - { - y = unr(l, x); - } - if (l[0] == 'M') - { - Mod current = new Mod(); - last.setNext(current); - last = current; - ReadModRecordR(l, x, y, current); - } - - } - String l2; - System.IO.StreamReader f2 = new System.IO.StreamReader(AbsoluteFilePath); - //reads file to generate memory, passing mod head to ReadTEXTR so that it can search for appropriate MOD - while ((l2 = f2.ReadLine()) != null) - { - if (l2[0] == 'H') - { - - ReadHeaderRecordR(l2, x); - } - if (l2[0] == 'T') - { - ReadTextRecordR(l2, x, head); - } - if (l2[0] == 'E') - { - continue; - } - - } - } - //parses mod record and returns correct offset minus or plus for trecord. - private void ReadModRecordR(String T, int x, int y, Mod current) - { //may not need Flag anymore - //alternate solution to plus or minus - bool flag = false; - if (x >= y) - { - flag = true; - - } - else if (x < y) - { - flag = false; - } - - ///end block - - String address = T.Substring(2,6); - String h = T.Substring(8, 2); - int a = System.Int32.Parse(address); - int l = System.Int32.Parse(h); - - //start block - //if true then new start position was larger than old so plus difference. - if(flag == true) - { - a += (x - y); - } - else - { - a -= (x - y); - } - - //end block - /* String OPER = T.Substring(10, 1); - if (OPER.Equals("+")) - a += y; - else - { - a -= y; - }*/ - if (a > 8000 || a < 0) - { - //error for out of bounds new position. - return; - } - else - {// sets mods data fields - current.set(a, l, flag); - } - - } - - //ABS - //reads header record for no mod - private void ReadHeaderRecord(String T) - { - //gets starting address, but why? - - string address = T.Substring(8, 6); - } - //reads and loads text into memory for nomod - private void ReadTextRecord(String T) - { - //String T; - // T = s.ToString(); - string address = T.Substring(2, 6); - string Length = T.Substring(8, 2); - int a = System.Int32.Parse(address); - int l = System.Int32.Parse(Length); - LoadToMemory(T, a, l); - } - //NOT ABS - //reads and loads text into memory with mod as needed. - private void ReadTextRecordR(String T, int x, Mod head) - { - //String T; - // T = s.ToString(); - string address = T.Substring(2, 6); - string Length = T.Substring(8, 2); - int a = System.Int32.Parse(address); - Mod test = new Mod(); - test = head.search(head, a); - bool MODnofound = test.geterr(); - //int u = 0; - //if MOD record found gets new address for Textrecord then loads into memory. - if (MODnofound != true) - { - //u = test.gethalf(); - a = test.getaddress(); - //a+=x; - //a+= u; - } - - int l = System.Int32.Parse(Length); - LoadToMemory(T, a, l); - } - - //read header record, but I think its obsolete. implememented function that does this ones job. to be deleted. - private void ReadHeaderRecordR(String T, int x) - { - //gets starting address, but why? - - string address = T.Substring(8, 6); - int a = System.Int32.Parse(address); - string length = T.Substring(14, 6); - int b = System.Int32.Parse(length); - if (a+ x + b > 8000) { //over memory for relocation. - return; } - else - a += x; - } - //does headerrecordreaders job from above, math is handled on return and send to Mod reader. - private int unr(String T, int x) - { - string address = T.Substring(8, 6); - int a = System.Int32.Parse(address); - int NewPCCounter = 0; - bool flag = false; - if (x >= a) - { - flag = true; - - } - else if (x < a) - { - flag = false; - } - if (flag == true) - { - NewPCCounter += (a - x); - } - else - { - NewPCCounter -= (a - x); - } - //hopefully this updates PC counter so that Restart function works, hopefully.*************************************//important commment i might be wrong - if (NewPCCounter > 8000 || NewPCCounter < 0) - { - //error for out of bounds new pc counter. - return -1; - } - else - { - this.PC = NewPCCounter; - } - //returns header record start address. - return a; - } - - //End of Loader Block//////////////// - - //here - - public void InitializePC(int PCValue) - { - this.PC = PCValue; - } - - /// - /// This method steps the CPU one time. - /// FETCH->DECODE->EXECUTE - /// - public void PerformStep() - { - // 1. Fetch the next instruction by pulling the WORD from memory - // pointed to by PC (Address of Next Instruction) - // - // 2. Decode the instruction - // - // 3. Execute Instruction - // --> Execute will advance PC by 3 bytes(1 word) or change it to - // --> a target address if we have a JUMP, or RSUB - - int NextInstruction; - int op = 0; - int TA = 0; - - NextInstruction = this.FetchWord(PC); - - this.DecodeInstruction(NextInstruction, ref op, ref TA); - - this.ExecuteInstruction(op, TA); - MachineStateIsNotSaved = true; - } - - - - - - /// - /// Returns a human-readable description of the instruction and operand value located - /// at Address. The string has two parts, delimited by a | - /// mnemonic target address | complete description of instruction and result - /// - /// Absolute address of 3-byte instruction - /// String with description - public String GetInstructionDescription(int Address) - { - string Result = string.Empty; - string Details = string.Empty; - string Effect = string.Empty; - int Word; - Word = this.FetchWord(Address); // Fetch the Word at Address - int TargetAddress; - int OpCode; - bool INDEXED = false; - int XBit = 0; - XBit = (Word & 0x8000); - INDEXED = (XBit > 0); - - TargetAddress = Word & 0x7FFF; - OpCode = Word & 0xFF0000; - OpCode = OpCode >> 16; - - - switch (OpCode) - { - case 0x18: // ADD - Result = "ADD"; - Details = "Add Value in Target Address to Register A"; - Effect = "A <- (A) + (TA)"; - break; - - case 0x40: // AND - Result = "AND"; - Details = "Perform Bitwise AND on Value in Target Address and Register A, store result in A"; - Effect = "A <- (A) && (TA)"; - break; - - case 0x28: // CMP (Compare and set Status Word SW) - Result = "CMP"; - break; - - case 0x24: // DIV - Result = "DIV"; - Details = "Divide Register A by Value in Target Address "; - Effect = "A <- (A) / (TA)"; - break; - - case 0x3C: // J - Result = "J"; - Details = "Perform Unconditional Jump to Target Address"; - Effect = "PC <- (TA)"; - break; - - case 0x30: // JEQ - Result = "JEQ"; - Details = "Perform Conditional Jump to Target Address when CC = 00"; - Effect = "PC <- (TA) if CC = 00"; - break; - - case 0x34: // JGT - Result = "JGT"; - Details = "Perform Conditional Jump to Target Address when CC = 10"; - Effect = "PC <- (TA) if CC = 10"; - break; - - case 0x38: // JLT - Result = "JLT"; - Details = "Perform Conditional Jump to Target Address when CC = 01"; - Effect = "PC <- (TA) if CC = 01"; - break; - - case 0x48: // JSUB (Jump to subroutine starting at TA. Preserve PC by storing in L) - Result = "JSUB"; - Details = "Jump to Subroutine at Target Address. Preserve PC By Storing in L"; - Effect = "L <- PC; PC <- (TA)"; - break; - - case 0x00: // LDA - Result = "LDA"; - Details = "Load Value in Target Address to Register A"; - Effect = "A <- (TA)"; - break; - - case 0x50: // LDCH - Result = "LDCH"; - Details = "Load Character from Device Specified in Target Address to Rightmost Byte in A"; - Effect = "A[rightmost byte] <- Device(TA)"; - break; - - case 0x08: // LDL - Result = "LDL"; - Details = "Load Value in Target Address to Register L"; - Effect = "L <- (TA)"; - break; - - case 0x04: // LDX - Result = "LDX"; - Details = "Load Value in Target Address to Register X"; - Effect = "X <- (TA)"; - break; - - case 0x20: // MUL - Result = "MUL"; - Details = "Multiple Value in Target Address by Register A Store in A"; - Effect = "A <- (A) * (TA)"; - break; - - case 0x44: // OR - Result = "OR"; - Details = "Perform Bitwise OR on Value in Target Address and Register A, store result in A"; - Effect = "A <- (A) || (TA)"; - break; - - case 0x4C: // RSUB - Result = "RSUB"; - Details = "Return from Subroutine. "; - Effect = "PC <- (L)"; - break; - - case 0x0C: // STA (Stores contents of A in Target Address) - Result = "STA"; - Details = "Store Value in Register A to Target Address"; - Effect = "(TA) <- A"; - break; - - case 0x54: // STCH - Result = "STCH"; - break; - - case 0x14: // STL - Result = "STL"; - Details = "Store Value in Register L to Target Address"; - Effect = "(TA) <- L"; - break; - - case 0x10: // STX (Stores contents of X in Target Address) - Result = "STX"; - Details = "Store Value in Register X to Target Address"; - Effect = "(TA) <- X"; - break; - - case 0x1C: // SUB - Result = "SUB"; - Details = "Sub Value in Target Address to Register A"; - Effect = "A <- (A) - (TA)"; - break; - - case 0xE0: // TD (Tests to see if a device is busy). - Result = "TD"; - Details = "Test Device Number Specified in Target Address"; - Effect = "Set SW"; - break; - - case 0x2C: // TIX - Result = "TIX"; - Details = "Increment value in X Register. Compare to value in Target Address"; - Effect = "X <- X + 1; COMP X to M set CC"; - break; - - case 0xDC: // WD (Write to Device) - Result = "WD"; - Details = "Write rightmost byte in A to Device Number in Target Address"; - Effect = " Device(TA) <- A[rightmost byte]"; - break; - - default: - Result = ""; - break; - } - Result += " "; - if (INDEXED == true) - { - Result += "TA = TA + X ->" + TargetAddress.ToString(("X6")) + '+' + X.ToString(("X6")) + "->" + (TargetAddress + TargetAddress + X).ToString(("X6")); - TargetAddress += this.X; // Add contents of X register to address for indexed Mode - } - else - { - Result += "TA = " + TargetAddress.ToString("X6"); - } - Result = Result + "|" + Details + "|" + Effect; - return Result; - } - - /// - /// Executes Single Operation Code using Target Address as Operand. - /// This Method is the "microcode" steps in the SIC CPU - /// to execute mnemonics - /// - /// Opcode for Instruction to Execute - /// Calculated Target Address - public void ExecuteInstruction(int OpCode, int TA) - { - - switch (OpCode) - { - case 0x18: // ADD - this.MicroSteps.AppendLine("-----ADD------"); - this.MicroSteps.AppendLine("A <- " + this.A.ToString("X6") + " + " + this.FetchWord(TA).ToString("X6")); - this.MicroSteps.AppendLine("PC <- " + this.PC.ToString("X6") + " + 3"); - this.A += this.FetchWord(TA); - this.PC += 3; - break; - - case 0x40: // AND - this.MicroSteps.AppendLine("-----AND------"); - this.MicroSteps.AppendLine("A <- " + this.A.ToString("X6") + " && " + this.FetchWord(TA).ToString("X6")); - this.MicroSteps.AppendLine("PC <- " + this.PC.ToString("X6") + " + 3"); - this.A &= this.FetchWord(TA); - this.PC += 3; - break; - - case 0x28: // CMP (Compare and set Status Word SW) - this.MicroSteps.AppendLine("-----CMP------"); - int Data; - Data = this.FetchWord(TA); - - if (A < Data) - { - this.SW = this.SW | 0x40; - this.SW = this.SW & 0xFFFF7F; - this.MicroSteps.AppendLine("CC <- 01"); - } - else if (A == Data) - { - this.SW = this.SW & 0xFFFF3F; - this.MicroSteps.AppendLine("CC <- 00"); - } - else - { - this.SW = this.SW | 0x80; - this.SW = this.SW & 0xFFFFBF; - this.MicroSteps.AppendLine("CC <- 10"); - } - // Condition Code Values - // CC = 00 -> Equal - // CC = 01 -> Less than - // CC = 10 -> Greater than - // CC = 11 -> Not used - this.MicroSteps.AppendLine("PC <- " + this.PC.ToString("X6") + " + 3"); - this.PC += 3; - break; - - case 0x24: // DIV - this.MicroSteps.AppendLine("-----DIV------"); - // We don't want to crash the VM. - // IF we divide by zero, we should do something in the VM. - - if (this.FetchWord(TA) == 0) - { - // NO exception. We should set status WORD and NOT DO THE DIV - } - - else - { - this.MicroSteps.AppendLine("A <- " + this.A.ToString("X6") + " / " + this.FetchWord(TA).ToString("X6")); - this.A /= this.FetchWord(TA); - } - this.MicroSteps.AppendLine("PC <- " + this.PC.ToString("X6") + " + 3"); - this.PC += 3; - break; - - case 0x3C: // J - this.MicroSteps.AppendLine("-----J------"); - this.MicroSteps.AppendLine("PC <- " + TA.ToString("X6")); - this.PC = TA; - break; - - case 0x30: // JEQ - //MessageBox.Show(SW.ToString() + " & " + 0xC0 + " = " + (SW&0xC0)); # Done to compare values - if ((SW & 0xC0) == 0) - { - this.MicroSteps.AppendLine("PC <- " + TA.ToString("X6")); - PC = TA; - } - else { - this.MicroSteps.AppendLine("PC <- " + this.PC.ToString("X6") + " + 3"); - this.PC += 3; } - break; - - case 0x34: // JGT - this.MicroSteps.AppendLine("-----JGT------"); - int TempJGT; - TempJGT = (SW & 0xC0) >> 6; - if (TempJGT == 2) - { - this.MicroSteps.AppendLine("PC <- " + TA.ToString("X6")); - this.PC = TA; - } - else { - this.MicroSteps.AppendLine("PC <- " + this.PC.ToString("X6") + " + 3"); - this.PC += 3; } - break; - - case 0x38: // JLT - this.MicroSteps.AppendLine("-----JLT------"); - int TempJLT; - TempJLT = (SW & 0xC0) >> 6; - if (TempJLT == 1) - { - this.MicroSteps.AppendLine("PC <- " + TA.ToString("X6") ); - this.PC = TA; - } - else { - this.MicroSteps.AppendLine("PC <- " + this.PC.ToString("X6") + " + 3"); - this.PC += 3; } - break; - - case 0x48: // JSUB (Jump to subroutine starting at TA. Preserve PC by storing in L) - this.MicroSteps.AppendLine("-----JSUB------"); - this.MicroSteps.AppendLine("L <- " + PC.ToString("X6") + " + 3"); - this.L = ( this.PC + 3); - this.MicroSteps.AppendLine("PC <- " + TA.ToString("X6")); - this.PC = TA; - break; - - case 0x00: // LDA - this.MicroSteps.AppendLine("-----LDA------"); - this.MicroSteps.AppendLine("A <- " + this.FetchWord(TA).ToString("X6") ); - this.A = this.FetchWord(TA); - this.MicroSteps.AppendLine("PC <- " + this.PC.ToString("X6") + " + 3"); - this.PC += 3; - break; - - case 0x50: // LDCH - this.MicroSteps.AppendLine("-----LDCH------"); - byte ByteLoad; - ByteLoad = (byte)FetchByte(TA); - - //TODO -> Wire in character reads from device objects - this.A = ByteLoad; - this.MicroSteps.AppendLine("PC <- " + this.PC.ToString("X6") + " + 3"); - this.PC += 3; - break; - - case 0x08: // LDL - this.MicroSteps.AppendLine("-----LDL------"); - this.MicroSteps.AppendLine("L <- " + this.FetchWord(TA).ToString("X6")); - this.L = this.FetchWord(TA); - this.MicroSteps.AppendLine("PC <- " + this.PC.ToString("X6") + " + 3"); - this.PC += 3; - break; - - case 0x04: // LDX - this.MicroSteps.AppendLine("-----LDX------"); - this.MicroSteps.AppendLine("X <- " + this.FetchWord(TA).ToString("X6")); - this.X = this.FetchWord(TA); - this.MicroSteps.AppendLine("PC <- " + this.PC.ToString("X6") + " + 3"); - this.PC += 3; - break; - - case 0x20: // MUL - this.MicroSteps.AppendLine("-----MUL------"); - this.MicroSteps.AppendLine("A <- " + this.A.ToString("X6") + " * " + this.FetchWord(TA).ToString("X6")); - this.A *= FetchWord(TA); - this.MicroSteps.AppendLine("PC <- " + this.PC.ToString("X6") + " + 3"); - this.PC += 3; - break; - - case 0x44: // OR - this.MicroSteps.AppendLine("-----OR------"); - this.MicroSteps.AppendLine("A <- " + this.A.ToString("X6") + " OR " + this.FetchWord(TA).ToString("X6")); - this.A |= this.FetchWord(TA); - this.MicroSteps.AppendLine("PC <- " + this.PC.ToString("X6") + " + 3"); - this.PC += 3; - break; - - case 0xD8: // RD - this.MicroSteps.AppendLine("-----RD------"); - byte dataByte; - dataByte = (byte)this.A; - int DeviceNumberToRead; - DeviceNumberToRead = this.FetchWord(TA); - - // Set Device's Status Word to BUSY - this.Devices[DeviceNumberToRead].DeviceSW &= 0xFFFF3F; - - // Write the byte to the device - dataByte = this.Devices[DeviceNumberToRead].ReadByte(); - - // Set Device's Status Word to AVAILABLE - this.Devices[DeviceNumberToRead].DeviceSW |= 0x40; - this.Devices[DeviceNumberToRead].DeviceSW &= 0xFFFF7F; - int tmp; - tmp = (int)dataByte; - tmp &= 0xFF; - this.A = this.A & 0xFFFF00; - - this.A |= tmp; - this.MicroSteps.AppendLine("PC <- " + this.PC.ToString("X6") + " + 3"); - this.PC += 3; - break; - - - case 0x4C: // RSUB - this.MicroSteps.AppendLine("-----RSUB------"); - if (this.L == 0) - { - this.MicroSteps.AppendLine("PC <- (-1) PROGRAM HALTED" ); - this.PC = -1; // Program Halted. - } - else - { - this.MicroSteps.AppendLine("PC <- " + this.L.ToString("X6") ); - this.PC = this.L; - } - break; - - case 0x0C: // STA (Stores contents of A in Target Address) - this.MicroSteps.AppendLine("-----STA------"); - this.MicroSteps.AppendLine("TA <- " + A.ToString("X6") + " : TA = " + TA.ToString("X6")); - this.StoreWord(TA, A); - this.MicroSteps.AppendLine("PC <- " + this.PC.ToString("X6") + " + 3"); - this.PC += 3; - break; - - case 0x54: // STCH - this.MicroSteps.AppendLine("-----STCH------"); - int tempChar; - char dataSTCHByte; - tempChar = this.A & 0xFF; - dataSTCHByte = (char)tempChar; - this.StoreByte(TA, (byte)dataSTCHByte); - this.MicroSteps.AppendLine("TA <- " + tempChar.ToString("X6") + " : TA = " + TA.ToString("X6")); - - this.MicroSteps.AppendLine("PC <- " + this.PC.ToString("X6") + " + 3"); - this.PC += 3; - break; - - case 0x14: // STL - this.MicroSteps.AppendLine("-----STL------"); - this.MicroSteps.AppendLine("TA <- " + L.ToString("X6") + " : TA = " + TA.ToString("X6")); - this.StoreWord(TA, L); - this.MicroSteps.AppendLine("PC <- " + this.PC.ToString("X6") + " + 3"); - this.PC += 3; - break; - - case 0x10: // STX (Stores contents of X in Target Address) - this.MicroSteps.AppendLine("-----STX------"); - this.MicroSteps.AppendLine("TA <- " + X.ToString("X6") + " : TA = " + TA.ToString("X6")); - this.StoreWord(TA, X); - this.MicroSteps.AppendLine("PC <- " + this.PC.ToString("X6") + " + 3"); - this.PC += 3; - break; - - case 0x1C: // SUB (Subtract Value in TA from A ) - this.MicroSteps.AppendLine("-----SUB------"); - this.MicroSteps.AppendLine("A <- " + this.A.ToString("X6") + " - " + this.FetchWord(TA).ToString("X6")); - this.A -= this.FetchWord(TA); - this.MicroSteps.AppendLine("PC <- " + this.PC.ToString("X6") + " + 3"); - this.PC += 3; - break; - - case 0xE0: // TD (Tests to see if a device is busy). - this.MicroSteps.AppendLine("-----TD------"); - this.SW = this.SW | 0x40; - this.SW = this.SW & 0xFFFF7F; //CC is < - this.MicroSteps.AppendLine("PC <- " + this.PC.ToString("X6") + " + 3"); - this.PC += 3; - break; - - case 0x2C: // TIX - this.MicroSteps.AppendLine("-----TIX------"); - int DataW; - int tempTIX; - DataW = this.FetchWord(TA); - this.MicroSteps.AppendLine("X <- " + X.ToString("X6") + " + 1"); - - tempTIX = ++this.X - DataW; - if (tempTIX < 0) - { - this.SW = this.SW | 0x40; - this.SW = this.SW & 0xFFFF7F; - } - else if (tempTIX == 0) - { - this.SW = this.SW & 0xFFFF3F; - } - else - { - this.SW = this.SW | 0x80; - this.SW = this.SW & 0xFFFFBF; - } - this.MicroSteps.AppendLine("PC <- " + this.PC.ToString("X6") + " + 3"); - this.PC += 3; - break; - - case 0xDC: // WD (Write to Device) - this.MicroSteps.AppendLine("-----WD------"); - /*** WD ***/ - - byte dataByteW; - dataByteW = (byte)this.A; - int DeviceNumberToWriteTo; - DeviceNumberToWriteTo = this.FetchWord(TA); - - // Set Device's Status Word to BUSY - this.Devices[DeviceNumberToWriteTo].DeviceSW &= 0xFFFF3F; - - // Write the byte to the device - this.Devices[DeviceNumberToWriteTo].WriteByte(dataByteW); - - // Set Device's Status Word to AVAILABLE - this.Devices[DeviceNumberToWriteTo].DeviceSW |= 0x40; - this.Devices[DeviceNumberToWriteTo].DeviceSW &= 0xFFFF7F; - this.MicroSteps.AppendLine("Device" + DeviceNumberToWriteTo.ToString() + " <- " + dataByteW.ToString("X6") ); - this.MicroSteps.AppendLine("PC <- " + this.PC.ToString("X6") + " + 3"); - this.PC += 3; - break; - - } - - - - - } - - - public void LoadToMemory(String line, int StartAddress, int Length) - { - int i = 9, num = 0, BytesRead = 0, index = StartAddress; - while (BytesRead < Length) - { - char ch = line[i++]; - if (ch >= 'A') - { - ch -= (char)7; - } - ch -= (char)48; - num = ch << 4; - - ch = line[i++]; - if (ch >= 'A') - { - ch -= (char)7; - } - ch -= (char)48; - num += ch; - BytesRead++; - StoreByte(index++, (byte)num); - } - - } - - public void DecodeInstruction(int FullInstruction, ref int OpCode, ref int TargetAddress) - { - bool INDEXED = false; - int XBit = 0; - XBit = (FullInstruction & 0x8000); - INDEXED = (XBit > 0); - - TargetAddress = FullInstruction & 0x7FFF; - OpCode = FullInstruction & 0xFF0000; - OpCode = OpCode >> 16; - if (INDEXED == true) - { - TargetAddress += this.X; // Add contents of X register to address for indexed Mode - } - } - - - - } - - -} diff --git a/SIC Simulator/SIC_CPU.ico b/SIC Simulator/SIC_CPU.ico deleted file mode 100644 index 36c01c7..0000000 Binary files a/SIC Simulator/SIC_CPU.ico and /dev/null differ diff --git a/SIC Simulator/SIC_Device.cs b/SIC Simulator/SIC_Device.cs deleted file mode 100644 index a0639cf..0000000 --- a/SIC Simulator/SIC_Device.cs +++ /dev/null @@ -1,100 +0,0 @@ -using System; -using System.CodeDom.Compiler; -using System.Collections.Generic; -using System.Data; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace SIC_Simulator -{ - class SIC_Device - { - private int DeviceID; - List WriteBuffer; - - /// - /// Device Status Word - /// - public int DeviceSW; - - - private StringBuilder WriteBufferASCII; - - public String GetWriteBufferASCIIByteString{ - get { return this.WriteBufferASCII.ToString(); } - } - - public SIC_Device( int DeviceNumber ) - { - this.DeviceID = DeviceNumber; - this.WriteBuffer = new List(); - this.DeviceSW = 0; - this.WriteBufferASCII = new System.Text.StringBuilder(); - } - - public void WriteByte( byte Value) - { - WriteBuffer.Add(Value); - - char ch = (char)Value; - if (!Char.IsControl(ch)) - { - this.WriteBufferASCII.Append(ch); - } - else - { - this.WriteBufferASCII.Append("<" + Value.ToString("X2") + ">"); - } - - } - - - public byte ReadByte() - { - byte Z = 0; - - return Z; - } - - - /// - /// Returns a UTF-8 String of the ASCII Bytes written to this device - /// - /// - public string GetASCIIStringWrites() - { - String Result = String.Empty; - - foreach( byte b in WriteBuffer) - { - char ch = (char)b; - if (! Char.IsControl(ch) ) { - Result += ch; - - } else - { - Result += "<" + b.ToString("X2") + ">"; - } - - } - - - - return Result; - } - - /// - /// Returns a UTF-8 String of the HEX Codes of the bytes written to this device - /// - /// - public string GetHEXStringWrites() - { - String Result = String.Empty; - return Result; - } - - - - } -} diff --git a/SIC Simulator/dlgRelocateObjectFile.cs b/SIC Simulator/dlgRelocateObjectFile.cs deleted file mode 100644 index ba53954..0000000 --- a/SIC Simulator/dlgRelocateObjectFile.cs +++ /dev/null @@ -1,90 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace SIC_Simulator -{ - - - - - - - public partial class dlgRelocateObjectFile : Form - { - public dlgRelocateObjectFile( String ProgramName, int AssembledAddress, int ProgramLength, int MRecords) - { - InitializeComponent(); - - this.RelocatedToAddress = AssembledAddress; - this.ProgramName = ProgramName; - this.ProgramLengthInBytes = ProgramLength; - this.lblProgramName.Text = "Program Name: " + this.ProgramName; - this.lblProgramLength.Text = "Program Length :" + this.ProgramLengthInBytes.ToString() + "(hex) bytes"; - this.txtAssembledStartPoint.Text = AssembledAddress.ToString("X6"); - this.txtRelocationAddress.Text = AssembledAddress.ToString("X6"); - this.lblRelocationRecords.Text = "Relocation Records : " + MRecords.ToString(); - - - MaxAddress = 32767 - ProgramLength; - - this.lblNote.Text = "NOTE: This program cannot be relocated to an address higher than " + MaxAddress.ToString("X6"); - - } - private int MaxAddress = 0; - public int RelocatedToAddress; - public String ProgramName = string.Empty; - public int ProgramLengthInBytes; - - private void btnCancel_Click(object sender, EventArgs e) - { - this.DialogResult = DialogResult.Cancel; - } - - private void btnOK_Click(object sender, EventArgs e) - { - // Validate Entries - String temp = this.txtRelocationAddress.Text.Trim(); - int IntValue; - - if (temp.Length == 0) - { - MessageBox.Show("Please specify a relocation address.", "No Relocation Address Specified"); - this.txtRelocationAddress.Focus(); - return; - } - - IntValue = int.Parse(temp, System.Globalization.NumberStyles.HexNumber); - - - if (IntValue > 32767) - { - MessageBox.Show("The memory address specified is outside of SIC Memory Range", "Invalid Memory Address"); - this.txtRelocationAddress.Focus(); - return; - } - - if ( IntValue > this.MaxAddress ) - { - MessageBox.Show("Invalid relocation. Not enough memory available to relocate this program to " + IntValue.ToString("X6"), "Invalid Memory Address"); - this.txtRelocationAddress.Focus(); - return; - - } - - - - // If we get here...we are good - - this.RelocatedToAddress = IntValue; - - this.DialogResult = DialogResult.OK; - } - } -} diff --git a/SIC Simulator/frmAbout.cs b/SIC Simulator/frmAbout.cs deleted file mode 100644 index b39b277..0000000 --- a/SIC Simulator/frmAbout.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace SIC_Simulator -{ - public partial class frmAbout : Form - { - public frmAbout() - { - InitializeComponent(); - - - } - - - private void frmAbout_Load(object sender, EventArgs e) - { - this.lvAuthors.Items.Clear(); - - ListViewItem ScottPLvItem; - ScottPLvItem = new ListViewItem("Scott Piersall", "Chief Architect & Lead Developer VM"); - this.lvAuthors.Items.Add(ScottPLvItem); - - ListViewItem RileySLvItem; - RileySLvItem = new ListViewItem("Riley Strickland", "Pass 1 & 2 of SIC Assembler"); - this.lvAuthors.Items.Add(RileySLvItem); - - ListViewItem EllisLLvItem; - EllisLLvItem = new ListViewItem("Ellis Levine", "Pass 1 & 2 of SIC Assembler"); - this.lvAuthors.Items.Add(EllisLLvItem); - - - ListViewItem KrisWLvItem; - KrisWLvItem = new ListViewItem("Kris Wieben", "GUI & VM Testing"); - this.lvAuthors.Items.Add(KrisWLvItem); - - ListViewItem BrandonWLvItem; - BrandonWLvItem = new ListViewItem("Brandon Woodrum", "Absolute & Relocating Loader"); - this.lvAuthors.Items.Add(BrandonWLvItem); - - - this.lblVersion.Text = "Version: " + Application.ProductVersion.ToString(); - } - - - private void btnOk_Click(object sender, EventArgs e) - { - this.Close(); - } - } -} diff --git a/SIC Simulator/SIC Simulator.sln b/SICVM.sln similarity index 57% rename from SIC Simulator/SIC Simulator.sln rename to SICVM.sln index fb4fc1f..e7bc955 100644 --- a/SIC Simulator/SIC Simulator.sln +++ b/SICVM.sln @@ -1,9 +1,9 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.30413.136 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31912.275 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SIC Simulator", "SIC Simulator.csproj", "{1BE03959-6239-42B3-A318-02B849FE4EBC}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SICVirtualMachine", "SICVirtualMachine\SICVirtualMachine.csproj", "{968F6A01-E997-46F5-A979-9F1FBF1E6D84}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -11,10 +11,10 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {1BE03959-6239-42B3-A318-02B849FE4EBC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1BE03959-6239-42B3-A318-02B849FE4EBC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1BE03959-6239-42B3-A318-02B849FE4EBC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1BE03959-6239-42B3-A318-02B849FE4EBC}.Release|Any CPU.Build.0 = Release|Any CPU + {968F6A01-E997-46F5-A979-9F1FBF1E6D84}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {968F6A01-E997-46F5-A979-9F1FBF1E6D84}.Debug|Any CPU.Build.0 = Debug|Any CPU + {968F6A01-E997-46F5-A979-9F1FBF1E6D84}.Release|Any CPU.ActiveCfg = Release|Any CPU + {968F6A01-E997-46F5-A979-9F1FBF1E6D84}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/SIC Simulator/App.config b/SICVirtualMachine/App.config similarity index 59% rename from SIC Simulator/App.config rename to SICVirtualMachine/App.config index 56efbc7..bae5d6d 100644 --- a/SIC Simulator/App.config +++ b/SICVirtualMachine/App.config @@ -1,6 +1,6 @@ - + - + - \ No newline at end of file + diff --git a/SIC Simulator/Extensions/integer.cs b/SICVirtualMachine/Extensions/IntegerExtensions.cs similarity index 72% rename from SIC Simulator/Extensions/integer.cs rename to SICVirtualMachine/Extensions/IntegerExtensions.cs index 2a8f38e..2d772d5 100644 --- a/SIC Simulator/Extensions/integer.cs +++ b/SICVirtualMachine/Extensions/IntegerExtensions.cs @@ -1,13 +1,8 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.CompilerServices; -using System.Text; -using System.Threading.Tasks; -namespace SIC_Simulator.Extensions +namespace SICVirtualMachine.Extensions { - static class integerExtensions + internal static class IntegerExtensions { /// /// Refreshes Register Displays on background thread. Calls are marshalled to UI thread @@ -16,7 +11,9 @@ public static string To24BITBinary(this int a) { string res = string.Empty; if (a >= 0) + { res = Convert.ToString(a, 2); + } else { // Number is Negative... We have two push two's complement in 24 bits more elegantly diff --git a/SICVirtualMachine/Model/AssemblerException.cs b/SICVirtualMachine/Model/AssemblerException.cs new file mode 100644 index 0000000..51831c4 --- /dev/null +++ b/SICVirtualMachine/Model/AssemblerException.cs @@ -0,0 +1,186 @@ +using SICVirtualMachine.Model; +using System; + +// Assigned to Ellis Levine +// Can be tested after Assembler is finished + +// Uses inheritance so that, every Exception inherits AssemblerException, which inherits System.Exception class +// More exceptions can be added to this file as development continues + +// When calling an exception from another class (ex. AssemblerException ae) doing ae.HResult should return the line number (not tested yet) + +namespace SICVirtualMachine.Model +{ + internal class AssemblerException : Exception + { + public AssemblerException() + { + + } + + public AssemblerException(string message) : base(message) + { + + } + + public AssemblerException(string message, Instruction inst) : base(message) + { + HResult = inst.LineNumber; + } + } + + internal class AssemblerInvalidSymbolException : AssemblerException + { + public AssemblerInvalidSymbolException() + { + + } + + public AssemblerInvalidSymbolException(string message) : base(message) + { + + } + + public AssemblerInvalidSymbolException(string message, Instruction inst) : base(message) + { + HResult = inst.LineNumber; + } + } + + internal class UndefinedSymbolException : AssemblerException + { + public UndefinedSymbolException() + { + + } + public UndefinedSymbolException(string message) : base(message) + { + + } + public UndefinedSymbolException(string message, Instruction inst) : base(message) + { + HResult = inst.LineNumber; + } + } + + internal class InvalidOpcodeException : AssemblerException + { + public InvalidOpcodeException() + { + + } + + public InvalidOpcodeException(string message) : base(message) + { + + } + + public InvalidOpcodeException(string message, Instruction inst) : base(message) + { + HResult = inst.LineNumber; + } + } + + internal class MultipleSymbolDefinitionException : AssemblerException + { + public MultipleSymbolDefinitionException() + { + + } + + public MultipleSymbolDefinitionException(string message) : base(message) + { + + } + + public MultipleSymbolDefinitionException(string message, Instruction inst) : base(message) + { + HResult = inst.LineNumber; + } + } + + internal class InvalidHexConstantException : AssemblerException + { + public InvalidHexConstantException() + { + + } + + public InvalidHexConstantException(string message) : base(message) + { + + } + + public InvalidHexConstantException(string message, Instruction inst) : base(message) + { + HResult = inst.LineNumber; + } + } + + internal class MissingOrExtraOperandException : AssemblerException + { + public MissingOrExtraOperandException() + { + + } + + public MissingOrExtraOperandException(string message) : base(message) + { + + } + + public MissingOrExtraOperandException(string message, Instruction inst) : base(message) + { + HResult = inst.LineNumber; + } + } + + internal class InvalidFileTypeException : AssemblerException + { + public InvalidFileTypeException() + { + + } + + public InvalidFileTypeException(string message) : base(message) + { + + } + } + + internal class OutofMemoryException : AssemblerException + { + public OutofMemoryException() + { + + } + + public OutofMemoryException(string message) : base(message) + { + + } + + public OutofMemoryException(string message, Instruction inst) : base(message) + { + HResult = inst.LineNumber; + } + } + + internal class BlankLineException : AssemblerException + { + public BlankLineException() + { + + } + + public BlankLineException(string message) : base(message) + { + + } + + public BlankLineException(string message, Instruction inst) : base(message) + { + HResult = inst.LineNumber; + } + } +} diff --git a/SIC Simulator/Linker.cs b/SICVirtualMachine/Model/Directive.cs similarity index 50% rename from SIC Simulator/Linker.cs rename to SICVirtualMachine/Model/Directive.cs index 35d0e75..4837d48 100644 --- a/SIC Simulator/Linker.cs +++ b/SICVirtualMachine/Model/Directive.cs @@ -4,9 +4,17 @@ using System.Text; using System.Threading.Tasks; -namespace SIC_Simulator +namespace SICVirtualMachine.Model { - class Linker + internal enum Directive { + END, + BYTE, + WORD, + RESB, + RESW, + RESR, + EXPORTS, + START } } diff --git a/SICVirtualMachine/Model/Instruction.cs b/SICVirtualMachine/Model/Instruction.cs new file mode 100644 index 0000000..b2d798a --- /dev/null +++ b/SICVirtualMachine/Model/Instruction.cs @@ -0,0 +1,19 @@ +namespace SICVirtualMachine.Model +{ + internal class Instruction + { + public string Symbol { get; } + public string OpCode { get; } + public string Operand { get; } + public int LineNumber { get; } + public int MemoryAddress { get; set; } + + public Instruction(string symbol, string opCode, string operand, int lineNumber) + { + Symbol = symbol; + OpCode = opCode; + Operand = operand; + LineNumber = lineNumber; + } + } +} diff --git a/SICVirtualMachine/Model/Mod.cs b/SICVirtualMachine/Model/Mod.cs new file mode 100644 index 0000000..f12bb70 --- /dev/null +++ b/SICVirtualMachine/Model/Mod.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SICVirtualMachine.Model +{ + + //New Code Segment By Brandon And Nick + + //class for MOD constructor that holds info for Modification + internal class Mod + { + public int Address { get; private set; } + public int Half { get; private set; } + public bool Flag { get; private set; } + public Mod Next { get; set; } + public bool Error { get; private set; } + + //if our head is which is a place holder is returned then nothing was found in search. sets its boolean to true + public void SetError() + { + Error = true; + } + + //sets all values for created mod + public void Set(int address, int half, bool flag) + { + Address = address; + Half = half; + Flag = flag; + } + + //searches linked list for Mod record matching T-record starting address, if head is returned as place holder nothing was found + public Mod Search(Mod head, int add) + { + Mod error = new Mod(); + error.SetError(); + + while (head.Next != null) + { + if (add != head.Address) + { + head = head.Next; + } + else + { + return head; + } + } + + return error; + } + } +} diff --git a/SICVirtualMachine/Model/OPCode.cs b/SICVirtualMachine/Model/OPCode.cs new file mode 100644 index 0000000..2c172dd --- /dev/null +++ b/SICVirtualMachine/Model/OPCode.cs @@ -0,0 +1,65 @@ +namespace SICVirtualMachine.Model +{ + internal enum OPCode + { + ADD = 0x18, + ADDF = 0x58, + ADDR = 0x90, + AND = 0x40, + CLEAR = 0xB4, + COMP = 0x28, + COMPF = 0x88, + COMPR = 0xA0, + DIV = 0x24, + DIVF = 0x64, + DIVR = 0x9C, + FIX = 0xC4, + FLOAT = 0xC0, + HIO = 0xF4, + J = 0x3C, + JEQ = 0x30, + JGT = 0x34, + JLT = 0x38, + JSUB = 0x48, + LDA = 0x00, + LDB = 0x68, + LDCH = 0x50, + LDF = 0x70, + LDL = 0x08, + LDS = 0x6C, + LDT = 0x74, + LDX = 0x04, + LPS = 0xD0, + MUL = 0x20, + MULF = 0x60, + MULR = 0x98, + NORM = 0xC8, + OR = 0x44, + RD = 0xD8, + RMO = 0xAC, + RSUB = 0x4C, + SHIFTL = 0xA4, + SHIFTR = 0xA8, + SIO = 0xF0, + SSK = 0xEC, + STA = 0x0C, + STB = 0x78, + STCH = 0x54, + STF = 0x80, + STI = 0xD4, + STL = 0x14, + STS = 0x7C, + STSW = 0xE8, + STT = 0x84, + STX = 0x10, + SUB = 0x1C, + SUBF = 0x5C, + SUBR = 0x94, + SVC = 0xB0, + TD = 0xE0, + TIO = 0xF8, + TIX = 0x2C, + TIXR = 0xB8, + WD = 0xDC + } +} diff --git a/SICVirtualMachine/Model/SICAssemblyException.cs b/SICVirtualMachine/Model/SICAssemblyException.cs new file mode 100644 index 0000000..fe79f08 --- /dev/null +++ b/SICVirtualMachine/Model/SICAssemblyException.cs @@ -0,0 +1,20 @@ +using System; + +namespace SICVirtualMachine.Model +{ + internal class SICAssemblyException : Exception + { + public SICAssemblyException(string Message) : base(Message) + { + + } + } + + internal class SICDivideByZeroException : Exception + { + public SICDivideByZeroException(string Message) : base(Message) + { + + } + } +} diff --git a/SIC Simulator/Program.cs b/SICVirtualMachine/Program.cs similarity index 60% rename from SIC Simulator/Program.cs rename to SICVirtualMachine/Program.cs index 6dad6e5..e063788 100644 --- a/SIC Simulator/Program.cs +++ b/SICVirtualMachine/Program.cs @@ -1,22 +1,20 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; using System.Windows.Forms; +using SICVirtualMachine.View; -namespace SIC_Simulator +namespace SICVirtualMachine { - static class Program + internal static class Program { /// /// The main entry point for the application. /// [STAThread] - static void Main() + private static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new Form1()); + Application.Run(new MainWindow()); } } } diff --git a/SIC Simulator/ImagesAndIcons/SIC_CPU.ico b/SICVirtualMachine/Resources/SIC_CPU.ico similarity index 100% rename from SIC Simulator/ImagesAndIcons/SIC_CPU.ico rename to SICVirtualMachine/Resources/SIC_CPU.ico diff --git a/SICVirtualMachine/SIC/Assembler.cs b/SICVirtualMachine/SIC/Assembler.cs new file mode 100644 index 0000000..235cf00 --- /dev/null +++ b/SICVirtualMachine/SIC/Assembler.cs @@ -0,0 +1,411 @@ +using SICVirtualMachine.Model; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text.RegularExpressions; + +namespace SICVirtualMachine.SIC +{ + + // Assigned to Kris Wieben + internal class Assembler + { + private static readonly char[] InvalidSymbolCharacters = { ' ', '$', '!', '=', '+', '-', '(', ')', '@' }; + + public string ObjectCode { get; private set; } + public string SICSource { get; private set; } + public string InstructionSource { get; private set; } + + public Dictionary SymbolTable { get; private set; } = new Dictionary(); + public List InstructionList { get; private set; } = new List(); + + private enum PROCESS { INIT, END, START, ERROR } + + private PROCESS _process = PROCESS.INIT; + + public Assembler(string filePath) + { + if (!File.Exists(filePath)) + { + throw new Exception($"Input file {filePath} does not exist."); + } + + StreamReader file = new StreamReader(filePath); + + PassOne(file); + PassTwo(); + + InstructionSource = string.Format("{0}\t{1}\t{2}\t{3}\t{4}\n", "Line", "Address", "Symbol", "OpCode", "Operand"); + + foreach (Instruction tmp in InstructionList) + { + InstructionSource += string.Format("{0}\t{1}\t{2}\t{3}\t{4}\n", tmp.LineNumber, tmp.MemoryAddress.ToString("X"), tmp.Symbol, tmp.OpCode, tmp.Operand); + } + } + + void PassOne(StreamReader file) + { + int memory_address = 0,line_counter = 0; + string line, tmpLine; + + while ((line = file.ReadLine()) != null) + { + tmpLine = line; + tmpLine = tmpLine.Trim(); + line_counter++; + + if (string.IsNullOrEmpty(tmpLine) || tmpLine[0] == '#') + { // skip comments and blank lines + continue; + } + + line = Regex.Replace(line, @"\s+(?=([^']*'[^']*')*[^']*$)", "\t"); // clean line for assembler + + if (_process == PROCESS.END) + { + throw new Exception($"{line}\nLine {line_counter}: REACHED END DIRECTIVE BUT STILL SCANNING CODE"); + } + + string[] lineArray = line.Split('\t'); + + if (lineArray[0] is null || lineArray[1] is null) + { + throw new Exception($"{line}\nLine {line_counter}: MALFORMED SIC FILE"); + } + + string operand = (lineArray.Length == 2) ? "" : lineArray[2]; + Instruction instruction_line = new Instruction(lineArray[0], lineArray[1], operand, line_counter); + + if (instruction_line.Symbol.Length != 0) + { + if (IsDirective(instruction_line.Symbol)) + { + throw new Exception($"{line}\nLine {line_counter}: DIRECTIVE IN SYMBOL FIELD"); + } + + if (IsNotSymbol(instruction_line.Symbol)) + { + throw new Exception($"{line}\nLine {line_counter}: INVALID SYMBOL"); + } + + if (SymbolTable.ContainsKey(instruction_line.Symbol)) + { + throw new Exception($"{line}\nLine {line_counter}: DUPLICATE SYMBOL"); + } + + if (instruction_line.OpCode.Equals("START")) + { + _process = PROCESS.START; + + if (int.TryParse(instruction_line.Operand, System.Globalization.NumberStyles.HexNumber, null, out memory_address)) // check if hex value + { + instruction_line.MemoryAddress = memory_address; + if (instruction_line.MemoryAddress >= 32768) + { + //throwError(MEMORY_SIZE_); + } + + SymbolTable.Add(instruction_line.Symbol, instruction_line); + InstructionList.Add(instruction_line); + } + else + { + throw new Exception($"{line}\nLine {line_counter}: MALFORMED BYTE FLAG"); + } + + continue; + } + + instruction_line.MemoryAddress = memory_address; + SymbolTable.Add(instruction_line.Symbol, instruction_line); + } + + InstructionList.Add(instruction_line); + + if (_process != PROCESS.START) + { + throw new Exception($"Line {line}: START DIRECTIVE NOT DEFINED"); + } + + + instruction_line.MemoryAddress = memory_address; + + if (instruction_line.OpCode.Equals("END")) + { + _process = PROCESS.END; + continue; + } + + // START MEMORY INCREASE + int len; // var for numbers.. + if (Enum.IsDefined(typeof(OPCode), instruction_line.OpCode)) + { + memory_address += 3; + } + else if (instruction_line.OpCode.Equals("WORD")) + { + if (int.TryParse(instruction_line.Operand, out len)) + { + memory_address += 3; + } + else + { + throw new Exception($"{line}\nLine {instruction_line.LineNumber} CONSTANT {instruction_line.Operand} FORMAT VALIDATION FAILED:"); + } + + //if (len >= MAX_INT_SIZE || len <= MIN_INT_SIZE) // check max int size + // throwError(WORD_SIZE_); + } + else if (instruction_line.OpCode.Equals("RESW")) + { + if (int.TryParse(instruction_line.Operand, out len)) + { + memory_address += 3 * len; + } + else + { + throw new Exception($"{line}\nLine {instruction_line.LineNumber} CONSTANT {instruction_line.Operand} FORMAT VALIDATION FAILED:"); + } + } + else if (instruction_line.OpCode.Equals("BYTE")) + { + len = instruction_line.Operand.Length; + if (instruction_line.Operand[0] == 'C') + { // char + //if (isNotByteDelimited(Operand, len)) + // throwError(BYTE_DELIMITER); + memory_address += (len - 3); + } + else if (instruction_line.Operand[0] == 'X') + { // hex + //if (isNotByteDelimited(Operand, len)) + // throwError(BYTE_DELIMITER); + + //if (!isHexLiteralStrRange(Operand, 2, len)) + // throwError(BYTE_HEX_FORMAT); + + memory_address += (len - 3) / 2; + } + else + { + throw new Exception($"{line}\nLine {instruction_line.LineNumber}: UNKOWN BYTE FLAG"); + } + } + else if (instruction_line.OpCode.Equals("RESB")) + { + if (int.TryParse(instruction_line.Operand, out len)) + { + memory_address += len; + } + else + { + throw new Exception($"{line}\nLine {instruction_line.LineNumber} CONSTANT {instruction_line.Operand} FORMAT VALIDATION FAILED:"); + } + } + else + { + throw new Exception($"{line}\nLine {instruction_line.LineNumber}: UNKNOWN OPCODE OR DIRECTIVE {instruction_line.OpCode}"); + } + + if (memory_address > 32768) + { + throw new Exception($"{line}\nLine {instruction_line.LineNumber}: MEMORY ADDRESS EXCEEDS AVILABLE RAM"); + } + } + } + + void PassTwo() + { + Instruction head = InstructionList.First(); + Instruction tail = InstructionList.Last(); + + ObjectCode += string.Format("H{0,-6}{1,6:X6}{2,6:X6}\n", head.Symbol, head.MemoryAddress, tail.MemoryAddress - head.MemoryAddress); + + int memory_address = head.MemoryAddress; + int line_counter = 0; + + bool first = true; + bool notSkipping = true; + + SICSource = ""; + + foreach (Instruction row in InstructionList) + { + if (first) + { // skip the header record + first = !first; + continue; + } + + if (line_counter == 10) + { // save T record + SaveTRecord(row.MemoryAddress); + } + + if (Enum.TryParse(row.OpCode, out OPCode opCode)) + { + SetSkippedAddress(row); + string[] indexModeSplit = row.Operand.Split(','); + + if (indexModeSplit[0].Length != 0 && !IsNotSymbol(indexModeSplit[0])) + { + KeyValuePair symbol = SymbolTable.FirstOrDefault(x => x.Key.Equals(indexModeSplit[0])); + + if (symbol.Key != null) + { + int memoryAddress = symbol.Value.MemoryAddress; + + if (indexModeSplit.Length != 1) + {// index mode + memoryAddress += 0x8000; // set X bit + } + + SICSource += string.Format("{0,2:X2}{1,4:X4}", (int)opCode, memoryAddress); + } + else + { + throw new Exception($"{row.Symbol} {row.OpCode} {row.Operand}\nLine {row.LineNumber}: UNDEFINED SYMBOL {row.Operand}"); + } + } + else + { + SICSource += string.Format("{0,2:X2}{1,4:X4}", (int)opCode, 0); + } + } + else if (row.OpCode.Equals("WORD")) + { + SetSkippedAddress(row); + + int val = int.Parse(row.Operand) & 0xFFFFFF; + SICSource += string.Format("{0,6:X6}", val); + } + else if (row.OpCode.Equals("BYTE")) + { + SetSkippedAddress(row); + + if (row.Operand[0] == 'C') + { // char + string[] tmp = row.Operand.Split('\''); + int counter = 0; + + foreach (char ch in tmp[1]) + { + SICSource += string.Format("{0,2:X2}", (byte)ch); + counter++; + + if (SICSource.Length == 60) + { + SaveTRecord(row.MemoryAddress + counter); + counter = 0; + } + } + + line_counter = (int)Math.Ceiling((double)(counter * 2) / 6); + } + else + { // hex + string[] tmp = row.Operand.Split('\''); + SICSource += string.Format("{0}", tmp[1]); + } + } + else if (row.OpCode.Equals("RESB") || row.OpCode.Equals("RESW")) + { + if (notSkipping) + { + SaveTRecord(row.MemoryAddress); + } + else + { + memory_address = row.MemoryAddress; + } + + notSkipping = false; + continue; + } + else if (row.OpCode.Equals("END")) + { + if (notSkipping) + { // need to handle RESB and RESW directives placed at the bottom of the SIC code + SaveTRecord(memory_address); + } + + KeyValuePair symbol = SymbolTable.FirstOrDefault(x => x.Key.Equals(row.Operand)); + if (symbol.Key != null) + { + Instruction firstInstruction = InstructionList.FirstOrDefault(x => x.MemoryAddress >= symbol.Value.MemoryAddress && IsInstruction(x.OpCode)); + + if (firstInstruction is null) + { + firstInstruction = head; + } + + ObjectCode += string.Format("E{0,6:X6}", firstInstruction.MemoryAddress); // need the first instruction + } + else if (string.IsNullOrEmpty(row.Operand)) + { + ObjectCode += string.Format("E{0,6:X6}", head.MemoryAddress); // oops... this is optional.. defaulting to the start directive + } + else + { + throw new Exception($"{row.Symbol} {row.OpCode} {row.Operand}\nLine {row.LineNumber}: UNDEFINED SYMBOL {row.Operand}"); + } + } + + line_counter++; + } + + void SetSkippedAddress(Instruction row) + { + if (!notSkipping) + { + memory_address = row.MemoryAddress; + } + + notSkipping = true; + } + + void SaveTRecord(int current_address) + { + int lineLength = (int)Math.Ceiling((double)(SICSource.Length / 2)); // count odd length bytes + + ObjectCode += string.Format("T{0,6:X6}{1,2:X2}{2}\n", memory_address, lineLength, SICSource); + SICSource = ""; + notSkipping = true; + memory_address = current_address; + line_counter = 0; + } + } + + public static bool IsInstruction(string who) + { + return Enum.TryParse(who, out _); + } + + public static bool IsDirective(string who) + { + return Enum.TryParse(who, out _); + } + + public static bool IsNotSymbol(string who) + { + if (string.IsNullOrEmpty(who)) + { + return false; + } + + if (who.Length > 6) + { + return true; + } + + if (char.IsDigit(who[0])) + { + return true; + } + + return InvalidSymbolCharacters.Any(x => who.Contains(x)); //contains any bad characters? TODO: Stricter Checking as C# is UTF-16... + } + } +} + diff --git a/SICVirtualMachine/SIC/CPU.cs b/SICVirtualMachine/SIC/CPU.cs new file mode 100644 index 0000000..896147a --- /dev/null +++ b/SICVirtualMachine/SIC/CPU.cs @@ -0,0 +1,720 @@ +using SICVirtualMachine.Model; +using System; +using System.Globalization; +using System.Text; + +namespace SICVirtualMachine.SIC +{ + + [Serializable()] + internal class CPU + { + public static readonly int NumDevices = 65; + public int CurrentProgramEndAddress = 0; + public int CurrentProgramStartAddress = 0; + + public int PC = 0; + public int A = 0; + public int X = 0; + public int L = 0; + public int SW = 0; + + public byte[] MemoryBytes; + + public Device[] Devices; + private StringBuilder MicroSteps; + + public bool MachineStateSaved = false; + + public string MicrocodeSteps => MicroSteps.ToString(); + + /// + /// Constructs a SIC VM (CPU and Memory) + /// + /// + public CPU(bool ZeroizeBytes) + { + PC = A = X = L = SW = 0; + MemoryBytes = new byte[32768]; + + if (ZeroizeBytes == true) + { + ZeroAllMemory(); + } + else + { + RandomizeMemory(); + } + + Devices = new Device[NumDevices]; + + for (int i = 0; i < NumDevices; i++) + { + Devices[i] = new Device(i); + } + MicroSteps = new StringBuilder(); + MachineStateSaved = false; + } + + /// + /// Randomize all memory bytes in the SIC + /// Simulates filling memory with "JUNK" + /// Way to see if programs specifically set memory when needed + /// and do not rely on "JUNK" values + /// + public void RandomizeMemory() + { + Random rnd = new Random(Guid.NewGuid().GetHashCode()); + rnd.NextBytes(MemoryBytes); + MachineStateSaved = false; + } + + /// + /// Sets all memory bits to ZERO in the SIC + /// + public void ZeroAllMemory() + { + byte zero = 0; + + for (int x = 0; x < 32768; x++) + { + MemoryBytes[x] = zero; + } + + MachineStateSaved = false; + } + + /// + /// Performs a "hard" reset of the virtual machine. + /// 1. All registers and SW are set to zero + /// 2. All Memory is zeroed. + /// + public void ResetVM() + { + PC = 0; + A = 0; + X = 0; + L = 0; + SW = 0; + ZeroAllMemory(); + MicroSteps = new StringBuilder(); + } + + /// + /// Fetches a 24-bit word from Memory and places it into an integer + /// + /// Address of Memory Location in SIC [0..32767] + /// + public int FetchWord(int Address) + { + int num1 = 0; + int num2 = 0; + for (int i = 0; i < 3; ++i) + { + char ch = (char)MemoryBytes[Address++]; + num2 = ch; + num2 &= 0x000000FF; + num1 |= num2; + num1 <<= 8; + } + num1 >>= 8; + + return num1; + } + + /// + /// Fetches Byte in Memory and returns character type + /// + /// + /// + public char FetchByte(int Address) + { + return (char)MemoryBytes[Address]; + } + + public void StoreWord(int Address, int data) + { + byte b; + for (int i = 2; i >= 0; --i) + { + b = (byte)(data & 0xFF); + MemoryBytes[Address + i] = b; + data >>= 8; + } + MachineStateSaved = false; + } + + public void StoreByte(int address, byte data) + { + MemoryBytes[address] = data; + MachineStateSaved = false; + } + + /// + /// method steps the CPU one time. + /// FETCH->DECODE->EXECUTE + /// + public void PerformStep() + { + // 1. Fetch the next instruction by pulling the WORD from memory + // pointed to by PC (Address of Next Instruction) + // + // 2. Decode the instruction + // + // 3. Execute Instruction + // --> Execute will advance PC by 3 bytes(1 word) or change it to + // --> a target address if we have a JUMP, or RSUB + + int NextInstruction; + int op = 0; + int TA = 0; + + NextInstruction = FetchWord(PC); + + DecodeInstruction(NextInstruction, ref op, ref TA); + + ExecuteInstruction(op, TA); + MachineStateSaved = false; + } + + /// + /// Returns a human-readable description of the instruction and operand value located + /// at Address. The string has two parts, delimited by a | + /// mnemonic target address | complete description of instruction and result + /// + /// Absolute address of 3-byte instruction + /// String with description + public (string result, string details, string effect) GetInstructionDescription(int address) + { + int word = FetchWord(address); // Fetch the Word at Address + int targetAddress = word & 0x7FFF; + OPCode opCode = (OPCode)((word & 0xFF0000) >> 16); + + int xBit = word & 0x8000; + bool indexed = xBit > 0; + + string result; + string details = string.Empty; + string effect = string.Empty; + switch (opCode) + { + case OPCode.ADD: // ADD + result = "ADD"; + details = "Add Value in Target Address to Register A"; + effect = "A <- (A) + (TA)"; + break; + + case OPCode.AND: // AND + result = "AND"; + details = "Perform Bitwise AND on Value in Target Address and Register A, store result in A"; + effect = "A <- (A) && (TA)"; + break; + + case OPCode.COMP: // CMP (Compare and set Status Word SW) + result = "CMP"; + break; + + case OPCode.DIV: // DIV + result = "DIV"; + details = "Divide Register A by Value in Target Address "; + effect = "A <- (A) / (TA)"; + break; + + case OPCode.J: // J + result = "J"; + details = "Perform Unconditional Jump to Target Address"; + effect = "PC <- (TA)"; + break; + + case OPCode.JEQ: // JEQ + result = "JEQ"; + details = "Perform Conditional Jump to Target Address when CC = 00"; + effect = "PC <- (TA) if CC = 00"; + break; + + case OPCode.JGT: // JGT + result = "JGT"; + details = "Perform Conditional Jump to Target Address when CC = 10"; + effect = "PC <- (TA) if CC = 10"; + break; + + case OPCode.JLT: // JLT + result = "JLT"; + details = "Perform Conditional Jump to Target Address when CC = 01"; + effect = "PC <- (TA) if CC = 01"; + break; + + case OPCode.JSUB: // JSUB (Jump to subroutine starting at TA. Preserve PC by storing in L) + result = "JSUB"; + details = "Jump to Subroutine at Target Address. Preserve PC By Storing in L"; + effect = "L <- PC; PC <- (TA)"; + break; + + case OPCode.LDA: // LDA + result = "LDA"; + details = "Load Value in Target Address to Register A"; + effect = "A <- (TA)"; + break; + + case OPCode.LDCH: // LDCH + result = "LDCH"; + details = "Load Character from Device Specified in Target Address to Rightmost Byte in A"; + effect = "A[rightmost byte] <- Device(TA)"; + break; + + case OPCode.LDL: // LDL + result = "LDL"; + details = "Load Value in Target Address to Register L"; + effect = "L <- (TA)"; + break; + + case OPCode.LDX: // LDX + result = "LDX"; + details = "Load Value in Target Address to Register X"; + effect = "X <- (TA)"; + break; + + case OPCode.MUL: // MUL + result = "MUL"; + details = "Multiple Value in Target Address by Register A Store in A"; + effect = "A <- (A) * (TA)"; + break; + + case OPCode.OR: // OR + result = "OR"; + details = "Perform Bitwise OR on Value in Target Address and Register A, store result in A"; + effect = "A <- (A) || (TA)"; + break; + + case OPCode.RSUB: // RSUB + result = "RSUB"; + details = "Return from Subroutine. "; + effect = "PC <- (L)"; + break; + + case OPCode.STA: // STA (Stores contents of A in Target Address) + result = "STA"; + details = "Store Value in Register A to Target Address"; + effect = "(TA) <- A"; + break; + + case OPCode.STCH: // STCH + result = "STCH"; + break; + + case OPCode.STL: // STL + result = "STL"; + details = "Store Value in Register L to Target Address"; + effect = "(TA) <- L"; + break; + + case OPCode.STX: // STX (Stores contents of X in Target Address) + result = "STX"; + details = "Store Value in Register X to Target Address"; + effect = "(TA) <- X"; + break; + + case OPCode.SUB: // SUB + result = "SUB"; + details = "Sub Value in Target Address to Register A"; + effect = "A <- (A) - (TA)"; + break; + + case OPCode.TD: // TD (Tests to see if a device is busy). + result = "TD"; + details = "Test Device Number Specified in Target Address"; + effect = "Set SW"; + break; + + case OPCode.TIX: // TIX + result = "TIX"; + details = "Increment value in X Register. Compare to value in Target Address"; + effect = "X <- X + 1; COMP X to M set CC"; + break; + + case OPCode.WD: // WD (Write to Device) + result = "WD"; + details = "Write rightmost byte in A to Device Number in Target Address"; + effect = " Device(TA) <- A[rightmost byte]"; + break; + + default: + result = string.Empty; + break; + } + + result += " "; + + if (indexed == true) + { + result += $"TA = TA + X -> {targetAddress:X6} + {X:X6} -> {targetAddress + X:X6}"; + } + else + { + result += $"TA = {targetAddress:X6}"; + } + + return (result, details, effect); + } + + /// + /// Executes Single Operation Code using Target Address as Operand. + /// Method is the "microcode" steps in the SIC CPU + /// to execute mnemonics + /// + /// Opcode for Instruction to Execute + /// Calculated Target Address + public void ExecuteInstruction(int opCode, int targetAddress) + { + + switch ((OPCode)opCode) + { + case OPCode.ADD: // ADD + MicroSteps.AppendLine("-----ADD------"); + MicroSteps.AppendLine("A <- " + A.ToString("X6") + " + " + FetchWord(targetAddress).ToString("X6")); + MicroSteps.AppendLine("PC <- " + PC.ToString("X6") + " + 3"); + A += FetchWord(targetAddress); + PC += 3; + break; + + case OPCode.AND: // AND + MicroSteps.AppendLine("-----AND------"); + MicroSteps.AppendLine("A <- " + A.ToString("X6") + " && " + FetchWord(targetAddress).ToString("X6")); + MicroSteps.AppendLine("PC <- " + PC.ToString("X6") + " + 3"); + A &= FetchWord(targetAddress); + PC += 3; + break; + + case OPCode.COMP: // CMP (Compare and set Status Word SW) + MicroSteps.AppendLine("-----CMP------"); + int data = FetchWord(targetAddress); + + if (A < data) + { + SW |= 0x40; + SW &= 0xFFFF7F; + MicroSteps.AppendLine("CC <- 01"); + } + else if (A == data) + { + SW &= 0xFFFF3F; + MicroSteps.AppendLine("CC <- 00"); + } + else + { + SW |= 0x80; + SW &= 0xFFFFBF; + MicroSteps.AppendLine("CC <- 10"); + } + // Condition Code Values + // CC = 00 -> Equal + // CC = 01 -> Less than + // CC = 10 -> Greater than + // CC = 11 -> Not used + MicroSteps.AppendLine("PC <- " + PC.ToString("X6") + " + 3"); + PC += 3; + break; + + case OPCode.DIV: // DIV + MicroSteps.AppendLine("-----DIV------"); + // We don't want to crash the VM. + // IF we divide by zero, we should do something in the VM. + + if (FetchWord(targetAddress) == 0) + { + // NO exception. We should set status WORD and NOT DO THE DIV + } + else + { + MicroSteps.AppendLine("A <- " + A.ToString("X6") + " / " + FetchWord(targetAddress).ToString("X6")); + A /= FetchWord(targetAddress); + } + + MicroSteps.AppendLine("PC <- " + PC.ToString("X6") + " + 3"); + PC += 3; + break; + + case OPCode.J: // J + MicroSteps.AppendLine("-----J------"); + MicroSteps.AppendLine("PC <- " + targetAddress.ToString("X6")); + PC = targetAddress; + break; + + case OPCode.JEQ: // JEQ + if ((SW & 0xC0) == 0) + { + MicroSteps.AppendLine("PC <- " + targetAddress.ToString("X6")); + PC = targetAddress; + } + else + { + MicroSteps.AppendLine("PC <- " + PC.ToString("X6") + " + 3"); + PC += 3; + } + break; + + case OPCode.JGT: // JGT + MicroSteps.AppendLine("-----JGT------"); + int TempJGT; + TempJGT = (SW & 0xC0) >> 6; + if (TempJGT == 2) + { + MicroSteps.AppendLine("PC <- " + targetAddress.ToString("X6")); + PC = targetAddress; + } + else + { + MicroSteps.AppendLine("PC <- " + PC.ToString("X6") + " + 3"); + PC += 3; + } + break; + + case OPCode.JLT: // JLT + MicroSteps.AppendLine("-----JLT------"); + int TempJLT; + TempJLT = (SW & 0xC0) >> 6; + if (TempJLT == 1) + { + MicroSteps.AppendLine("PC <- " + targetAddress.ToString("X6")); + PC = targetAddress; + } + else + { + MicroSteps.AppendLine("PC <- " + PC.ToString("X6") + " + 3"); + PC += 3; + } + break; + + case OPCode.JSUB: // JSUB (Jump to subroutine starting at TA. Preserve PC by storing in L) + MicroSteps.AppendLine("-----JSUB------"); + MicroSteps.AppendLine("L <- " + PC.ToString("X6") + " + 3"); + L = (PC + 3); + MicroSteps.AppendLine("PC <- " + targetAddress.ToString("X6")); + PC = targetAddress; + break; + + case OPCode.LDA: // LDA + MicroSteps.AppendLine("-----LDA------"); + MicroSteps.AppendLine("A <- " + FetchWord(targetAddress).ToString("X6")); + A = FetchWord(targetAddress); + MicroSteps.AppendLine("PC <- " + PC.ToString("X6") + " + 3"); + PC += 3; + break; + + case OPCode.LDCH: // LDCH + MicroSteps.AppendLine("-----LDCH------"); + byte ByteLoad; + ByteLoad = (byte)FetchByte(targetAddress); + + //TODO -> Wire in character reads from device objects + A = ByteLoad; + MicroSteps.AppendLine("PC <- " + PC.ToString("X6") + " + 3"); + PC += 3; + break; + + case OPCode.LDL: // LDL + MicroSteps.AppendLine("-----LDL------"); + MicroSteps.AppendLine("L <- " + FetchWord(targetAddress).ToString("X6")); + L = FetchWord(targetAddress); + MicroSteps.AppendLine("PC <- " + PC.ToString("X6") + " + 3"); + PC += 3; + break; + + case OPCode.LDX: // LDX + MicroSteps.AppendLine("-----LDX------"); + MicroSteps.AppendLine("X <- " + FetchWord(targetAddress).ToString("X6")); + X = FetchWord(targetAddress); + MicroSteps.AppendLine("PC <- " + PC.ToString("X6") + " + 3"); + PC += 3; + break; + + case OPCode.MUL: // MUL + MicroSteps.AppendLine("-----MUL------"); + MicroSteps.AppendLine("A <- " + A.ToString("X6") + " * " + FetchWord(targetAddress).ToString("X6")); + A *= FetchWord(targetAddress); + MicroSteps.AppendLine("PC <- " + PC.ToString("X6") + " + 3"); + PC += 3; + break; + + case OPCode.OR: // OR + MicroSteps.AppendLine("-----OR------"); + MicroSteps.AppendLine("A <- " + A.ToString("X6") + " OR " + FetchWord(targetAddress).ToString("X6")); + A |= FetchWord(targetAddress); + MicroSteps.AppendLine("PC <- " + PC.ToString("X6") + " + 3"); + PC += 3; + break; + + case OPCode.RD: // RD + MicroSteps.AppendLine("-----RD------"); + byte dataByte; + int DeviceNumberToRead; + DeviceNumberToRead = FetchWord(targetAddress); + + // Set Device's Status Word to BUSY + Devices[DeviceNumberToRead].DeviceSW &= 0xFFFF3F; + + // Write the byte to the device + dataByte = Devices[DeviceNumberToRead].ReadByte(); + + // Set Device's Status Word to AVAILABLE + Devices[DeviceNumberToRead].DeviceSW |= 0x40; + Devices[DeviceNumberToRead].DeviceSW &= 0xFFFF7F; + int tmp; + tmp = dataByte; + tmp &= 0xFF; + A &= 0xFFFF00; + + A |= tmp; + MicroSteps.AppendLine("PC <- " + PC.ToString("X6") + " + 3"); + PC += 3; + break; + + case OPCode.RSUB: // RSUB + MicroSteps.AppendLine("-----RSUB------"); + if (L == 0) + { + MicroSteps.AppendLine("PC <- (-1) PROGRAM HALTED"); + PC = -1; // Program Halted. + } + else + { + MicroSteps.AppendLine("PC <- " + L.ToString("X6")); + PC = L; + } + break; + + case OPCode.STA: // STA (Stores contents of A in Target Address) + MicroSteps.AppendLine("-----STA------"); + MicroSteps.AppendLine("TA <- " + A.ToString("X6") + " : TA = " + targetAddress.ToString("X6")); + StoreWord(targetAddress, A); + MicroSteps.AppendLine("PC <- " + PC.ToString("X6") + " + 3"); + PC += 3; + break; + + case OPCode.STCH: // STCH + MicroSteps.AppendLine("-----STCH------"); + int tempChar; + char dataSTCHByte; + tempChar = A & 0xFF; + dataSTCHByte = (char)tempChar; + StoreByte(targetAddress, (byte)dataSTCHByte); + MicroSteps.AppendLine("TA <- " + tempChar.ToString("X6") + " : TA = " + targetAddress.ToString("X6")); + + MicroSteps.AppendLine("PC <- " + PC.ToString("X6") + " + 3"); + PC += 3; + break; + + case OPCode.STL: // STL + MicroSteps.AppendLine("-----STL------"); + MicroSteps.AppendLine("TA <- " + L.ToString("X6") + " : TA = " + targetAddress.ToString("X6")); + StoreWord(targetAddress, L); + MicroSteps.AppendLine("PC <- " + PC.ToString("X6") + " + 3"); + PC += 3; + break; + + case OPCode.STX: // STX (Stores contents of X in Target Address) + MicroSteps.AppendLine("-----STX------"); + MicroSteps.AppendLine("TA <- " + X.ToString("X6") + " : TA = " + targetAddress.ToString("X6")); + StoreWord(targetAddress, X); + MicroSteps.AppendLine("PC <- " + PC.ToString("X6") + " + 3"); + PC += 3; + break; + + case OPCode.SUB: // SUB (Subtract Value in TA from A ) + MicroSteps.AppendLine("-----SUB------"); + MicroSteps.AppendLine("A <- " + A.ToString("X6") + " - " + FetchWord(targetAddress).ToString("X6")); + A -= FetchWord(targetAddress); + MicroSteps.AppendLine("PC <- " + PC.ToString("X6") + " + 3"); + PC += 3; + break; + + case OPCode.TD: // TD (Tests to see if a device is busy). + MicroSteps.AppendLine("-----TD------"); + SW |= 0x40; + SW &= 0xFFFF7F; //CC is < + MicroSteps.AppendLine("PC <- " + PC.ToString("X6") + " + 3"); + PC += 3; + break; + + case OPCode.TIX: // TIX + MicroSteps.AppendLine("-----TIX------"); + int DataW; + int tempTIX; + DataW = FetchWord(targetAddress); + MicroSteps.AppendLine("X <- " + X.ToString("X6") + " + 1"); + + tempTIX = ++X - DataW; + if (tempTIX < 0) + { + SW |= 0x40; + SW &= 0xFFFF7F; + } + else if (tempTIX == 0) + { + SW &= 0xFFFF3F; + } + else + { + SW |= 0x80; + SW &= 0xFFFFBF; + } + MicroSteps.AppendLine("PC <- " + PC.ToString("X6") + " + 3"); + PC += 3; + break; + + case OPCode.WD: // WD (Write to Device) + MicroSteps.AppendLine("-----WD------"); + /*** WD ***/ + + byte dataByteW; + dataByteW = (byte)A; + int DeviceNumberToWriteTo; + DeviceNumberToWriteTo = FetchWord(targetAddress); + + // Set Device's Status Word to BUSY + Devices[DeviceNumberToWriteTo].DeviceSW &= 0xFFFF3F; + + // Write the byte to the device + Devices[DeviceNumberToWriteTo].WriteByte(dataByteW); + + // Set Device's Status Word to AVAILABLE + Devices[DeviceNumberToWriteTo].DeviceSW |= 0x40; + Devices[DeviceNumberToWriteTo].DeviceSW &= 0xFFFF7F; + MicroSteps.AppendLine("Device" + DeviceNumberToWriteTo.ToString() + " <- " + dataByteW.ToString("X6")); + MicroSteps.AppendLine("PC <- " + PC.ToString("X6") + " + 3"); + PC += 3; + break; + } + } + + public void LoadToMemory(string line, int startAddress, int length) + { + int bytesRead = 0; + for (int i = 9; bytesRead < length; bytesRead++) + { + int ch = int.Parse($"{line[i++]}", NumberStyles.HexNumber); + int num = ch << 4; + + ch = int.Parse($"{line[i++]}", NumberStyles.HexNumber); + num += ch; + + StoreByte(startAddress++, (byte)num); + } + } + + public void DecodeInstruction(int fullInstruction, ref int opCode, ref int targetAddress) + { + int XBit = (fullInstruction & 0x8000); + bool INDEXED = (XBit > 0); + + targetAddress = fullInstruction & 0x7FFF; + opCode = fullInstruction & 0xFF0000; + opCode >>= 16; + + if (INDEXED == true) + { + targetAddress += X; // Add contents of X register to address for indexed Mode + } + } + } +} diff --git a/SICVirtualMachine/SIC/Device.cs b/SICVirtualMachine/SIC/Device.cs new file mode 100644 index 0000000..09bf945 --- /dev/null +++ b/SICVirtualMachine/SIC/Device.cs @@ -0,0 +1,80 @@ +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace SICVirtualMachine.SIC +{ + internal class Device + { + public int DeviceID { get; } + + /// + /// Device Status Word + /// + public int DeviceSW { get; set; } + + private readonly List WriteBuffer; + private readonly StringBuilder WriteBufferASCII; + + public string GetWriteBufferASCIIByteString => WriteBufferASCII.ToString(); + + public Device(int deviceNumber) + { + DeviceID = deviceNumber; + WriteBuffer = new List(); + DeviceSW = 0; + WriteBufferASCII = new StringBuilder(); + } + + public void WriteByte(byte value) + { + WriteBuffer.Add(value); + + char ch = (char)value; + if (!char.IsControl(ch)) + { + WriteBufferASCII.Append(ch); + } + else + { + WriteBufferASCII.Append($"<{value:X2}>"); + } + } + + public byte ReadByte() + { + return WriteBuffer.Last(); + } + + /// + /// Returns a UTF-8 String of the ASCII Bytes written to this device + /// + /// + public string GetASCIIStringWrites() + { + string Result = string.Empty; + + foreach (byte b in WriteBuffer) + { + char ch = (char)b; + if (!char.IsControl(ch)) + { + Result += ch; + + } + else + { + Result += "<" + b.ToString("X2") + ">"; + } + } + + return Result; + } + + public void Clear() + { + WriteBuffer.Clear(); + WriteBufferASCII.Clear(); + } + } +} diff --git a/SICVirtualMachine/SIC/Linker.cs b/SICVirtualMachine/SIC/Linker.cs new file mode 100644 index 0000000..da2eb4f --- /dev/null +++ b/SICVirtualMachine/SIC/Linker.cs @@ -0,0 +1,6 @@ +namespace SICVirtualMachine.SIC +{ + internal class Linker + { + } +} diff --git a/SICVirtualMachine/SIC/Loader.cs b/SICVirtualMachine/SIC/Loader.cs new file mode 100644 index 0000000..0ac0c24 --- /dev/null +++ b/SICVirtualMachine/SIC/Loader.cs @@ -0,0 +1,87 @@ +using System; +using System.Globalization; + +namespace SICVirtualMachine.SIC +{ + // Assigned to Brandon Woodrum + + // This class should have two constructors + // Zero Parameter (Absolute) + // Single Parameter (StartAddress) - > Relocate program to StartAddress + + internal static class Loader + { + public static (int start, int length) LoadObjectFileIntoCPU(string[] lines, CPU cpu) + { + (int start, int length) last = default; + + foreach (string line in lines) + { + if (string.IsNullOrWhiteSpace(line)) + { + continue; + } + + switch (line[0]) + { + case 'H': + last = LoadHeadRecord(line, cpu); + break; + + case 'T': + LoadTextRecord(line, cpu); + break; + + case 'E': + LoadEndRecord(line, cpu); + break; + + default: + throw new Exception("Unknown record type."); + } + } + + return last; + } + + private static (int start, int length) LoadHeadRecord(string line, CPU cpu) + { + int start = ParseHexValue(line, 7, 6); + int length = ParseHexValue(line, 13, 6); + + cpu.CurrentProgramEndAddress = start + length; + return (start, length); + } + + private static void LoadTextRecord(string line, CPU cpu) + { + ReadTextRecord(line, out int recordStartAddress, out int recordLength); + + cpu.LoadToMemory(line, recordStartAddress, recordLength); + } + + private static void LoadEndRecord(string line, CPU cpu) + { + ReadEndRecord(line, out int addressOfFirstInstruction); + + cpu.PC = addressOfFirstInstruction; + cpu.CurrentProgramStartAddress = addressOfFirstInstruction; + } + + private static void ReadEndRecord(string line, out int firstExecIns) + { + firstExecIns = ParseHexValue(line, 1, 6); + } + + private static void ReadTextRecord(string line, out int recordStartAdd, out int recordLength) + { + recordStartAdd = ParseHexValue(line, 1, 6); + recordLength = ParseHexValue(line, 7, 2); + } + + private static int ParseHexValue(string s, int start, int length) + { + return int.Parse(s.Substring(start, length), NumberStyles.HexNumber); + } + } +} diff --git a/SIC Simulator/SIC Simulator.csproj b/SICVirtualMachine/SICVirtualMachine.csproj similarity index 52% rename from SIC Simulator/SIC Simulator.csproj rename to SICVirtualMachine/SICVirtualMachine.csproj index a34c382..e48c768 100644 --- a/SIC Simulator/SIC Simulator.csproj +++ b/SICVirtualMachine/SICVirtualMachine.csproj @@ -4,11 +4,11 @@ Debug AnyCPU - {1BE03959-6239-42B3-A318-02B849FE4EBC} + {968F6A01-E997-46F5-A979-9F1FBF1E6D84} WinExe - SIC_Simulator - SIC Simulator - v4.7.2 + SICVirtualMachine + SICVirtualMachine + v4.6.1 512 true true @@ -33,120 +33,104 @@ 4 - SIC_CPU.ico + - - - - - - - - - - - - + + - - + + + + + + + + + + + + + + Form - + dlgRelocateObjectFile.cs - + Form - + dlgSetMemoryByte.cs - + Form - + dlgSetMemoryWord.cs - - + Form - + dlgSetRegisterWord.cs - + Form - + dlgStopAtMemoryAddress.cs - - + Form - - Form1.cs + + frmAbout.cs - + Form - - frmAbout.cs + + MainWindow.cs - - - - - - - - + + + dlgRelocateObjectFile.cs - + dlgSetMemoryByte.cs - + dlgSetMemoryWord.cs - + dlgSetRegisterWord.cs - + dlgStopAtMemoryAddress.cs - - Form1.cs - - + frmAbout.cs - - ResXFileCodeGenerator - Resources.Designer.cs - Designer + + MainWindow.cs - - True - Resources.resx - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - Settings.settings - True - - + - + + + + + + ..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll + + \ No newline at end of file diff --git a/SIC Simulator/Form1.Designer.cs b/SICVirtualMachine/View/MainWindow.Designer.cs similarity index 62% rename from SIC Simulator/Form1.Designer.cs rename to SICVirtualMachine/View/MainWindow.Designer.cs index 7f48e25..ef32d44 100644 --- a/SIC Simulator/Form1.Designer.cs +++ b/SICVirtualMachine/View/MainWindow.Designer.cs @@ -1,6 +1,6 @@ -namespace SIC_Simulator +namespace SICVirtualMachine.View { - partial class Form1 + partial class MainWindow { /// /// Required designer variable. @@ -28,50 +28,51 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainWindow)); this.gbCPU = new System.Windows.Forms.GroupBox(); - this.lblComp_Result = new System.Windows.Forms.Label(); + this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); this.label6 = new System.Windows.Forms.Label(); + this.lblComp_Result = new System.Windows.Forms.Label(); this.txtSW_CC = new System.Windows.Forms.TextBox(); - this.txtSW_BIN_LSB = new System.Windows.Forms.TextBox(); - this.txtSW_BIN_MIB = new System.Windows.Forms.TextBox(); - this.txtSW_BIN_MSB = new System.Windows.Forms.TextBox(); - this.txtPC_BIN_LSB = new System.Windows.Forms.TextBox(); - this.txtPC_BIN_MIB = new System.Windows.Forms.TextBox(); - this.txtPC_BIN_MSB = new System.Windows.Forms.TextBox(); - this.txtX_BIN_LSB = new System.Windows.Forms.TextBox(); - this.txtX_BIN_MIB = new System.Windows.Forms.TextBox(); - this.txtX_BIN_MSB = new System.Windows.Forms.TextBox(); - this.txtL_BIN_LSB = new System.Windows.Forms.TextBox(); - this.txtL_BIN_MIB = new System.Windows.Forms.TextBox(); - this.txtL_BIN_MSB = new System.Windows.Forms.TextBox(); this.label11 = new System.Windows.Forms.Label(); - this.txtSW_Dec = new System.Windows.Forms.TextBox(); - this.txtPC_Dec = new System.Windows.Forms.TextBox(); - this.txtX_Dec = new System.Windows.Forms.TextBox(); - this.txtL_Dec = new System.Windows.Forms.TextBox(); this.txtA_Dec = new System.Windows.Forms.TextBox(); - this.label10 = new System.Windows.Forms.Label(); - this.label9 = new System.Windows.Forms.Label(); - this.txtA_BIN_LSB = new System.Windows.Forms.TextBox(); - this.txtA_BIN_MIB = new System.Windows.Forms.TextBox(); - this.txtA_BIN_MSB = new System.Windows.Forms.TextBox(); - this.txtSW_Hex = new System.Windows.Forms.TextBox(); - this.txtPC_Hex = new System.Windows.Forms.TextBox(); + this.txtL_Dec = new System.Windows.Forms.TextBox(); this.label5 = new System.Windows.Forms.Label(); + this.txtSW_Hex = new System.Windows.Forms.TextBox(); this.label4 = new System.Windows.Forms.Label(); + this.label9 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); + this.txtPC_Hex = new System.Windows.Forms.TextBox(); this.label2 = new System.Windows.Forms.Label(); + this.txtL_BIN_MSB = new System.Windows.Forms.TextBox(); this.label1 = new System.Windows.Forms.Label(); + this.txtA_BIN_MSB = new System.Windows.Forms.TextBox(); + this.txtX_BIN_MSB = new System.Windows.Forms.TextBox(); + this.txtPC_BIN_MSB = new System.Windows.Forms.TextBox(); + this.txtSW_BIN_MSB = new System.Windows.Forms.TextBox(); + this.txtSW_BIN_MIB = new System.Windows.Forms.TextBox(); this.txtX_Hex = new System.Windows.Forms.TextBox(); + this.txtSW_BIN_LSB = new System.Windows.Forms.TextBox(); this.txtL_Hex = new System.Windows.Forms.TextBox(); + this.txtX_Dec = new System.Windows.Forms.TextBox(); + this.txtPC_BIN_MIB = new System.Windows.Forms.TextBox(); + this.txtPC_Dec = new System.Windows.Forms.TextBox(); this.txtA_Hex = new System.Windows.Forms.TextBox(); + this.txtSW_Dec = new System.Windows.Forms.TextBox(); + this.txtX_BIN_MIB = new System.Windows.Forms.TextBox(); + this.txtPC_BIN_LSB = new System.Windows.Forms.TextBox(); + this.txtL_BIN_MIB = new System.Windows.Forms.TextBox(); + this.txtA_BIN_LSB = new System.Windows.Forms.TextBox(); + this.txtL_BIN_LSB = new System.Windows.Forms.TextBox(); + this.txtX_BIN_LSB = new System.Windows.Forms.TextBox(); + this.txtA_BIN_MIB = new System.Windows.Forms.TextBox(); + this.label10 = new System.Windows.Forms.Label(); this.menuStrip1 = new System.Windows.Forms.MenuStrip(); this.tsmFile = new System.Windows.Forms.ToolStripMenuItem(); this.tsmOpen_SIC_Object_File = new System.Windows.Forms.ToolStripMenuItem(); this.tsmloadAndAssembleSICSourceFIle = new System.Windows.Forms.ToolStripMenuItem(); this.loadSavedSICMachineStateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.loadObjectFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.tsmSaveMachineState = new System.Windows.Forms.ToolStripMenuItem(); this.tsmFile_Ext = new System.Windows.Forms.ToolStripMenuItem(); this.tsmAbout = new System.Windows.Forms.ToolStripMenuItem(); @@ -79,6 +80,7 @@ private void InitializeComponent() this.tsmAbout_About = new System.Windows.Forms.ToolStripMenuItem(); this.machineToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.tsmzeroAllMemory = new System.Windows.Forms.ToolStripMenuItem(); + this.clearDevicesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.randomizeAllMemory = new System.Windows.Forms.ToolStripMenuItem(); this.setProgramCounterToToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.stepSingleInstructionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -88,8 +90,11 @@ private void InitializeComponent() this.tcMachine = new System.Windows.Forms.TabControl(); this.tpMemory = new System.Windows.Forms.TabPage(); this.rtfMemory = new System.Windows.Forms.RichTextBox(); - this.rbMemHex = new System.Windows.Forms.RadioButton(); + this.flowLayoutPanel3 = new System.Windows.Forms.FlowLayoutPanel(); this.rbMemBinary = new System.Windows.Forms.RadioButton(); + this.rbMemHex = new System.Windows.Forms.RadioButton(); + this.rbMemDecimal = new System.Windows.Forms.RadioButton(); + this.rbMemAscii = new System.Windows.Forms.RadioButton(); this.tpDevices = new System.Windows.Forms.TabPage(); this.lvDevices = new System.Windows.Forms.ListView(); this.colDeviceID = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); @@ -109,424 +114,506 @@ private void InitializeComponent() this.tbObjectCode = new System.Windows.Forms.TabControl(); this.tbSICSymbol = new System.Windows.Forms.TabPage(); this.tbObjCode = new System.Windows.Forms.TabPage(); - this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); this.btnThreeStep = new System.Windows.Forms.Button(); - this.loadObjectFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); + this.flowLayoutPanel2 = new System.Windows.Forms.FlowLayoutPanel(); + this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); this.gbCPU.SuspendLayout(); + this.tableLayoutPanel3.SuspendLayout(); this.menuStrip1.SuspendLayout(); this.tcMachine.SuspendLayout(); this.tpMemory.SuspendLayout(); + this.flowLayoutPanel3.SuspendLayout(); this.tpDevices.SuspendLayout(); this.tpMicroSteps.SuspendLayout(); this.tbObjectCode.SuspendLayout(); this.tbSICSymbol.SuspendLayout(); this.tbObjCode.SuspendLayout(); + this.tableLayoutPanel1.SuspendLayout(); + this.tableLayoutPanel2.SuspendLayout(); + this.flowLayoutPanel2.SuspendLayout(); + this.flowLayoutPanel1.SuspendLayout(); this.SuspendLayout(); // // gbCPU // - this.gbCPU.Controls.Add(this.lblComp_Result); - this.gbCPU.Controls.Add(this.label6); - this.gbCPU.Controls.Add(this.txtSW_CC); - this.gbCPU.Controls.Add(this.txtSW_BIN_LSB); - this.gbCPU.Controls.Add(this.txtSW_BIN_MIB); - this.gbCPU.Controls.Add(this.txtSW_BIN_MSB); - this.gbCPU.Controls.Add(this.txtPC_BIN_LSB); - this.gbCPU.Controls.Add(this.txtPC_BIN_MIB); - this.gbCPU.Controls.Add(this.txtPC_BIN_MSB); - this.gbCPU.Controls.Add(this.txtX_BIN_LSB); - this.gbCPU.Controls.Add(this.txtX_BIN_MIB); - this.gbCPU.Controls.Add(this.txtX_BIN_MSB); - this.gbCPU.Controls.Add(this.txtL_BIN_LSB); - this.gbCPU.Controls.Add(this.txtL_BIN_MIB); - this.gbCPU.Controls.Add(this.txtL_BIN_MSB); - this.gbCPU.Controls.Add(this.label11); - this.gbCPU.Controls.Add(this.txtSW_Dec); - this.gbCPU.Controls.Add(this.txtPC_Dec); - this.gbCPU.Controls.Add(this.txtX_Dec); - this.gbCPU.Controls.Add(this.txtL_Dec); - this.gbCPU.Controls.Add(this.txtA_Dec); - this.gbCPU.Controls.Add(this.label10); - this.gbCPU.Controls.Add(this.label9); - this.gbCPU.Controls.Add(this.txtA_BIN_LSB); - this.gbCPU.Controls.Add(this.txtA_BIN_MIB); - this.gbCPU.Controls.Add(this.txtA_BIN_MSB); - this.gbCPU.Controls.Add(this.txtSW_Hex); - this.gbCPU.Controls.Add(this.txtPC_Hex); - this.gbCPU.Controls.Add(this.label5); - this.gbCPU.Controls.Add(this.label4); - this.gbCPU.Controls.Add(this.label3); - this.gbCPU.Controls.Add(this.label2); - this.gbCPU.Controls.Add(this.label1); - this.gbCPU.Controls.Add(this.txtX_Hex); - this.gbCPU.Controls.Add(this.txtL_Hex); - this.gbCPU.Controls.Add(this.txtA_Hex); - this.gbCPU.Location = new System.Drawing.Point(12, 32); + this.gbCPU.Controls.Add(this.tableLayoutPanel3); + this.gbCPU.Dock = System.Windows.Forms.DockStyle.Fill; + this.gbCPU.Location = new System.Drawing.Point(3, 3); this.gbCPU.Name = "gbCPU"; - this.gbCPU.Size = new System.Drawing.Size(344, 188); + this.gbCPU.Size = new System.Drawing.Size(669, 194); this.gbCPU.TabIndex = 0; this.gbCPU.TabStop = false; this.gbCPU.Text = "SIC CPU"; // - // lblComp_Result - // - this.lblComp_Result.AutoSize = true; - this.lblComp_Result.Location = new System.Drawing.Point(59, 166); - this.lblComp_Result.Name = "lblComp_Result"; - this.lblComp_Result.Size = new System.Drawing.Size(17, 13); - this.lblComp_Result.TabIndex = 35; - this.lblComp_Result.Text = "xx"; + // tableLayoutPanel3 + // + this.tableLayoutPanel3.ColumnCount = 7; + this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 50F)); + this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 70F)); + this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 70F)); + this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 70F)); + this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 70F)); + this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 70F)); + this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel3.Controls.Add(this.label6, 0, 6); + this.tableLayoutPanel3.Controls.Add(this.lblComp_Result, 2, 6); + this.tableLayoutPanel3.Controls.Add(this.txtSW_CC, 1, 6); + this.tableLayoutPanel3.Controls.Add(this.label11, 5, 0); + this.tableLayoutPanel3.Controls.Add(this.txtA_Dec, 5, 1); + this.tableLayoutPanel3.Controls.Add(this.txtL_Dec, 5, 2); + this.tableLayoutPanel3.Controls.Add(this.label5, 0, 5); + this.tableLayoutPanel3.Controls.Add(this.txtSW_Hex, 1, 5); + this.tableLayoutPanel3.Controls.Add(this.label4, 0, 4); + this.tableLayoutPanel3.Controls.Add(this.label9, 1, 0); + this.tableLayoutPanel3.Controls.Add(this.label3, 0, 3); + this.tableLayoutPanel3.Controls.Add(this.txtPC_Hex, 1, 4); + this.tableLayoutPanel3.Controls.Add(this.label2, 0, 2); + this.tableLayoutPanel3.Controls.Add(this.txtL_BIN_MSB, 2, 2); + this.tableLayoutPanel3.Controls.Add(this.label1, 0, 1); + this.tableLayoutPanel3.Controls.Add(this.txtA_BIN_MSB, 2, 1); + this.tableLayoutPanel3.Controls.Add(this.txtX_BIN_MSB, 2, 3); + this.tableLayoutPanel3.Controls.Add(this.txtPC_BIN_MSB, 2, 4); + this.tableLayoutPanel3.Controls.Add(this.txtSW_BIN_MSB, 2, 5); + this.tableLayoutPanel3.Controls.Add(this.txtSW_BIN_MIB, 3, 5); + this.tableLayoutPanel3.Controls.Add(this.txtX_Hex, 1, 3); + this.tableLayoutPanel3.Controls.Add(this.txtSW_BIN_LSB, 4, 5); + this.tableLayoutPanel3.Controls.Add(this.txtL_Hex, 1, 2); + this.tableLayoutPanel3.Controls.Add(this.txtX_Dec, 5, 3); + this.tableLayoutPanel3.Controls.Add(this.txtPC_BIN_MIB, 3, 4); + this.tableLayoutPanel3.Controls.Add(this.txtPC_Dec, 5, 4); + this.tableLayoutPanel3.Controls.Add(this.txtA_Hex, 1, 1); + this.tableLayoutPanel3.Controls.Add(this.txtSW_Dec, 5, 5); + this.tableLayoutPanel3.Controls.Add(this.txtX_BIN_MIB, 3, 3); + this.tableLayoutPanel3.Controls.Add(this.txtPC_BIN_LSB, 4, 4); + this.tableLayoutPanel3.Controls.Add(this.txtL_BIN_MIB, 3, 2); + this.tableLayoutPanel3.Controls.Add(this.txtA_BIN_LSB, 4, 1); + this.tableLayoutPanel3.Controls.Add(this.txtL_BIN_LSB, 4, 2); + this.tableLayoutPanel3.Controls.Add(this.txtX_BIN_LSB, 4, 3); + this.tableLayoutPanel3.Controls.Add(this.txtA_BIN_MIB, 3, 1); + this.tableLayoutPanel3.Controls.Add(this.label10, 2, 0); + this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel3.GrowStyle = System.Windows.Forms.TableLayoutPanelGrowStyle.FixedSize; + this.tableLayoutPanel3.Location = new System.Drawing.Point(3, 16); + this.tableLayoutPanel3.Name = "tableLayoutPanel3"; + this.tableLayoutPanel3.RowCount = 7; + this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); + this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); + this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); + this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); + this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); + this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); + this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); + this.tableLayoutPanel3.Size = new System.Drawing.Size(663, 175); + this.tableLayoutPanel3.TabIndex = 36; // // label6 // this.label6.AutoSize = true; - this.label6.Location = new System.Drawing.Point(8, 166); + this.label6.Dock = System.Windows.Forms.DockStyle.Fill; + this.label6.Location = new System.Drawing.Point(3, 150); this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(21, 13); + this.label6.Size = new System.Drawing.Size(44, 25); this.label6.TabIndex = 34; this.label6.Text = "CC"; + this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // lblComp_Result + // + this.lblComp_Result.AutoSize = true; + this.lblComp_Result.Dock = System.Windows.Forms.DockStyle.Fill; + this.lblComp_Result.Location = new System.Drawing.Point(123, 150); + this.lblComp_Result.Name = "lblComp_Result"; + this.lblComp_Result.Size = new System.Drawing.Size(64, 25); + this.lblComp_Result.TabIndex = 35; + this.lblComp_Result.Text = "xx"; + this.lblComp_Result.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // txtSW_CC // - this.txtSW_CC.Location = new System.Drawing.Point(33, 163); + this.txtSW_CC.Location = new System.Drawing.Point(53, 153); this.txtSW_CC.Name = "txtSW_CC"; this.txtSW_CC.ReadOnly = true; - this.txtSW_CC.Size = new System.Drawing.Size(20, 20); + this.txtSW_CC.Size = new System.Drawing.Size(49, 20); this.txtSW_CC.TabIndex = 33; this.txtSW_CC.Text = "00"; this.txtSW_CC.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; // - // txtSW_BIN_LSB - // - this.txtSW_BIN_LSB.Location = new System.Drawing.Point(204, 137); - this.txtSW_BIN_LSB.Name = "txtSW_BIN_LSB"; - this.txtSW_BIN_LSB.ReadOnly = true; - this.txtSW_BIN_LSB.Size = new System.Drawing.Size(57, 20); - this.txtSW_BIN_LSB.TabIndex = 32; - this.txtSW_BIN_LSB.Text = "00000000"; - this.txtSW_BIN_LSB.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; - // - // txtSW_BIN_MIB - // - this.txtSW_BIN_MIB.Location = new System.Drawing.Point(145, 137); - this.txtSW_BIN_MIB.Name = "txtSW_BIN_MIB"; - this.txtSW_BIN_MIB.ReadOnly = true; - this.txtSW_BIN_MIB.Size = new System.Drawing.Size(57, 20); - this.txtSW_BIN_MIB.TabIndex = 31; - this.txtSW_BIN_MIB.Text = "00000000"; - this.txtSW_BIN_MIB.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; - // - // txtSW_BIN_MSB - // - this.txtSW_BIN_MSB.Location = new System.Drawing.Point(86, 137); - this.txtSW_BIN_MSB.Name = "txtSW_BIN_MSB"; - this.txtSW_BIN_MSB.ReadOnly = true; - this.txtSW_BIN_MSB.Size = new System.Drawing.Size(57, 20); - this.txtSW_BIN_MSB.TabIndex = 30; - this.txtSW_BIN_MSB.Text = "00000000"; - this.txtSW_BIN_MSB.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; - // - // txtPC_BIN_LSB - // - this.txtPC_BIN_LSB.Location = new System.Drawing.Point(204, 109); - this.txtPC_BIN_LSB.Name = "txtPC_BIN_LSB"; - this.txtPC_BIN_LSB.ReadOnly = true; - this.txtPC_BIN_LSB.Size = new System.Drawing.Size(57, 20); - this.txtPC_BIN_LSB.TabIndex = 29; - this.txtPC_BIN_LSB.Text = "00000000"; - this.txtPC_BIN_LSB.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; - // - // txtPC_BIN_MIB - // - this.txtPC_BIN_MIB.Location = new System.Drawing.Point(145, 109); - this.txtPC_BIN_MIB.Name = "txtPC_BIN_MIB"; - this.txtPC_BIN_MIB.ReadOnly = true; - this.txtPC_BIN_MIB.Size = new System.Drawing.Size(57, 20); - this.txtPC_BIN_MIB.TabIndex = 28; - this.txtPC_BIN_MIB.Text = "00000000"; - this.txtPC_BIN_MIB.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; - // - // txtPC_BIN_MSB - // - this.txtPC_BIN_MSB.Location = new System.Drawing.Point(86, 109); - this.txtPC_BIN_MSB.Name = "txtPC_BIN_MSB"; - this.txtPC_BIN_MSB.ReadOnly = true; - this.txtPC_BIN_MSB.Size = new System.Drawing.Size(57, 20); - this.txtPC_BIN_MSB.TabIndex = 27; - this.txtPC_BIN_MSB.Text = "00000000"; - this.txtPC_BIN_MSB.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; - // - // txtX_BIN_LSB - // - this.txtX_BIN_LSB.Location = new System.Drawing.Point(204, 82); - this.txtX_BIN_LSB.Name = "txtX_BIN_LSB"; - this.txtX_BIN_LSB.ReadOnly = true; - this.txtX_BIN_LSB.Size = new System.Drawing.Size(57, 20); - this.txtX_BIN_LSB.TabIndex = 26; - this.txtX_BIN_LSB.Text = "00000000"; - this.txtX_BIN_LSB.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; - // - // txtX_BIN_MIB - // - this.txtX_BIN_MIB.Location = new System.Drawing.Point(145, 82); - this.txtX_BIN_MIB.Name = "txtX_BIN_MIB"; - this.txtX_BIN_MIB.ReadOnly = true; - this.txtX_BIN_MIB.Size = new System.Drawing.Size(57, 20); - this.txtX_BIN_MIB.TabIndex = 25; - this.txtX_BIN_MIB.Text = "00000000"; - this.txtX_BIN_MIB.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; - // - // txtX_BIN_MSB - // - this.txtX_BIN_MSB.Location = new System.Drawing.Point(86, 82); - this.txtX_BIN_MSB.Name = "txtX_BIN_MSB"; - this.txtX_BIN_MSB.ReadOnly = true; - this.txtX_BIN_MSB.Size = new System.Drawing.Size(57, 20); - this.txtX_BIN_MSB.TabIndex = 24; - this.txtX_BIN_MSB.Text = "00000000"; - this.txtX_BIN_MSB.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; - // - // txtL_BIN_LSB - // - this.txtL_BIN_LSB.Location = new System.Drawing.Point(204, 56); - this.txtL_BIN_LSB.Name = "txtL_BIN_LSB"; - this.txtL_BIN_LSB.ReadOnly = true; - this.txtL_BIN_LSB.Size = new System.Drawing.Size(57, 20); - this.txtL_BIN_LSB.TabIndex = 23; - this.txtL_BIN_LSB.Text = "00000000"; - this.txtL_BIN_LSB.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; - // - // txtL_BIN_MIB - // - this.txtL_BIN_MIB.Location = new System.Drawing.Point(145, 56); - this.txtL_BIN_MIB.Name = "txtL_BIN_MIB"; - this.txtL_BIN_MIB.ReadOnly = true; - this.txtL_BIN_MIB.Size = new System.Drawing.Size(57, 20); - this.txtL_BIN_MIB.TabIndex = 22; - this.txtL_BIN_MIB.Text = "00000000"; - this.txtL_BIN_MIB.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; - // - // txtL_BIN_MSB - // - this.txtL_BIN_MSB.Location = new System.Drawing.Point(86, 56); - this.txtL_BIN_MSB.Name = "txtL_BIN_MSB"; - this.txtL_BIN_MSB.ReadOnly = true; - this.txtL_BIN_MSB.Size = new System.Drawing.Size(57, 20); - this.txtL_BIN_MSB.TabIndex = 21; - this.txtL_BIN_MSB.Text = "00000000"; - this.txtL_BIN_MSB.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; - // // label11 // this.label11.AutoSize = true; - this.label11.Location = new System.Drawing.Point(284, 14); + this.label11.Dock = System.Windows.Forms.DockStyle.Fill; + this.label11.Location = new System.Drawing.Point(333, 0); this.label11.Name = "label11"; - this.label11.Size = new System.Drawing.Size(45, 13); + this.label11.Size = new System.Drawing.Size(64, 25); this.label11.TabIndex = 20; this.label11.Text = "Decimal"; - // - // txtSW_Dec - // - this.txtSW_Dec.Location = new System.Drawing.Point(271, 137); - this.txtSW_Dec.Name = "txtSW_Dec"; - this.txtSW_Dec.ReadOnly = true; - this.txtSW_Dec.Size = new System.Drawing.Size(65, 20); - this.txtSW_Dec.TabIndex = 19; - this.txtSW_Dec.Text = "0"; - this.txtSW_Dec.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; - // - // txtPC_Dec - // - this.txtPC_Dec.Location = new System.Drawing.Point(271, 109); - this.txtPC_Dec.Name = "txtPC_Dec"; - this.txtPC_Dec.ReadOnly = true; - this.txtPC_Dec.Size = new System.Drawing.Size(65, 20); - this.txtPC_Dec.TabIndex = 18; - this.txtPC_Dec.Text = "0"; - this.txtPC_Dec.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; - // - // txtX_Dec - // - this.txtX_Dec.Location = new System.Drawing.Point(271, 82); - this.txtX_Dec.Name = "txtX_Dec"; - this.txtX_Dec.ReadOnly = true; - this.txtX_Dec.Size = new System.Drawing.Size(65, 20); - this.txtX_Dec.TabIndex = 17; - this.txtX_Dec.Text = "0"; - this.txtX_Dec.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; - // - // txtL_Dec - // - this.txtL_Dec.Location = new System.Drawing.Point(271, 56); - this.txtL_Dec.Name = "txtL_Dec"; - this.txtL_Dec.ReadOnly = true; - this.txtL_Dec.Size = new System.Drawing.Size(65, 20); - this.txtL_Dec.TabIndex = 16; - this.txtL_Dec.Text = "0"; - this.txtL_Dec.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.label11.TextAlign = System.Drawing.ContentAlignment.BottomLeft; // // txtA_Dec // - this.txtA_Dec.Location = new System.Drawing.Point(271, 30); + this.txtA_Dec.Dock = System.Windows.Forms.DockStyle.Fill; + this.txtA_Dec.Location = new System.Drawing.Point(333, 28); this.txtA_Dec.Name = "txtA_Dec"; this.txtA_Dec.ReadOnly = true; - this.txtA_Dec.Size = new System.Drawing.Size(65, 20); + this.txtA_Dec.Size = new System.Drawing.Size(64, 20); this.txtA_Dec.TabIndex = 15; this.txtA_Dec.Text = "0"; this.txtA_Dec.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; // - // label10 - // - this.label10.AutoSize = true; - this.label10.Location = new System.Drawing.Point(155, 14); - this.label10.Name = "label10"; - this.label10.Size = new System.Drawing.Size(47, 13); - this.label10.TabIndex = 14; - this.label10.Text = "BINARY"; - // - // label9 - // - this.label9.AutoSize = true; - this.label9.Location = new System.Drawing.Point(42, 14); - this.label9.Name = "label9"; - this.label9.Size = new System.Drawing.Size(29, 13); - this.label9.TabIndex = 13; - this.label9.Text = "HEX"; - // - // txtA_BIN_LSB - // - this.txtA_BIN_LSB.Location = new System.Drawing.Point(204, 30); - this.txtA_BIN_LSB.Name = "txtA_BIN_LSB"; - this.txtA_BIN_LSB.ReadOnly = true; - this.txtA_BIN_LSB.Size = new System.Drawing.Size(57, 20); - this.txtA_BIN_LSB.TabIndex = 12; - this.txtA_BIN_LSB.Text = "00000000"; - this.txtA_BIN_LSB.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; - // - // txtA_BIN_MIB + // txtL_Dec // - this.txtA_BIN_MIB.Location = new System.Drawing.Point(145, 30); - this.txtA_BIN_MIB.Name = "txtA_BIN_MIB"; - this.txtA_BIN_MIB.ReadOnly = true; - this.txtA_BIN_MIB.Size = new System.Drawing.Size(57, 20); - this.txtA_BIN_MIB.TabIndex = 11; - this.txtA_BIN_MIB.Text = "00000000"; - this.txtA_BIN_MIB.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.txtL_Dec.Dock = System.Windows.Forms.DockStyle.Fill; + this.txtL_Dec.Location = new System.Drawing.Point(333, 53); + this.txtL_Dec.Name = "txtL_Dec"; + this.txtL_Dec.ReadOnly = true; + this.txtL_Dec.Size = new System.Drawing.Size(64, 20); + this.txtL_Dec.TabIndex = 16; + this.txtL_Dec.Text = "0"; + this.txtL_Dec.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; // - // txtA_BIN_MSB + // label5 // - this.txtA_BIN_MSB.Location = new System.Drawing.Point(86, 30); - this.txtA_BIN_MSB.Name = "txtA_BIN_MSB"; - this.txtA_BIN_MSB.ReadOnly = true; - this.txtA_BIN_MSB.Size = new System.Drawing.Size(57, 20); - this.txtA_BIN_MSB.TabIndex = 10; - this.txtA_BIN_MSB.Text = "00000000"; - this.txtA_BIN_MSB.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.label5.AutoSize = true; + this.label5.Dock = System.Windows.Forms.DockStyle.Fill; + this.label5.Location = new System.Drawing.Point(3, 125); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(44, 25); + this.label5.TabIndex = 7; + this.label5.Text = "SW"; + this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // txtSW_Hex // - this.txtSW_Hex.Location = new System.Drawing.Point(33, 137); + this.txtSW_Hex.Dock = System.Windows.Forms.DockStyle.Fill; + this.txtSW_Hex.Location = new System.Drawing.Point(53, 128); this.txtSW_Hex.Name = "txtSW_Hex"; this.txtSW_Hex.ReadOnly = true; - this.txtSW_Hex.Size = new System.Drawing.Size(49, 20); + this.txtSW_Hex.Size = new System.Drawing.Size(64, 20); this.txtSW_Hex.TabIndex = 9; this.txtSW_Hex.Text = "000000"; this.txtSW_Hex.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; // - // txtPC_Hex - // - this.txtPC_Hex.Location = new System.Drawing.Point(34, 109); - this.txtPC_Hex.Name = "txtPC_Hex"; - this.txtPC_Hex.ReadOnly = true; - this.txtPC_Hex.Size = new System.Drawing.Size(49, 20); - this.txtPC_Hex.TabIndex = 8; - this.txtPC_Hex.Text = "000000"; - this.txtPC_Hex.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; - // - // label5 - // - this.label5.AutoSize = true; - this.label5.Location = new System.Drawing.Point(6, 140); - this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(25, 13); - this.label5.TabIndex = 7; - this.label5.Text = "SW"; - // // label4 // this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(6, 111); + this.label4.Dock = System.Windows.Forms.DockStyle.Fill; + this.label4.Location = new System.Drawing.Point(3, 100); this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(27, 13); + this.label4.Size = new System.Drawing.Size(44, 25); this.label4.TabIndex = 6; this.label4.Text = "(PC)"; + this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Dock = System.Windows.Forms.DockStyle.Fill; + this.label9.Location = new System.Drawing.Point(53, 0); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(64, 25); + this.label9.TabIndex = 13; + this.label9.Text = "Hex"; + this.label9.TextAlign = System.Drawing.ContentAlignment.BottomLeft; // // label3 // this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(14, 85); + this.label3.Dock = System.Windows.Forms.DockStyle.Fill; + this.label3.Location = new System.Drawing.Point(3, 75); this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(14, 13); + this.label3.Size = new System.Drawing.Size(44, 25); this.label3.TabIndex = 5; this.label3.Text = "X"; + this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // txtPC_Hex + // + this.txtPC_Hex.Dock = System.Windows.Forms.DockStyle.Fill; + this.txtPC_Hex.Location = new System.Drawing.Point(53, 103); + this.txtPC_Hex.Name = "txtPC_Hex"; + this.txtPC_Hex.ReadOnly = true; + this.txtPC_Hex.Size = new System.Drawing.Size(64, 20); + this.txtPC_Hex.TabIndex = 8; + this.txtPC_Hex.Text = "000000"; + this.txtPC_Hex.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; // // label2 // this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(15, 61); + this.label2.Dock = System.Windows.Forms.DockStyle.Fill; + this.label2.Location = new System.Drawing.Point(3, 50); this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(13, 13); + this.label2.Size = new System.Drawing.Size(44, 25); this.label2.TabIndex = 4; this.label2.Text = "L"; + this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // txtL_BIN_MSB + // + this.txtL_BIN_MSB.Dock = System.Windows.Forms.DockStyle.Fill; + this.txtL_BIN_MSB.Location = new System.Drawing.Point(123, 53); + this.txtL_BIN_MSB.Name = "txtL_BIN_MSB"; + this.txtL_BIN_MSB.ReadOnly = true; + this.txtL_BIN_MSB.Size = new System.Drawing.Size(64, 20); + this.txtL_BIN_MSB.TabIndex = 21; + this.txtL_BIN_MSB.Text = "00000000"; + this.txtL_BIN_MSB.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; // // label1 // this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(13, 33); + this.label1.Dock = System.Windows.Forms.DockStyle.Fill; + this.label1.Location = new System.Drawing.Point(3, 25); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(14, 13); + this.label1.Size = new System.Drawing.Size(44, 25); this.label1.TabIndex = 3; this.label1.Text = "A"; + this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // txtA_BIN_MSB + // + this.txtA_BIN_MSB.Dock = System.Windows.Forms.DockStyle.Fill; + this.txtA_BIN_MSB.Location = new System.Drawing.Point(123, 28); + this.txtA_BIN_MSB.Name = "txtA_BIN_MSB"; + this.txtA_BIN_MSB.ReadOnly = true; + this.txtA_BIN_MSB.Size = new System.Drawing.Size(64, 20); + this.txtA_BIN_MSB.TabIndex = 10; + this.txtA_BIN_MSB.Text = "00000000"; + this.txtA_BIN_MSB.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + // + // txtX_BIN_MSB + // + this.txtX_BIN_MSB.Dock = System.Windows.Forms.DockStyle.Fill; + this.txtX_BIN_MSB.Location = new System.Drawing.Point(123, 78); + this.txtX_BIN_MSB.Name = "txtX_BIN_MSB"; + this.txtX_BIN_MSB.ReadOnly = true; + this.txtX_BIN_MSB.Size = new System.Drawing.Size(64, 20); + this.txtX_BIN_MSB.TabIndex = 24; + this.txtX_BIN_MSB.Text = "00000000"; + this.txtX_BIN_MSB.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + // + // txtPC_BIN_MSB + // + this.txtPC_BIN_MSB.Dock = System.Windows.Forms.DockStyle.Fill; + this.txtPC_BIN_MSB.Location = new System.Drawing.Point(123, 103); + this.txtPC_BIN_MSB.Name = "txtPC_BIN_MSB"; + this.txtPC_BIN_MSB.ReadOnly = true; + this.txtPC_BIN_MSB.Size = new System.Drawing.Size(64, 20); + this.txtPC_BIN_MSB.TabIndex = 27; + this.txtPC_BIN_MSB.Text = "00000000"; + this.txtPC_BIN_MSB.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + // + // txtSW_BIN_MSB + // + this.txtSW_BIN_MSB.Dock = System.Windows.Forms.DockStyle.Fill; + this.txtSW_BIN_MSB.Location = new System.Drawing.Point(123, 128); + this.txtSW_BIN_MSB.Name = "txtSW_BIN_MSB"; + this.txtSW_BIN_MSB.ReadOnly = true; + this.txtSW_BIN_MSB.Size = new System.Drawing.Size(64, 20); + this.txtSW_BIN_MSB.TabIndex = 30; + this.txtSW_BIN_MSB.Text = "00000000"; + this.txtSW_BIN_MSB.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + // + // txtSW_BIN_MIB + // + this.txtSW_BIN_MIB.Dock = System.Windows.Forms.DockStyle.Fill; + this.txtSW_BIN_MIB.Location = new System.Drawing.Point(193, 128); + this.txtSW_BIN_MIB.Name = "txtSW_BIN_MIB"; + this.txtSW_BIN_MIB.ReadOnly = true; + this.txtSW_BIN_MIB.Size = new System.Drawing.Size(64, 20); + this.txtSW_BIN_MIB.TabIndex = 31; + this.txtSW_BIN_MIB.Text = "00000000"; + this.txtSW_BIN_MIB.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; // // txtX_Hex // - this.txtX_Hex.Location = new System.Drawing.Point(34, 82); + this.txtX_Hex.Dock = System.Windows.Forms.DockStyle.Fill; + this.txtX_Hex.Location = new System.Drawing.Point(53, 78); this.txtX_Hex.Name = "txtX_Hex"; this.txtX_Hex.ReadOnly = true; - this.txtX_Hex.Size = new System.Drawing.Size(49, 20); + this.txtX_Hex.Size = new System.Drawing.Size(64, 20); this.txtX_Hex.TabIndex = 2; this.txtX_Hex.Text = "000000"; this.txtX_Hex.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; // + // txtSW_BIN_LSB + // + this.txtSW_BIN_LSB.Dock = System.Windows.Forms.DockStyle.Fill; + this.txtSW_BIN_LSB.Location = new System.Drawing.Point(263, 128); + this.txtSW_BIN_LSB.Name = "txtSW_BIN_LSB"; + this.txtSW_BIN_LSB.ReadOnly = true; + this.txtSW_BIN_LSB.Size = new System.Drawing.Size(64, 20); + this.txtSW_BIN_LSB.TabIndex = 32; + this.txtSW_BIN_LSB.Text = "00000000"; + this.txtSW_BIN_LSB.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + // // txtL_Hex // - this.txtL_Hex.Location = new System.Drawing.Point(33, 56); + this.txtL_Hex.Dock = System.Windows.Forms.DockStyle.Fill; + this.txtL_Hex.Location = new System.Drawing.Point(53, 53); this.txtL_Hex.Name = "txtL_Hex"; this.txtL_Hex.ReadOnly = true; - this.txtL_Hex.Size = new System.Drawing.Size(49, 20); + this.txtL_Hex.Size = new System.Drawing.Size(64, 20); this.txtL_Hex.TabIndex = 1; this.txtL_Hex.Text = "000000"; this.txtL_Hex.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; // + // txtX_Dec + // + this.txtX_Dec.Dock = System.Windows.Forms.DockStyle.Fill; + this.txtX_Dec.Location = new System.Drawing.Point(333, 78); + this.txtX_Dec.Name = "txtX_Dec"; + this.txtX_Dec.ReadOnly = true; + this.txtX_Dec.Size = new System.Drawing.Size(64, 20); + this.txtX_Dec.TabIndex = 17; + this.txtX_Dec.Text = "0"; + this.txtX_Dec.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + // + // txtPC_BIN_MIB + // + this.txtPC_BIN_MIB.Dock = System.Windows.Forms.DockStyle.Fill; + this.txtPC_BIN_MIB.Location = new System.Drawing.Point(193, 103); + this.txtPC_BIN_MIB.Name = "txtPC_BIN_MIB"; + this.txtPC_BIN_MIB.ReadOnly = true; + this.txtPC_BIN_MIB.Size = new System.Drawing.Size(64, 20); + this.txtPC_BIN_MIB.TabIndex = 28; + this.txtPC_BIN_MIB.Text = "00000000"; + this.txtPC_BIN_MIB.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + // + // txtPC_Dec + // + this.txtPC_Dec.Dock = System.Windows.Forms.DockStyle.Fill; + this.txtPC_Dec.Location = new System.Drawing.Point(333, 103); + this.txtPC_Dec.Name = "txtPC_Dec"; + this.txtPC_Dec.ReadOnly = true; + this.txtPC_Dec.Size = new System.Drawing.Size(64, 20); + this.txtPC_Dec.TabIndex = 18; + this.txtPC_Dec.Text = "0"; + this.txtPC_Dec.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + // // txtA_Hex // - this.txtA_Hex.Location = new System.Drawing.Point(33, 30); + this.txtA_Hex.Dock = System.Windows.Forms.DockStyle.Fill; + this.txtA_Hex.Location = new System.Drawing.Point(53, 28); this.txtA_Hex.Name = "txtA_Hex"; this.txtA_Hex.ReadOnly = true; - this.txtA_Hex.Size = new System.Drawing.Size(49, 20); + this.txtA_Hex.Size = new System.Drawing.Size(64, 20); this.txtA_Hex.TabIndex = 0; this.txtA_Hex.Text = "000000"; this.txtA_Hex.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; // + // txtSW_Dec + // + this.txtSW_Dec.Dock = System.Windows.Forms.DockStyle.Fill; + this.txtSW_Dec.Location = new System.Drawing.Point(333, 128); + this.txtSW_Dec.Name = "txtSW_Dec"; + this.txtSW_Dec.ReadOnly = true; + this.txtSW_Dec.Size = new System.Drawing.Size(64, 20); + this.txtSW_Dec.TabIndex = 19; + this.txtSW_Dec.Text = "0"; + this.txtSW_Dec.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + // + // txtX_BIN_MIB + // + this.txtX_BIN_MIB.Dock = System.Windows.Forms.DockStyle.Fill; + this.txtX_BIN_MIB.Location = new System.Drawing.Point(193, 78); + this.txtX_BIN_MIB.Name = "txtX_BIN_MIB"; + this.txtX_BIN_MIB.ReadOnly = true; + this.txtX_BIN_MIB.Size = new System.Drawing.Size(64, 20); + this.txtX_BIN_MIB.TabIndex = 25; + this.txtX_BIN_MIB.Text = "00000000"; + this.txtX_BIN_MIB.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + // + // txtPC_BIN_LSB + // + this.txtPC_BIN_LSB.Dock = System.Windows.Forms.DockStyle.Fill; + this.txtPC_BIN_LSB.Location = new System.Drawing.Point(263, 103); + this.txtPC_BIN_LSB.Name = "txtPC_BIN_LSB"; + this.txtPC_BIN_LSB.ReadOnly = true; + this.txtPC_BIN_LSB.Size = new System.Drawing.Size(64, 20); + this.txtPC_BIN_LSB.TabIndex = 29; + this.txtPC_BIN_LSB.Text = "00000000"; + this.txtPC_BIN_LSB.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + // + // txtL_BIN_MIB + // + this.txtL_BIN_MIB.Dock = System.Windows.Forms.DockStyle.Fill; + this.txtL_BIN_MIB.Location = new System.Drawing.Point(193, 53); + this.txtL_BIN_MIB.Name = "txtL_BIN_MIB"; + this.txtL_BIN_MIB.ReadOnly = true; + this.txtL_BIN_MIB.Size = new System.Drawing.Size(64, 20); + this.txtL_BIN_MIB.TabIndex = 22; + this.txtL_BIN_MIB.Text = "00000000"; + this.txtL_BIN_MIB.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + // + // txtA_BIN_LSB + // + this.txtA_BIN_LSB.Dock = System.Windows.Forms.DockStyle.Fill; + this.txtA_BIN_LSB.Location = new System.Drawing.Point(263, 28); + this.txtA_BIN_LSB.Name = "txtA_BIN_LSB"; + this.txtA_BIN_LSB.ReadOnly = true; + this.txtA_BIN_LSB.Size = new System.Drawing.Size(64, 20); + this.txtA_BIN_LSB.TabIndex = 12; + this.txtA_BIN_LSB.Text = "00000000"; + this.txtA_BIN_LSB.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + // + // txtL_BIN_LSB + // + this.txtL_BIN_LSB.Dock = System.Windows.Forms.DockStyle.Fill; + this.txtL_BIN_LSB.Location = new System.Drawing.Point(263, 53); + this.txtL_BIN_LSB.Name = "txtL_BIN_LSB"; + this.txtL_BIN_LSB.ReadOnly = true; + this.txtL_BIN_LSB.Size = new System.Drawing.Size(64, 20); + this.txtL_BIN_LSB.TabIndex = 23; + this.txtL_BIN_LSB.Text = "00000000"; + this.txtL_BIN_LSB.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + // + // txtX_BIN_LSB + // + this.txtX_BIN_LSB.Dock = System.Windows.Forms.DockStyle.Fill; + this.txtX_BIN_LSB.Location = new System.Drawing.Point(263, 78); + this.txtX_BIN_LSB.Name = "txtX_BIN_LSB"; + this.txtX_BIN_LSB.ReadOnly = true; + this.txtX_BIN_LSB.Size = new System.Drawing.Size(64, 20); + this.txtX_BIN_LSB.TabIndex = 26; + this.txtX_BIN_LSB.Text = "00000000"; + this.txtX_BIN_LSB.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + // + // txtA_BIN_MIB + // + this.txtA_BIN_MIB.Dock = System.Windows.Forms.DockStyle.Fill; + this.txtA_BIN_MIB.Location = new System.Drawing.Point(193, 28); + this.txtA_BIN_MIB.Name = "txtA_BIN_MIB"; + this.txtA_BIN_MIB.ReadOnly = true; + this.txtA_BIN_MIB.Size = new System.Drawing.Size(64, 20); + this.txtA_BIN_MIB.TabIndex = 11; + this.txtA_BIN_MIB.Text = "00000000"; + this.txtA_BIN_MIB.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + // + // label10 + // + this.label10.AutoSize = true; + this.label10.Dock = System.Windows.Forms.DockStyle.Fill; + this.label10.Location = new System.Drawing.Point(123, 0); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(64, 25); + this.label10.TabIndex = 14; + this.label10.Text = "Binary"; + this.label10.TextAlign = System.Drawing.ContentAlignment.BottomLeft; + // // menuStrip1 // + this.menuStrip1.ImageScalingSize = new System.Drawing.Size(24, 24); this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.tsmFile, this.tsmAbout, this.machineToolStripMenuItem}); this.menuStrip1.Location = new System.Drawing.Point(0, 0); this.menuStrip1.Name = "menuStrip1"; - this.menuStrip1.Size = new System.Drawing.Size(1061, 24); + this.menuStrip1.Padding = new System.Windows.Forms.Padding(7, 2, 0, 2); + this.menuStrip1.Size = new System.Drawing.Size(1120, 24); this.menuStrip1.TabIndex = 1; this.menuStrip1.Text = "menuStrip1"; // @@ -548,35 +635,42 @@ private void InitializeComponent() this.tsmOpen_SIC_Object_File.Name = "tsmOpen_SIC_Object_File"; this.tsmOpen_SIC_Object_File.Size = new System.Drawing.Size(257, 22); this.tsmOpen_SIC_Object_File.Text = "Open SIC Object File"; - this.tsmOpen_SIC_Object_File.Click += new System.EventHandler(this.tsmOpen_SIC_Object_File_Click); + this.tsmOpen_SIC_Object_File.Click += new System.EventHandler(this.TsmOpen_SIC_Object_File_Click); // // tsmloadAndAssembleSICSourceFIle // this.tsmloadAndAssembleSICSourceFIle.Name = "tsmloadAndAssembleSICSourceFIle"; this.tsmloadAndAssembleSICSourceFIle.Size = new System.Drawing.Size(257, 22); this.tsmloadAndAssembleSICSourceFIle.Text = "Load and Assemble SIC Source FIle"; - this.tsmloadAndAssembleSICSourceFIle.Click += new System.EventHandler(this.tsmloadAndAssembleSICSourceFIle_Click); + this.tsmloadAndAssembleSICSourceFIle.Click += new System.EventHandler(this.TsmloadAndAssembleSICSourceFIle_Click); // // loadSavedSICMachineStateToolStripMenuItem // this.loadSavedSICMachineStateToolStripMenuItem.Name = "loadSavedSICMachineStateToolStripMenuItem"; this.loadSavedSICMachineStateToolStripMenuItem.Size = new System.Drawing.Size(257, 22); this.loadSavedSICMachineStateToolStripMenuItem.Text = "Load Saved SIC Machine State"; - this.loadSavedSICMachineStateToolStripMenuItem.Click += new System.EventHandler(this.loadSavedSICMachineStateToolStripMenuItem_Click); + this.loadSavedSICMachineStateToolStripMenuItem.Click += new System.EventHandler(this.LoadSavedSICMachineStateToolStripMenuItem_Click); + // + // loadObjectFileToolStripMenuItem + // + this.loadObjectFileToolStripMenuItem.Name = "loadObjectFileToolStripMenuItem"; + this.loadObjectFileToolStripMenuItem.Size = new System.Drawing.Size(257, 22); + this.loadObjectFileToolStripMenuItem.Text = "Load Object File"; + this.loadObjectFileToolStripMenuItem.Click += new System.EventHandler(this.LoadObjectFileToolStripMenuItem_Click); // // tsmSaveMachineState // this.tsmSaveMachineState.Name = "tsmSaveMachineState"; this.tsmSaveMachineState.Size = new System.Drawing.Size(257, 22); this.tsmSaveMachineState.Text = "Save SIC Machine State"; - this.tsmSaveMachineState.Click += new System.EventHandler(this.tsmSaveMachineState_Click); + this.tsmSaveMachineState.Click += new System.EventHandler(this.TsmSaveMachineState_Click); // // tsmFile_Ext // this.tsmFile_Ext.Name = "tsmFile_Ext"; this.tsmFile_Ext.Size = new System.Drawing.Size(257, 22); this.tsmFile_Ext.Text = "Exit"; - this.tsmFile_Ext.Click += new System.EventHandler(this.tsmFile_Ext_Click); + this.tsmFile_Ext.Click += new System.EventHandler(this.TsmFile_Ext_Click); // // tsmAbout // @@ -603,6 +697,7 @@ private void InitializeComponent() // this.machineToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.tsmzeroAllMemory, + this.clearDevicesToolStripMenuItem, this.randomizeAllMemory, this.setProgramCounterToToolStripMenuItem, this.stepSingleInstructionToolStripMenuItem, @@ -619,6 +714,13 @@ private void InitializeComponent() this.tsmzeroAllMemory.Size = new System.Drawing.Size(208, 22); this.tsmzeroAllMemory.Text = "Zero All Memory"; // + // clearDevicesToolStripMenuItem + // + this.clearDevicesToolStripMenuItem.Name = "clearDevicesToolStripMenuItem"; + this.clearDevicesToolStripMenuItem.Size = new System.Drawing.Size(208, 22); + this.clearDevicesToolStripMenuItem.Text = "Clear Devices"; + this.clearDevicesToolStripMenuItem.Click += new System.EventHandler(this.ClearDevicesToolStripMenuItem_Click); + // // randomizeAllMemory // this.randomizeAllMemory.Name = "randomizeAllMemory"; @@ -630,119 +732,147 @@ private void InitializeComponent() this.setProgramCounterToToolStripMenuItem.Name = "setProgramCounterToToolStripMenuItem"; this.setProgramCounterToToolStripMenuItem.Size = new System.Drawing.Size(208, 22); this.setProgramCounterToToolStripMenuItem.Text = "Set Program Counter To"; - this.setProgramCounterToToolStripMenuItem.Click += new System.EventHandler(this.setProgramCounterToToolStripMenuItem_Click); + this.setProgramCounterToToolStripMenuItem.Click += new System.EventHandler(this.SetProgramCounterToToolStripMenuItem_Click); // // stepSingleInstructionToolStripMenuItem // this.stepSingleInstructionToolStripMenuItem.Name = "stepSingleInstructionToolStripMenuItem"; this.stepSingleInstructionToolStripMenuItem.Size = new System.Drawing.Size(208, 22); - this.stepSingleInstructionToolStripMenuItem.Text = "Step Single Instruction"; + this.stepSingleInstructionToolStripMenuItem.Text = "Step Single Instruction"; // // tsmsetMemoryBYTE // this.tsmsetMemoryBYTE.Name = "tsmsetMemoryBYTE"; this.tsmsetMemoryBYTE.Size = new System.Drawing.Size(208, 22); this.tsmsetMemoryBYTE.Text = "Set Memory BYTE"; - this.tsmsetMemoryBYTE.Click += new System.EventHandler(this.tsmsetMemoryBYTE_Click); + this.tsmsetMemoryBYTE.Click += new System.EventHandler(this.TsmSetMemoryBYTE_Click); // // setMemoryWORDToolStripMenuItem // this.setMemoryWORDToolStripMenuItem.Name = "setMemoryWORDToolStripMenuItem"; this.setMemoryWORDToolStripMenuItem.Size = new System.Drawing.Size(208, 22); this.setMemoryWORDToolStripMenuItem.Text = "Set Memory WORD"; - this.setMemoryWORDToolStripMenuItem.Click += new System.EventHandler(this.setMemoryWORDToolStripMenuItem_Click); + this.setMemoryWORDToolStripMenuItem.Click += new System.EventHandler(this.SetMemoryWORDToolStripMenuItem_Click); // // tsmresetSICVirtualMachine // this.tsmresetSICVirtualMachine.Name = "tsmresetSICVirtualMachine"; this.tsmresetSICVirtualMachine.Size = new System.Drawing.Size(208, 22); this.tsmresetSICVirtualMachine.Text = "Reset SIC Virtual Machine"; - this.tsmresetSICVirtualMachine.Click += new System.EventHandler(this.tsmresetSICVirtualMachine_Click); + this.tsmresetSICVirtualMachine.Click += new System.EventHandler(this.TsmResetSICVirtualMachine_Click); // // tcMachine // - this.tcMachine.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left))); this.tcMachine.Controls.Add(this.tpMemory); this.tcMachine.Controls.Add(this.tpDevices); this.tcMachine.Controls.Add(this.tpMicroSteps); - this.tcMachine.Location = new System.Drawing.Point(13, 226); + this.tcMachine.Dock = System.Windows.Forms.DockStyle.Fill; + this.tcMachine.Location = new System.Drawing.Point(3, 203); this.tcMachine.Name = "tcMachine"; this.tcMachine.SelectedIndex = 0; - this.tcMachine.Size = new System.Drawing.Size(539, 514); + this.tcMachine.Size = new System.Drawing.Size(669, 482); this.tcMachine.TabIndex = 2; // // tpMemory // this.tpMemory.AutoScroll = true; this.tpMemory.Controls.Add(this.rtfMemory); - this.tpMemory.Controls.Add(this.rbMemHex); - this.tpMemory.Controls.Add(this.rbMemBinary); - this.tpMemory.Location = new System.Drawing.Point(4, 22); + this.tpMemory.Controls.Add(this.flowLayoutPanel3); + this.tpMemory.Location = new System.Drawing.Point(4, 23); this.tpMemory.Name = "tpMemory"; this.tpMemory.Padding = new System.Windows.Forms.Padding(3); - this.tpMemory.Size = new System.Drawing.Size(531, 488); + this.tpMemory.Size = new System.Drawing.Size(661, 455); this.tpMemory.TabIndex = 0; this.tpMemory.Text = "Memory"; this.tpMemory.UseVisualStyleBackColor = true; // // rtfMemory // - this.rtfMemory.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this.rtfMemory.Dock = System.Windows.Forms.DockStyle.Fill; this.rtfMemory.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.rtfMemory.Location = new System.Drawing.Point(6, 31); + this.rtfMemory.Location = new System.Drawing.Point(3, 27); this.rtfMemory.Name = "rtfMemory"; - this.rtfMemory.Size = new System.Drawing.Size(515, 448); + this.rtfMemory.Size = new System.Drawing.Size(655, 425); this.rtfMemory.TabIndex = 3; this.rtfMemory.Text = ""; // + // flowLayoutPanel3 + // + this.flowLayoutPanel3.AutoSize = true; + this.flowLayoutPanel3.Controls.Add(this.rbMemBinary); + this.flowLayoutPanel3.Controls.Add(this.rbMemHex); + this.flowLayoutPanel3.Controls.Add(this.rbMemDecimal); + this.flowLayoutPanel3.Controls.Add(this.rbMemAscii); + this.flowLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Top; + this.flowLayoutPanel3.Location = new System.Drawing.Point(3, 3); + this.flowLayoutPanel3.Name = "flowLayoutPanel3"; + this.flowLayoutPanel3.Size = new System.Drawing.Size(655, 24); + this.flowLayoutPanel3.TabIndex = 4; + // + // rbMemBinary + // + this.rbMemBinary.AutoSize = true; + this.rbMemBinary.Location = new System.Drawing.Point(3, 3); + this.rbMemBinary.Name = "rbMemBinary"; + this.rbMemBinary.Size = new System.Drawing.Size(56, 18); + this.rbMemBinary.TabIndex = 0; + this.rbMemBinary.Text = "Binary"; + this.rbMemBinary.UseVisualStyleBackColor = true; + // // rbMemHex // this.rbMemHex.AutoSize = true; this.rbMemHex.Checked = true; - this.rbMemHex.Location = new System.Drawing.Point(73, 7); + this.rbMemHex.Location = new System.Drawing.Point(65, 3); this.rbMemHex.Name = "rbMemHex"; - this.rbMemHex.Size = new System.Drawing.Size(44, 17); + this.rbMemHex.Size = new System.Drawing.Size(44, 18); this.rbMemHex.TabIndex = 1; this.rbMemHex.TabStop = true; this.rbMemHex.Text = "Hex"; this.rbMemHex.UseVisualStyleBackColor = true; // - // rbMemBinary + // rbMemDecimal // - this.rbMemBinary.AutoSize = true; - this.rbMemBinary.Location = new System.Drawing.Point(13, 7); - this.rbMemBinary.Name = "rbMemBinary"; - this.rbMemBinary.Size = new System.Drawing.Size(54, 17); - this.rbMemBinary.TabIndex = 0; - this.rbMemBinary.Text = "Binary"; - this.rbMemBinary.UseVisualStyleBackColor = true; + this.rbMemDecimal.AutoSize = true; + this.rbMemDecimal.Location = new System.Drawing.Point(115, 3); + this.rbMemDecimal.Name = "rbMemDecimal"; + this.rbMemDecimal.Size = new System.Drawing.Size(62, 18); + this.rbMemDecimal.TabIndex = 2; + this.rbMemDecimal.Text = "Decimal"; + this.rbMemDecimal.UseVisualStyleBackColor = true; + // + // rbMemAscii + // + this.rbMemAscii.AutoSize = true; + this.rbMemAscii.Location = new System.Drawing.Point(183, 3); + this.rbMemAscii.Name = "rbMemAscii"; + this.rbMemAscii.Size = new System.Drawing.Size(51, 18); + this.rbMemAscii.TabIndex = 1; + this.rbMemAscii.TabStop = true; + this.rbMemAscii.Text = "ASCII"; + this.rbMemAscii.UseVisualStyleBackColor = true; // // tpDevices // this.tpDevices.Controls.Add(this.lvDevices); - this.tpDevices.Location = new System.Drawing.Point(4, 22); + this.tpDevices.Location = new System.Drawing.Point(4, 23); this.tpDevices.Name = "tpDevices"; this.tpDevices.Padding = new System.Windows.Forms.Padding(3); - this.tpDevices.Size = new System.Drawing.Size(531, 488); + this.tpDevices.Size = new System.Drawing.Size(661, 446); this.tpDevices.TabIndex = 1; this.tpDevices.Text = "Devices"; this.tpDevices.UseVisualStyleBackColor = true; // // lvDevices // - this.lvDevices.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); this.lvDevices.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.colDeviceID, this.colOutput}); + this.lvDevices.Dock = System.Windows.Forms.DockStyle.Fill; this.lvDevices.HideSelection = false; - this.lvDevices.Location = new System.Drawing.Point(5, 6); + this.lvDevices.Location = new System.Drawing.Point(3, 3); this.lvDevices.Name = "lvDevices"; - this.lvDevices.Size = new System.Drawing.Size(520, 476); + this.lvDevices.Size = new System.Drawing.Size(655, 440); this.lvDevices.TabIndex = 0; this.lvDevices.UseCompatibleStateImageBehavior = false; this.lvDevices.View = System.Windows.Forms.View.Details; @@ -760,69 +890,67 @@ private void InitializeComponent() // tpMicroSteps // this.tpMicroSteps.Controls.Add(this.rtfMicroSteps); - this.tpMicroSteps.Location = new System.Drawing.Point(4, 22); + this.tpMicroSteps.Location = new System.Drawing.Point(4, 23); this.tpMicroSteps.Name = "tpMicroSteps"; - this.tpMicroSteps.Size = new System.Drawing.Size(531, 488); + this.tpMicroSteps.Size = new System.Drawing.Size(661, 446); this.tpMicroSteps.TabIndex = 2; this.tpMicroSteps.Text = "Microsteps"; this.tpMicroSteps.UseVisualStyleBackColor = true; // // rtfMicroSteps // - this.rtfMicroSteps.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this.rtfMicroSteps.Dock = System.Windows.Forms.DockStyle.Fill; this.rtfMicroSteps.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.rtfMicroSteps.Location = new System.Drawing.Point(5, 7); + this.rtfMicroSteps.Location = new System.Drawing.Point(0, 0); this.rtfMicroSteps.Name = "rtfMicroSteps"; - this.rtfMicroSteps.Size = new System.Drawing.Size(523, 472); + this.rtfMicroSteps.Size = new System.Drawing.Size(661, 446); this.rtfMicroSteps.TabIndex = 4; this.rtfMicroSteps.Text = ""; // // btnStep // this.btnStep.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.btnStep.Location = new System.Drawing.Point(28, 746); + this.btnStep.Location = new System.Drawing.Point(3, 3); this.btnStep.Name = "btnStep"; - this.btnStep.Size = new System.Drawing.Size(75, 23); + this.btnStep.Size = new System.Drawing.Size(100, 25); this.btnStep.TabIndex = 4; this.btnStep.Text = "Step"; this.btnStep.UseVisualStyleBackColor = true; - this.btnStep.Click += new System.EventHandler(this.btnStep_Click); + this.btnStep.Click += new System.EventHandler(this.BtnStep_Click); // // label12 // this.label12.AutoSize = true; - this.label12.Location = new System.Drawing.Point(362, 48); + this.label12.Location = new System.Drawing.Point(3, 0); this.label12.Name = "label12"; - this.label12.Size = new System.Drawing.Size(81, 13); + this.label12.Size = new System.Drawing.Size(82, 14); this.label12.TabIndex = 5; this.label12.Text = "Next Instruction"; // // lblNextInstruction // this.lblNextInstruction.AutoSize = true; - this.lblNextInstruction.Location = new System.Drawing.Point(393, 64); + this.lblNextInstruction.Location = new System.Drawing.Point(3, 14); this.lblNextInstruction.Name = "lblNextInstruction"; - this.lblNextInstruction.Size = new System.Drawing.Size(37, 13); + this.lblNextInstruction.Size = new System.Drawing.Size(43, 14); this.lblNextInstruction.TabIndex = 6; this.lblNextInstruction.Text = "xxxxxx"; // // lblNI_Description // this.lblNI_Description.AutoSize = true; - this.lblNI_Description.Location = new System.Drawing.Point(393, 85); + this.lblNI_Description.Location = new System.Drawing.Point(3, 28); this.lblNI_Description.Name = "lblNI_Description"; - this.lblNI_Description.Size = new System.Drawing.Size(37, 13); + this.lblNI_Description.Size = new System.Drawing.Size(43, 14); this.lblNI_Description.TabIndex = 7; this.lblNI_Description.Text = "xxxxxx"; // // lblNextInstruction_Effect // this.lblNextInstruction_Effect.AutoSize = true; - this.lblNextInstruction_Effect.Location = new System.Drawing.Point(393, 105); + this.lblNextInstruction_Effect.Location = new System.Drawing.Point(3, 42); this.lblNextInstruction_Effect.Name = "lblNextInstruction_Effect"; - this.lblNextInstruction_Effect.Size = new System.Drawing.Size(37, 13); + this.lblNextInstruction_Effect.Size = new System.Drawing.Size(43, 14); this.lblNextInstruction_Effect.TabIndex = 8; this.lblNextInstruction_Effect.Text = "xxxxxx"; // @@ -834,67 +962,61 @@ private void InitializeComponent() // btnRun // this.btnRun.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.btnRun.Location = new System.Drawing.Point(190, 746); + this.btnRun.Location = new System.Drawing.Point(321, 3); this.btnRun.Name = "btnRun"; - this.btnRun.Size = new System.Drawing.Size(75, 23); + this.btnRun.Size = new System.Drawing.Size(100, 25); this.btnRun.TabIndex = 9; this.btnRun.Text = "Run"; this.btnRun.UseVisualStyleBackColor = true; - this.btnRun.Click += new System.EventHandler(this.btnRun_Click); + this.btnRun.Click += new System.EventHandler(this.BtnRun_Click); // // txtSICInput // - this.txtSICInput.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.txtSICInput.Location = new System.Drawing.Point(6, 7); + this.txtSICInput.Dock = System.Windows.Forms.DockStyle.Fill; + this.txtSICInput.Location = new System.Drawing.Point(3, 3); this.txtSICInput.Name = "txtSICInput"; - this.txtSICInput.Size = new System.Drawing.Size(469, 472); + this.txtSICInput.Size = new System.Drawing.Size(425, 449); this.txtSICInput.TabIndex = 38; this.txtSICInput.Text = ""; // // txtObjectCode // - this.txtObjectCode.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.txtObjectCode.Location = new System.Drawing.Point(6, 7); + this.txtObjectCode.Dock = System.Windows.Forms.DockStyle.Fill; + this.txtObjectCode.Location = new System.Drawing.Point(3, 3); this.txtObjectCode.Name = "txtObjectCode"; - this.txtObjectCode.Size = new System.Drawing.Size(542, 472); + this.txtObjectCode.Size = new System.Drawing.Size(425, 440); this.txtObjectCode.TabIndex = 39; this.txtObjectCode.Text = ""; // // btnResetProgram // this.btnResetProgram.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.btnResetProgram.Location = new System.Drawing.Point(271, 746); + this.btnResetProgram.Location = new System.Drawing.Point(215, 3); this.btnResetProgram.Name = "btnResetProgram"; - this.btnResetProgram.Size = new System.Drawing.Size(74, 23); + this.btnResetProgram.Size = new System.Drawing.Size(100, 25); this.btnResetProgram.TabIndex = 40; this.btnResetProgram.Text = "Restart"; this.btnResetProgram.UseVisualStyleBackColor = true; - this.btnResetProgram.Click += new System.EventHandler(this.btnResetProgram_Click); + this.btnResetProgram.Click += new System.EventHandler(this.BtnResetProgram_Click); // // tbObjectCode // - this.tbObjectCode.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); this.tbObjectCode.Controls.Add(this.tbSICSymbol); this.tbObjectCode.Controls.Add(this.tbObjCode); - this.tbObjectCode.Location = new System.Drawing.Point(558, 226); + this.tbObjectCode.Dock = System.Windows.Forms.DockStyle.Fill; + this.tbObjectCode.Location = new System.Drawing.Point(678, 203); this.tbObjectCode.Name = "tbObjectCode"; this.tbObjectCode.SelectedIndex = 0; - this.tbObjectCode.Size = new System.Drawing.Size(491, 514); + this.tbObjectCode.Size = new System.Drawing.Size(439, 482); this.tbObjectCode.TabIndex = 41; // // tbSICSymbol // this.tbSICSymbol.Controls.Add(this.txtSICInput); - this.tbSICSymbol.Location = new System.Drawing.Point(4, 22); + this.tbSICSymbol.Location = new System.Drawing.Point(4, 23); this.tbSICSymbol.Name = "tbSICSymbol"; this.tbSICSymbol.Padding = new System.Windows.Forms.Padding(3); - this.tbSICSymbol.Size = new System.Drawing.Size(483, 488); + this.tbSICSymbol.Size = new System.Drawing.Size(431, 455); this.tbSICSymbol.TabIndex = 0; this.tbSICSymbol.Text = "SIC Symbol Table"; this.tbSICSymbol.UseVisualStyleBackColor = true; @@ -902,76 +1024,134 @@ private void InitializeComponent() // tbObjCode // this.tbObjCode.Controls.Add(this.txtObjectCode); - this.tbObjCode.Location = new System.Drawing.Point(4, 22); + this.tbObjCode.Location = new System.Drawing.Point(4, 23); this.tbObjCode.Name = "tbObjCode"; this.tbObjCode.Padding = new System.Windows.Forms.Padding(3); - this.tbObjCode.Size = new System.Drawing.Size(483, 488); + this.tbObjCode.Size = new System.Drawing.Size(431, 446); this.tbObjCode.TabIndex = 1; this.tbObjCode.Text = "SIC Object Code"; this.tbObjCode.UseVisualStyleBackColor = true; // - // contextMenuStrip1 - // - this.contextMenuStrip1.Name = "contextMenuStrip1"; - this.contextMenuStrip1.Size = new System.Drawing.Size(61, 4); - // // btnThreeStep // this.btnThreeStep.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.btnThreeStep.Location = new System.Drawing.Point(109, 746); + this.btnThreeStep.Location = new System.Drawing.Point(109, 3); this.btnThreeStep.Name = "btnThreeStep"; - this.btnThreeStep.Size = new System.Drawing.Size(75, 23); + this.btnThreeStep.Size = new System.Drawing.Size(100, 25); this.btnThreeStep.TabIndex = 9; this.btnThreeStep.Text = "3 Steps"; this.btnThreeStep.UseVisualStyleBackColor = true; - this.btnThreeStep.Click += new System.EventHandler(this.btnThreeStep_Click); - // - // loadObjectFileToolStripMenuItem - // - this.loadObjectFileToolStripMenuItem.Name = "loadObjectFileToolStripMenuItem"; - this.loadObjectFileToolStripMenuItem.Size = new System.Drawing.Size(257, 22); - this.loadObjectFileToolStripMenuItem.Text = "Load Object File"; - this.loadObjectFileToolStripMenuItem.Click += new System.EventHandler(this.loadObjectFileToolStripMenuItem_Click); - // - // Form1 - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.btnThreeStep.Click += new System.EventHandler(this.BtnThreeStep_Click); + // + // tableLayoutPanel1 + // + this.tableLayoutPanel1.ColumnCount = 2; + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 675F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel2, 1, 0); + this.tableLayoutPanel1.Controls.Add(this.tbObjectCode, 1, 1); + this.tableLayoutPanel1.Controls.Add(this.tcMachine, 0, 1); + this.tableLayoutPanel1.Controls.Add(this.gbCPU, 0, 0); + this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel1.GrowStyle = System.Windows.Forms.TableLayoutPanelGrowStyle.FixedSize; + this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 24); + this.tableLayoutPanel1.Name = "tableLayoutPanel1"; + this.tableLayoutPanel1.RowCount = 2; + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 200F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel1.Size = new System.Drawing.Size(1120, 688); + this.tableLayoutPanel1.TabIndex = 42; + // + // tableLayoutPanel2 + // + this.tableLayoutPanel2.AutoSize = true; + this.tableLayoutPanel2.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.tableLayoutPanel2.ColumnCount = 1; + this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.tableLayoutPanel2.Controls.Add(this.flowLayoutPanel2, 0, 1); + this.tableLayoutPanel2.Controls.Add(this.flowLayoutPanel1, 0, 0); + this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel2.GrowStyle = System.Windows.Forms.TableLayoutPanelGrowStyle.FixedSize; + this.tableLayoutPanel2.Location = new System.Drawing.Point(678, 3); + this.tableLayoutPanel2.Name = "tableLayoutPanel2"; + this.tableLayoutPanel2.RowCount = 2; + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 64.25121F)); + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 35.74879F)); + this.tableLayoutPanel2.Size = new System.Drawing.Size(439, 194); + this.tableLayoutPanel2.TabIndex = 43; + // + // flowLayoutPanel2 + // + this.flowLayoutPanel2.AutoSize = true; + this.flowLayoutPanel2.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.flowLayoutPanel2.Controls.Add(this.btnStep); + this.flowLayoutPanel2.Controls.Add(this.btnThreeStep); + this.flowLayoutPanel2.Controls.Add(this.btnResetProgram); + this.flowLayoutPanel2.Controls.Add(this.btnRun); + this.flowLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Bottom; + this.flowLayoutPanel2.Location = new System.Drawing.Point(3, 160); + this.flowLayoutPanel2.Name = "flowLayoutPanel2"; + this.flowLayoutPanel2.Size = new System.Drawing.Size(433, 31); + this.flowLayoutPanel2.TabIndex = 1; + // + // flowLayoutPanel1 + // + this.flowLayoutPanel1.Controls.Add(this.label12); + this.flowLayoutPanel1.Controls.Add(this.lblNextInstruction); + this.flowLayoutPanel1.Controls.Add(this.lblNI_Description); + this.flowLayoutPanel1.Controls.Add(this.lblNextInstruction_Effect); + this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.TopDown; + this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 3); + this.flowLayoutPanel1.Name = "flowLayoutPanel1"; + this.flowLayoutPanel1.Size = new System.Drawing.Size(433, 118); + this.flowLayoutPanel1.TabIndex = 0; + // + // MainWindow + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 14F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1061, 776); - this.Controls.Add(this.tbObjectCode); - this.Controls.Add(this.btnResetProgram); - this.Controls.Add(this.btnRun); - this.Controls.Add(this.btnThreeStep); - this.Controls.Add(this.lblNextInstruction_Effect); - this.Controls.Add(this.lblNI_Description); - this.Controls.Add(this.lblNextInstruction); - this.Controls.Add(this.label12); - this.Controls.Add(this.btnStep); - this.Controls.Add(this.tcMachine); - this.Controls.Add(this.gbCPU); + this.BackColor = System.Drawing.SystemColors.Control; + this.ClientSize = new System.Drawing.Size(1120, 712); + this.Controls.Add(this.tableLayoutPanel1); this.Controls.Add(this.menuStrip1); + this.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MainMenuStrip = this.menuStrip1; - this.Name = "Form1"; + this.MinimumSize = new System.Drawing.Size(1135, 750); + this.Name = "MainWindow"; this.Text = "SIC Virtual Machine"; - this.Load += new System.EventHandler(this.Form1_Load); + this.Load += new System.EventHandler(this.MainWindow_Load); this.gbCPU.ResumeLayout(false); - this.gbCPU.PerformLayout(); + this.tableLayoutPanel3.ResumeLayout(false); + this.tableLayoutPanel3.PerformLayout(); this.menuStrip1.ResumeLayout(false); this.menuStrip1.PerformLayout(); this.tcMachine.ResumeLayout(false); this.tpMemory.ResumeLayout(false); this.tpMemory.PerformLayout(); + this.flowLayoutPanel3.ResumeLayout(false); + this.flowLayoutPanel3.PerformLayout(); this.tpDevices.ResumeLayout(false); this.tpMicroSteps.ResumeLayout(false); this.tbObjectCode.ResumeLayout(false); this.tbSICSymbol.ResumeLayout(false); this.tbObjCode.ResumeLayout(false); + this.tableLayoutPanel1.ResumeLayout(false); + this.tableLayoutPanel1.PerformLayout(); + this.tableLayoutPanel2.ResumeLayout(false); + this.tableLayoutPanel2.PerformLayout(); + this.flowLayoutPanel2.ResumeLayout(false); + this.flowLayoutPanel1.ResumeLayout(false); + this.flowLayoutPanel1.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); } + private System.Windows.Forms.RadioButton rbMemDecimal; + private System.Windows.Forms.RadioButton rbMemAscii; + #endregion private System.Windows.Forms.GroupBox gbCPU; @@ -1053,9 +1233,15 @@ private void InitializeComponent() private System.Windows.Forms.TabPage tbObjCode; private System.Windows.Forms.TabPage tpMicroSteps; private System.Windows.Forms.RichTextBox rtfMicroSteps; - private System.Windows.Forms.ContextMenuStrip contextMenuStrip1; private System.Windows.Forms.Button btnThreeStep; private System.Windows.Forms.ToolStripMenuItem loadObjectFileToolStripMenuItem; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; + private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1; + private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel2; + private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel3; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3; + private System.Windows.Forms.ToolStripMenuItem clearDevicesToolStripMenuItem; } } diff --git a/SICVirtualMachine/View/MainWindow.cs b/SICVirtualMachine/View/MainWindow.cs new file mode 100644 index 0000000..7a6b5a5 --- /dev/null +++ b/SICVirtualMachine/View/MainWindow.cs @@ -0,0 +1,573 @@ +using SICVirtualMachine.Extensions; +using System; +using System.IO; +using System.Media; +using System.Runtime.Serialization.Formatters.Soap; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using System.Globalization; +using SICVirtualMachine.SIC; + +namespace SICVirtualMachine.View +{ + public partial class MainWindow : Form + { + public int LastLoadedStart = 0; + public int LastLoadedLength = 0; + public string LastLoadedFileName = string.Empty; + private int MemorizedLastMemoryWordAddress = 0; + + private CPU SICVirtualMachine; + + public MainWindow() + { + InitializeComponent(); + + tsmAbout_About.Click += new EventHandler(TsmAbout_About_DropDownItemClicked); + tsmzeroAllMemory.Click += new EventHandler(TsmZeroAllMemory_Click); + randomizeAllMemory.Click += new EventHandler(RandomizeAllMemory_Click); + rbMemBinary.Click += new EventHandler(BtnSnd_Click); + rbMemHex.Click += new EventHandler(BtnSnd_Click); + rbMemDecimal.Click += new EventHandler(BtnSnd_Click); + rbMemAscii.Click += new EventHandler(BtnSnd_Click); + SICVirtualMachine = new CPU(true); + } + + private void TsmAbout_About_DropDownItemClicked(object sender, EventArgs e) + { + ToolStripMenuItem menuItem = sender as ToolStripMenuItem; + + switch (menuItem.Text) + { + case "About": + frmAbout fa = new frmAbout(); + fa.ShowDialog(); + break; + + case "Check for Updates": + break; + } + } + + private void TsmZeroAllMemory_Click(object sender, EventArgs e) + { + SICVirtualMachine.ZeroAllMemory(); + RefreshCPUDisplays(); + } + + private void RandomizeAllMemory_Click(object sender, EventArgs e) + { + SICVirtualMachine.RandomizeMemory(); + RefreshCPUDisplays(); + } + + private static string ByteArrayToHexStringViaBitConverter(byte[] bytes) + { + string hex = BitConverter.ToString(bytes); + return hex.Replace("-", ""); + } + + private void TsmSaveMachineState_Click(object sender, EventArgs e) + { + SaveFileDialog sfd = new SaveFileDialog + { + AddExtension = true, + Filter = "SIC VM State Files|*.sicstate" + }; + + if (sfd.ShowDialog() != DialogResult.OK) + { + return; + } + + using (FileStream stream = File.Open(sfd.FileName, FileMode.Create)) + { + SoapFormatter sf = new SoapFormatter(); + sf.Serialize(stream, SICVirtualMachine); + } + + SICVirtualMachine.MachineStateSaved = true; + } + + private void BtnStep_Click(object sender, EventArgs e) + { + if (SICVirtualMachine.PC == -1) + { + MessageBox.Show("Program Stepping Halted. L=0, RSUB, PC = -1", "Program Halted"); + return; + } + + SICVirtualMachine.PerformStep(); + + RefreshCPUDisplays(); + } + + /// + /// Refreshes the memory table whenever the Binary, Hex or Decimal buttons are clicked on + /// Francisco Romero + /// + /// + /// + private void BtnSnd_Click(object sender, EventArgs e) + { + RefreshCPUDisplays(); + } + + private async void RefreshCPUDisplays() + { + await RegRefreshAsync(); + await MemoryRefreshAsync(); + await DeviceRefreshAsync(); + } + + private async Task DeviceRefreshAsync() + { + await Task.Run(() => { }); + for (int i = 0; i < lvDevices.Items.Count; i++) + { // update the sub list views with data found in the device array + lvDevices.Items[i].SubItems[1].Text = SICVirtualMachine.Devices[i].GetWriteBufferASCIIByteString; + } + } + + /// + /// Refreshes Memory Display on background thread. Calls are marshalled to UI thread + /// + private async Task MemoryRefreshAsync() + { + string blob = ByteArrayToHexStringViaBitConverter(SICVirtualMachine.MemoryBytes); + int lineWidth = rbMemBinary.Checked ? 8 : 16; + Func conversion; + + if (rbMemHex.Checked) + { + conversion = (add) => blob.Substring(add * 2, 2); + } + else if (rbMemDecimal.Checked) + { + conversion = (add) => $"{GetValueFromBlob(add):D3}"; + } + else if (rbMemBinary.Checked) + { + conversion = (add) => Convert.ToString(GetValueFromBlob(add), 2).PadLeft(8, '0'); + } + else + { + conversion = (add) => + { + int val = GetValueFromBlob(add); + + return val < 32 ? "." : char.ConvertFromUtf32(val); + }; + } + + StringBuilder sb = new StringBuilder((0x8000 * 2) + 512); + + await Task.Run(() => + { + sb.AppendLine("{\\rtf1 \\ansi "); + sb.AppendLine("{\\colortbl ;\\red0\\green255\\blue0;\\red255\\green255\\blue0;}"); + + for (int add = 0; add < 0x8000; add++) // add = address + { + if (add % lineWidth == 0) + { // prints counters on very left of table + if (add > 0) + { + sb.Append("\\line "); + } + + sb.Append($"{add:X4}:"); + } + + string value = conversion(add); + + if (add >= SICVirtualMachine.PC && add <= SICVirtualMachine.PC + 2) + { // the highlighted section + sb.Append($"\u00A0\\b \\highlight2 {value}\\highlight0 \\b0 \\fs20 "); + } + else // all non highlighted bits + { + sb.Append($" {value}"); + } + } + + sb.Append("}"); + }); + + rtfMemory.Rtf = sb.ToString(); + rtfMicroSteps.Text = SICVirtualMachine.MicrocodeSteps; + + int scrollTo = rtfMemory.Text.IndexOf("\u00A0"); + + rtfMemory.Select(Math.Max(scrollTo, 0), 0); + rtfMemory.ScrollToCaret(); + + int GetValueFromBlob(int address) + { + return int.Parse(blob.Substring(address * 2, 2), NumberStyles.HexNumber); + } + } + + private async Task RegRefreshAsync() + { + await Task.Run(() => { }); //This is bad, but whatever. + txtX_Hex.Text = SICVirtualMachine.X.ToString("X6"); + txtA_Hex.Text = SICVirtualMachine.A.ToString("X6"); + txtL_Hex.Text = SICVirtualMachine.L.ToString("X6"); + txtPC_Hex.Text = SICVirtualMachine.PC.ToString("X6"); + txtSW_Hex.Text = SICVirtualMachine.SW.ToString("X6"); + + txtX_Dec.Text = SICVirtualMachine.X.ToString(); + txtA_Dec.Text = SICVirtualMachine.A.ToString(); + txtL_Dec.Text = SICVirtualMachine.L.ToString(); + txtPC_Dec.Text = SICVirtualMachine.PC.ToString(); + txtSW_Dec.Text = SICVirtualMachine.SW.ToString(); + + // Now do the binary bytes for each register and Status Word + string PC_BIN = SICVirtualMachine.PC.To24BITBinary(); + txtPC_BIN_MSB.Text = PC_BIN.Substring(0, 8); + txtPC_BIN_MIB.Text = PC_BIN.Substring(8, 8); + txtPC_BIN_LSB.Text = PC_BIN.Substring(16); + + string L_BIN = SICVirtualMachine.L.To24BITBinary(); + txtL_BIN_MSB.Text = L_BIN.Substring(0, 8); + txtL_BIN_MIB.Text = L_BIN.Substring(8, 8); + txtL_BIN_LSB.Text = L_BIN.Substring(16); + + string A_BIN = SICVirtualMachine.A.To24BITBinary(); + txtA_BIN_MSB.Text = A_BIN.Substring(0, 8); + txtA_BIN_MIB.Text = A_BIN.Substring(8, 8); + txtA_BIN_LSB.Text = A_BIN.Substring(16); + + string X_BIN = SICVirtualMachine.X.To24BITBinary(); + txtX_BIN_MSB.Text = X_BIN.Substring(0, 8); + txtX_BIN_MIB.Text = X_BIN.Substring(8, 8); + txtX_BIN_LSB.Text = X_BIN.Substring(16); + + string SW_BIN = SICVirtualMachine.SW.To24BITBinary(); + txtSW_BIN_MSB.Text = SW_BIN.Substring(0, 8); + txtSW_BIN_MIB.Text = SW_BIN.Substring(8, 8); + txtSW_BIN_LSB.Text = SW_BIN.Substring(16); + txtSW_CC.Text = txtSW_BIN_LSB.Text.Substring(0, 2); + lblComp_Result.Text = txtSW_BIN_LSB.Text[0] == 49 ? "Greater than" : txtSW_BIN_LSB.Text[1] == 49 ? "Less than" : "Equal"; + + + if (SICVirtualMachine.PC >= 0) + { + var (result, details, effect) = SICVirtualMachine.GetInstructionDescription(SICVirtualMachine.PC); + + lblNextInstruction.Text = result; + lblNI_Description.Text = details; + lblNextInstruction_Effect.Text = effect; + } + else + { + lblNextInstruction.Text = "Program Halted"; + lblNI_Description.Text = "VM Halted by Software Instruction"; + lblNextInstruction_Effect.Text = "VM Halted"; + } + } + + private void LoadSavedSICMachineStateToolStripMenuItem_Click(object sender, EventArgs e) + { + OpenFileDialog ofd = new OpenFileDialog + { + Filter = "SIC VM State Files|*.sicstate", + Multiselect = false + }; + + if (ofd.ShowDialog() == DialogResult.OK) + { + using (FileStream stream = File.Open(ofd.FileName, FileMode.Open)) + { + SoapFormatter osf = new SoapFormatter(); + SICVirtualMachine = (CPU)osf.Deserialize(stream); + } + + // Refresh Memory and Register Displays to Show Saved State + RefreshCPUDisplays(); + } + + SICVirtualMachine.MachineStateSaved = true; + } + + private void TsmSetMemoryBYTE_Click(object sender, EventArgs e) + { + dlgSetMemoryByte SetMemByte = new dlgSetMemoryByte(); + + if (SetMemByte.ShowDialog() != DialogResult.OK) + { + return; + } + + SICVirtualMachine.StoreByte(SetMemByte.MemoryAddress, SetMemByte.ByteValue); + + RefreshCPUDisplays(); + } + + private void SetMemoryWORDToolStripMenuItem_Click(object sender, EventArgs e) + { + dlgSetMemoryWord SetMemWord; + + if (MemorizedLastMemoryWordAddress == 0) + { + SetMemWord = new dlgSetMemoryWord(); + } + else + { + SetMemWord = new dlgSetMemoryWord(MemorizedLastMemoryWordAddress); + } + + if (SetMemWord.ShowDialog() == DialogResult.Cancel) + { + return; + } + + MemorizedLastMemoryWordAddress = SetMemWord.MemoryAddress; + SICVirtualMachine.StoreWord(SetMemWord.MemoryAddress, SetMemWord.WordValue); + + RefreshCPUDisplays(); + } + + private void TsmResetSICVirtualMachine_Click(object sender, EventArgs e) + { + DialogResult result = MessageBox.Show("This will zero all memory locations and reset all registers to zero. Are you sure you want to proceed?", "Confirm", MessageBoxButtons.YesNo); + + if (result == DialogResult.Yes) + { + SICVirtualMachine = new CPU(true); + RefreshCPUDisplays(); + } + } + + private void TsmOpen_SIC_Object_File_Click(object sender, EventArgs e) + { + OpenFileDialog ofd = new OpenFileDialog + { + Filter = "SIC Object Files|*.sic.obj", + Multiselect = false + }; + + if (ofd.ShowDialog() != DialogResult.OK) + { + return; + } + + (int start, int length) last; + using (StreamReader file = new StreamReader(ofd.FileName)) + { + string fileText = file.ReadToEnd(); + + txtObjectCode.Text = fileText; + last = Loader.LoadObjectFileIntoCPU(fileText.Split('\n'), SICVirtualMachine); + } + + LastLoadedStart = last.start; + LastLoadedLength = last.length; + + RefreshCPUDisplays(); + } + + private void TsmloadAndAssembleSICSourceFIle_Click(object sender, EventArgs e) + { + if (loadSICSourceFD.ShowDialog() != DialogResult.OK) + { + return; + } + + Assembler assembler; + + try + { + assembler = new Assembler(loadSICSourceFD.FileName); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message); + return; + } + + if (!string.IsNullOrEmpty(assembler.ObjectCode)) + { + // We need to call the loader, or use the quick loader in this form + // to load the assembled code into memory + + txtSICInput.Text = assembler.InstructionSource; + txtObjectCode.Text = assembler.ObjectCode; + + string[] lines = assembler.ObjectCode.Split('\n'); + var (start, length) = Loader.LoadObjectFileIntoCPU(lines, SICVirtualMachine); + + LastLoadedStart = start; + LastLoadedLength = length; + } + + RefreshCPUDisplays(); // refresh memory after object code is loaded + LastLoadedFileName = Path.GetFileName(loadSICSourceFD.FileName); + } + + private void MainWindow_Load(object sender, EventArgs e) + { + lvDevices.Dock = DockStyle.Fill; + + for (int i = 0; i < CPU.NumDevices; i++) + { //seed list view for devices with 64 items + ListViewItem lvItem = new ListViewItem(string.Format("{0,2:D2}", i)); + + lvItem.SubItems.Add(""); + lvDevices.Items.Add(lvItem); + } + + lvDevices.View = System.Windows.Forms.View.Details; + RefreshCPUDisplays(); + } + + private void TsmFile_Ext_Click(object sender, EventArgs e) + { + if (!SICVirtualMachine.MachineStateSaved) + { + DialogResult stop = MessageBox.Show("The current machine state has not been saved. Do you want to cancel exit and save your machine state?", "Machine State Not Saved", MessageBoxButtons.YesNo); + + if (stop == DialogResult.Yes) + { + return; + } + } + + Application.Exit(); + } + + private void SetProgramCounterToToolStripMenuItem_Click(object sender, EventArgs e) + { + dlgSetRegisterWord SetRegWord = new dlgSetRegisterWord("PC"); + if (SetRegWord.ShowDialog() != DialogResult.OK) + { + return; + } + + SICVirtualMachine.PC = SetRegWord.WordValue; + RefreshCPUDisplays(); + } + + private void BtnRun_Click(object sender, EventArgs e) + { + dlgStopAtMemoryAddress setStop = new dlgStopAtMemoryAddress(LastLoadedFileName, LastLoadedStart, LastLoadedLength); + if (setStop.ShowDialog() != DialogResult.OK) + { + return; + } + + int StopAtPCAddress = setStop.HaltAtMemoryAddress; + while (SICVirtualMachine.PC != StopAtPCAddress) + { + SICVirtualMachine.PerformStep(); + } + + RefreshCPUDisplays(); + } + + private void BtnResetProgram_Click(object sender, EventArgs e) + { + var (start, length) = Loader.LoadObjectFileIntoCPU(txtObjectCode.Text.Split('\n'), SICVirtualMachine); + + LastLoadedStart = start; + LastLoadedLength = length; + + RefreshCPUDisplays(); + } + + private void BtnThreeStep_Click(object sender, EventArgs e) + { + SICVirtualMachine.PerformStep(); + RefreshCPUDisplays(); + SICVirtualMachine.PerformStep(); + RefreshCPUDisplays(); + SICVirtualMachine.PerformStep(); + RefreshCPUDisplays(); + } + + private void LoadObjectFileToolStripMenuItem_Click(object sender, EventArgs e) + { + OpenFileDialog ofd = new OpenFileDialog + { + Filter = "SIC Object Files|*.sic.obj", + Multiselect = false, + Title = "Select SIC Object File" + }; + + if (ofd.ShowDialog() != DialogResult.OK) + { + return; + } + + // we need to open ofd.FileName + // Find out where it was assembled + // Ask for new load location + int newAddress = 0; + int startAddress = 0; + int pLength = 0; + int modRecordCount = 0; + string objectFileName = ofd.FileName; + string programName = string.Empty; + + try + { + string[] lines = File.ReadAllLines(ofd.FileName); + + foreach (string line in lines) + { + if (string.IsNullOrWhiteSpace(line)) + { + continue; + } + + if (line[0] == 'H') + { + // We need to retrieve First address and program size + startAddress = int.Parse(line.Substring(7, 6), NumberStyles.HexNumber); + pLength = int.Parse(line.Substring(13, 6), NumberStyles.HexNumber); + programName = line.Substring(1, 6).TrimEnd(); + //this.SICVirtualMachine.CurrentProgramEndAddress = Int32.Parse(firstAddress, System.Globalization.NumberStyles.HexNumber) + Int32.Parse(programSize, System.Globalization.NumberStyles.HexNumber); + } + if (line[0] == 'M') + { + modRecordCount += 1; + } + } + + } + catch (Exception Ex) + { + MessageBox.Show("There was an error reading the object file you specified: " + Ex.ToString(), "Error Opening Object File"); + return; + } + + dlgRelocateObjectFile relocationDialog = new dlgRelocateObjectFile(programName, startAddress, pLength, modRecordCount); + + if (relocationDialog.ShowDialog() != DialogResult.OK) + { + return; + } + + newAddress = relocationDialog.RelocatedToAddress; + + // Call the loader!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + // Return address (absolute) of first instruction after relocation + // This will be placed in the PC + + //this.SICVirtualMachine.PC = (start value from relocated program code) + } + + private void ClearDevicesToolStripMenuItem_Click(object sender, EventArgs e) + { + for (int i = 0; i < CPU.NumDevices; i++) + { + SICVirtualMachine.Devices[i].Clear(); + } + + RefreshCPUDisplays(); + } + } +} diff --git a/SIC Simulator/Form1.resx b/SICVirtualMachine/View/MainWindow.resx similarity index 99% rename from SIC Simulator/Form1.resx rename to SICVirtualMachine/View/MainWindow.resx index e52b185..1f657ff 100644 --- a/SIC Simulator/Form1.resx +++ b/SICVirtualMachine/View/MainWindow.resx @@ -118,13 +118,13 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - 17, 17 + 26, 26 - 132, 17 + 198, 26 - - 277, 17 + + 143 diff --git a/SIC Simulator/dlgRelocateObjectFile.Designer.cs b/SICVirtualMachine/View/dlgRelocateObjectFile.Designer.cs similarity index 99% rename from SIC Simulator/dlgRelocateObjectFile.Designer.cs rename to SICVirtualMachine/View/dlgRelocateObjectFile.Designer.cs index 30456fe..625b147 100644 --- a/SIC Simulator/dlgRelocateObjectFile.Designer.cs +++ b/SICVirtualMachine/View/dlgRelocateObjectFile.Designer.cs @@ -1,4 +1,4 @@ -namespace SIC_Simulator +namespace SICVirtualMachine.View { partial class dlgRelocateObjectFile { diff --git a/SICVirtualMachine/View/dlgRelocateObjectFile.cs b/SICVirtualMachine/View/dlgRelocateObjectFile.cs new file mode 100644 index 0000000..b34f191 --- /dev/null +++ b/SICVirtualMachine/View/dlgRelocateObjectFile.cs @@ -0,0 +1,83 @@ +using System; +using System.Windows.Forms; + +namespace SICVirtualMachine.View +{ + + + + + + + public partial class dlgRelocateObjectFile : Form + { + public dlgRelocateObjectFile(string ProgramName, int AssembledAddress, int ProgramLength, int MRecords) + { + InitializeComponent(); + + RelocatedToAddress = AssembledAddress; + this.ProgramName = ProgramName; + ProgramLengthInBytes = ProgramLength; + lblProgramName.Text = "Program Name: " + this.ProgramName; + lblProgramLength.Text = "Program Length :" + ProgramLengthInBytes.ToString() + "(hex) bytes"; + txtAssembledStartPoint.Text = AssembledAddress.ToString("X6"); + txtRelocationAddress.Text = AssembledAddress.ToString("X6"); + lblRelocationRecords.Text = "Relocation Records : " + MRecords.ToString(); + + + MaxAddress = 32767 - ProgramLength; + + lblNote.Text = "NOTE: This program cannot be relocated to an address higher than " + MaxAddress.ToString("X6"); + + } + private readonly int MaxAddress = 0; + public int RelocatedToAddress; + public string ProgramName = string.Empty; + public int ProgramLengthInBytes; + + private void btnCancel_Click(object sender, EventArgs e) + { + DialogResult = DialogResult.Cancel; + } + + private void btnOK_Click(object sender, EventArgs e) + { + // Validate Entries + string temp = txtRelocationAddress.Text.Trim(); + int IntValue; + + if (temp.Length == 0) + { + MessageBox.Show("Please specify a relocation address.", "No Relocation Address Specified"); + txtRelocationAddress.Focus(); + return; + } + + IntValue = int.Parse(temp, System.Globalization.NumberStyles.HexNumber); + + + if (IntValue > 32767) + { + MessageBox.Show("The memory address specified is outside of SIC Memory Range", "Invalid Memory Address"); + txtRelocationAddress.Focus(); + return; + } + + if (IntValue > MaxAddress) + { + MessageBox.Show("Invalid relocation. Not enough memory available to relocate this program to " + IntValue.ToString("X6"), "Invalid Memory Address"); + txtRelocationAddress.Focus(); + return; + + } + + + + // If we get here...we are good + + RelocatedToAddress = IntValue; + + DialogResult = DialogResult.OK; + } + } +} diff --git a/SIC Simulator/dlgRelocateObjectFile.resx b/SICVirtualMachine/View/dlgRelocateObjectFile.resx similarity index 100% rename from SIC Simulator/dlgRelocateObjectFile.resx rename to SICVirtualMachine/View/dlgRelocateObjectFile.resx diff --git a/SIC Simulator/dlgSetMemoryByte.Designer.cs b/SICVirtualMachine/View/dlgSetMemoryByte.Designer.cs similarity index 99% rename from SIC Simulator/dlgSetMemoryByte.Designer.cs rename to SICVirtualMachine/View/dlgSetMemoryByte.Designer.cs index ad67b49..da807b7 100644 --- a/SIC Simulator/dlgSetMemoryByte.Designer.cs +++ b/SICVirtualMachine/View/dlgSetMemoryByte.Designer.cs @@ -1,6 +1,6 @@ using System; -namespace SIC_Simulator +namespace SICVirtualMachine.View { partial class dlgSetMemoryByte { diff --git a/SIC Simulator/dlgSetMemoryByte.cs b/SICVirtualMachine/View/dlgSetMemoryByte.cs similarity index 69% rename from SIC Simulator/dlgSetMemoryByte.cs rename to SICVirtualMachine/View/dlgSetMemoryByte.cs index 4d5e473..e5e4fce 100644 --- a/SIC Simulator/dlgSetMemoryByte.cs +++ b/SICVirtualMachine/View/dlgSetMemoryByte.cs @@ -1,14 +1,7 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; -namespace SIC_Simulator +namespace SICVirtualMachine.View { public partial class dlgSetMemoryByte : Form { @@ -23,10 +16,10 @@ public dlgSetMemoryByte() private void btnCancel_Click(object sender, EventArgs e) { - this.DialogResult = DialogResult.Cancel; + DialogResult = DialogResult.Cancel; } - void txtAddressInHex_KeyPress(object sender, KeyPressEventArgs e) + private void txtAddressInHex_KeyPress(object sender, KeyPressEventArgs e) { char c = e.KeyChar; @@ -36,7 +29,7 @@ void txtAddressInHex_KeyPress(object sender, KeyPressEventArgs e) } } - void txtByteValue_KeyPress(object sender, KeyPressEventArgs e) + private void txtByteValue_KeyPress(object sender, KeyPressEventArgs e) { char c = e.KeyChar; @@ -49,7 +42,7 @@ void txtByteValue_KeyPress(object sender, KeyPressEventArgs e) private void btnOK_Click(object sender, EventArgs e) { int IntValue; - String temp = this.txtAddressInHex.Text.Trim(); + string temp = txtAddressInHex.Text.Trim(); if (temp.Length == 0) { @@ -61,7 +54,7 @@ private void btnOK_Click(object sender, EventArgs e) IntValue = int.Parse(temp, System.Globalization.NumberStyles.HexNumber); - if ( txtByteValue.Text.Length != 2) + if (txtByteValue.Text.Length != 2) { MessageBox.Show("The byte value must be two hexadecimal digits", "Invalid Byte Value"); txtByteValue.Focus(); @@ -69,21 +62,21 @@ private void btnOK_Click(object sender, EventArgs e) } - if ( IntValue > 32767 ) + if (IntValue > 32767) { MessageBox.Show("The memory address specified is outside of SIC Memory Range", "Invalid Memory Address"); txtAddressInHex.Focus(); return; - } else { this.MemoryAddress = IntValue; } + } + else { MemoryAddress = IntValue; } - Byte TempB; - temp = this.txtByteValue.Text.Trim(); + byte TempB; + temp = txtByteValue.Text.Trim(); TempB = byte.Parse(temp, System.Globalization.NumberStyles.HexNumber); - this.ByteValue = TempB; - this.DialogResult = DialogResult.OK; - + ByteValue = TempB; + DialogResult = DialogResult.OK; } } } diff --git a/SIC Simulator/dlgSetMemoryByte.resx b/SICVirtualMachine/View/dlgSetMemoryByte.resx similarity index 100% rename from SIC Simulator/dlgSetMemoryByte.resx rename to SICVirtualMachine/View/dlgSetMemoryByte.resx diff --git a/SIC Simulator/dlgSetMemoryWord.Designer.cs b/SICVirtualMachine/View/dlgSetMemoryWord.Designer.cs similarity index 99% rename from SIC Simulator/dlgSetMemoryWord.Designer.cs rename to SICVirtualMachine/View/dlgSetMemoryWord.Designer.cs index f1b2ee1..a23241e 100644 --- a/SIC Simulator/dlgSetMemoryWord.Designer.cs +++ b/SICVirtualMachine/View/dlgSetMemoryWord.Designer.cs @@ -1,4 +1,4 @@ -namespace SIC_Simulator +namespace SICVirtualMachine.View { partial class dlgSetMemoryWord { diff --git a/SIC Simulator/dlgSetMemoryWord.cs b/SICVirtualMachine/View/dlgSetMemoryWord.cs similarity index 68% rename from SIC Simulator/dlgSetMemoryWord.cs rename to SICVirtualMachine/View/dlgSetMemoryWord.cs index 5aae4e8..5ac587e 100644 --- a/SIC Simulator/dlgSetMemoryWord.cs +++ b/SICVirtualMachine/View/dlgSetMemoryWord.cs @@ -1,14 +1,7 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; -namespace SIC_Simulator +namespace SICVirtualMachine.View { public partial class dlgSetMemoryWord : Form { @@ -19,22 +12,22 @@ public dlgSetMemoryWord() InitializeComponent(); } - public dlgSetMemoryWord( int MemorizedAddress) + public dlgSetMemoryWord(int MemorizedAddress) { InitializeComponent(); - this.txtAddressInHex.Text = MemorizedAddress.ToString("X6"); - this.txtWordValue.Focus(); + txtAddressInHex.Text = MemorizedAddress.ToString("X6"); + txtWordValue.Focus(); } private void btnCancel_Click(object sender, EventArgs e) { - this.DialogResult = DialogResult.Cancel; + DialogResult = DialogResult.Cancel; } private void btnOK_Click(object sender, EventArgs e) { int IntValue; - String temp = this.txtAddressInHex.Text.Trim(); + string temp = txtAddressInHex.Text.Trim(); if (temp.Length == 0) { @@ -61,14 +54,14 @@ private void btnOK_Click(object sender, EventArgs e) return; } - else { this.MemoryAddress = IntValue; } + else { MemoryAddress = IntValue; } int TempW; - temp = this.txtWordValue.Text.Trim(); + temp = txtWordValue.Text.Trim(); TempW = int.Parse(temp, System.Globalization.NumberStyles.HexNumber); - this.WordValue = TempW; - this.DialogResult = DialogResult.OK; + WordValue = TempW; + DialogResult = DialogResult.OK; } } } diff --git a/SIC Simulator/dlgSetMemoryWord.resx b/SICVirtualMachine/View/dlgSetMemoryWord.resx similarity index 100% rename from SIC Simulator/dlgSetMemoryWord.resx rename to SICVirtualMachine/View/dlgSetMemoryWord.resx diff --git a/SIC Simulator/dlgSetRegisterWord.Designer.cs b/SICVirtualMachine/View/dlgSetRegisterWord.Designer.cs similarity index 99% rename from SIC Simulator/dlgSetRegisterWord.Designer.cs rename to SICVirtualMachine/View/dlgSetRegisterWord.Designer.cs index 206d489..0fd1bb2 100644 --- a/SIC Simulator/dlgSetRegisterWord.Designer.cs +++ b/SICVirtualMachine/View/dlgSetRegisterWord.Designer.cs @@ -1,4 +1,4 @@ -namespace SIC_Simulator +namespace SICVirtualMachine.View { partial class dlgSetRegisterWord { diff --git a/SIC Simulator/dlgSetRegisterWord.cs b/SICVirtualMachine/View/dlgSetRegisterWord.cs similarity index 57% rename from SIC Simulator/dlgSetRegisterWord.cs rename to SICVirtualMachine/View/dlgSetRegisterWord.cs index a31c424..7778f44 100644 --- a/SIC Simulator/dlgSetRegisterWord.cs +++ b/SICVirtualMachine/View/dlgSetRegisterWord.cs @@ -1,30 +1,23 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; -namespace SIC_Simulator +namespace SICVirtualMachine.View { public partial class dlgSetRegisterWord : Form { public int WordValue = 0; - public dlgSetRegisterWord( String RegisterName) + public dlgSetRegisterWord(string RegisterName) { InitializeComponent(); - this.Text = "Set " + RegisterName + " Word Value"; + Text = "Set " + RegisterName + " Word Value"; } private void btnCancel_Click(object sender, EventArgs e) { - this.DialogResult = DialogResult.Cancel; + DialogResult = DialogResult.Cancel; } private void btnOK_Click(object sender, EventArgs e) @@ -36,13 +29,13 @@ private void btnOK_Click(object sender, EventArgs e) return; } - String temp; + string temp; int TempW; - temp = this.txtWordValue.Text.Trim(); + temp = txtWordValue.Text.Trim(); TempW = int.Parse(temp, System.Globalization.NumberStyles.HexNumber); - this.WordValue = TempW; - this.DialogResult = DialogResult.OK; + WordValue = TempW; + DialogResult = DialogResult.OK; } } } diff --git a/SIC Simulator/dlgSetRegisterWord.resx b/SICVirtualMachine/View/dlgSetRegisterWord.resx similarity index 100% rename from SIC Simulator/dlgSetRegisterWord.resx rename to SICVirtualMachine/View/dlgSetRegisterWord.resx diff --git a/SIC Simulator/dlgStopAtMemoryAddress.Designer.cs b/SICVirtualMachine/View/dlgStopAtMemoryAddress.Designer.cs similarity index 99% rename from SIC Simulator/dlgStopAtMemoryAddress.Designer.cs rename to SICVirtualMachine/View/dlgStopAtMemoryAddress.Designer.cs index c9b43e0..8eb9bc6 100644 --- a/SIC Simulator/dlgStopAtMemoryAddress.Designer.cs +++ b/SICVirtualMachine/View/dlgStopAtMemoryAddress.Designer.cs @@ -1,5 +1,5 @@  -namespace SIC_Simulator +namespace SICVirtualMachine.View { partial class dlgStopAtMemoryAddress { diff --git a/SIC Simulator/dlgStopAtMemoryAddress.cs b/SICVirtualMachine/View/dlgStopAtMemoryAddress.cs similarity index 55% rename from SIC Simulator/dlgStopAtMemoryAddress.cs rename to SICVirtualMachine/View/dlgStopAtMemoryAddress.cs index 11d9e12..b7a7481 100644 --- a/SIC Simulator/dlgStopAtMemoryAddress.cs +++ b/SICVirtualMachine/View/dlgStopAtMemoryAddress.cs @@ -1,31 +1,24 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; -namespace SIC_Simulator +namespace SICVirtualMachine.View { public partial class dlgStopAtMemoryAddress : Form { public int HaltAtMemoryAddress = 0; - public dlgStopAtMemoryAddress( String LastFile, int LastStartAddress, int LastLength) + public dlgStopAtMemoryAddress(string LastFile, int LastStartAddress, int LastLength) { InitializeComponent(); - this.txtLastLoadedFile.Text = LastFile; + txtLastLoadedFile.Text = LastFile; - this.txtLastLoadedStart.Text = LastStartAddress.ToString("X4"); - this.txtLastLoadedLength.Text = LastLength.ToString("X4"); + txtLastLoadedStart.Text = LastStartAddress.ToString("X4"); + txtLastLoadedLength.Text = LastLength.ToString("X4"); int CalculatedEnd; CalculatedEnd = LastStartAddress + LastLength; - this.txtCalculatedHaltingPoint.Text = CalculatedEnd.ToString("X4"); - this.txtAddressInHex.Text = CalculatedEnd.ToString("X4"); + txtCalculatedHaltingPoint.Text = CalculatedEnd.ToString("X4"); + txtAddressInHex.Text = CalculatedEnd.ToString("X4"); } @@ -35,8 +28,8 @@ public dlgStopAtMemoryAddress( String LastFile, int LastStartAddress, int LastLe private void btnOK_Click(object sender, EventArgs e) { - int IntValue =0; - String temp = this.txtAddressInHex.Text.Trim(); + int IntValue = 0; + string temp = txtAddressInHex.Text.Trim(); if (temp.Length == 0) { @@ -55,8 +48,10 @@ private void btnOK_Click(object sender, EventArgs e) return; } - else { this.HaltAtMemoryAddress = IntValue; - this.DialogResult = DialogResult.OK; + else + { + HaltAtMemoryAddress = IntValue; + DialogResult = DialogResult.OK; } @@ -65,7 +60,7 @@ private void btnOK_Click(object sender, EventArgs e) private void btnCancel_Click(object sender, EventArgs e) { - this.DialogResult = DialogResult.Cancel; + DialogResult = DialogResult.Cancel; } } } diff --git a/SIC Simulator/dlgStopAtMemoryAddress.resx b/SICVirtualMachine/View/dlgStopAtMemoryAddress.resx similarity index 100% rename from SIC Simulator/dlgStopAtMemoryAddress.resx rename to SICVirtualMachine/View/dlgStopAtMemoryAddress.resx diff --git a/SIC Simulator/frmAbout.Designer.cs b/SICVirtualMachine/View/frmAbout.Designer.cs similarity index 84% rename from SIC Simulator/frmAbout.Designer.cs rename to SICVirtualMachine/View/frmAbout.Designer.cs index 484cd98..d255211 100644 --- a/SIC Simulator/frmAbout.Designer.cs +++ b/SICVirtualMachine/View/frmAbout.Designer.cs @@ -1,4 +1,4 @@ -namespace SIC_Simulator +namespace SICVirtualMachine.View { partial class frmAbout { @@ -31,7 +31,6 @@ private void InitializeComponent() this.label1 = new System.Windows.Forms.Label(); this.lblVersion = new System.Windows.Forms.Label(); this.btnOk = new System.Windows.Forms.Button(); - this.label4 = new System.Windows.Forms.Label(); this.lvAuthors = new System.Windows.Forms.ListView(); this.colName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.colRole = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); @@ -41,7 +40,7 @@ private void InitializeComponent() // this.label1.AutoSize = true; this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label1.Location = new System.Drawing.Point(332, 22); + this.label1.Location = new System.Drawing.Point(383, 9); this.label1.Margin = new System.Windows.Forms.Padding(8, 0, 8, 0); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(201, 25); @@ -53,7 +52,7 @@ private void InitializeComponent() this.lblVersion.Anchor = System.Windows.Forms.AnchorStyles.Bottom; this.lblVersion.AutoSize = true; this.lblVersion.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblVersion.Location = new System.Drawing.Point(319, 420); + this.lblVersion.Location = new System.Drawing.Point(395, 508); this.lblVersion.Margin = new System.Windows.Forms.Padding(8, 0, 8, 0); this.lblVersion.Name = "lblVersion"; this.lblVersion.Size = new System.Drawing.Size(120, 24); @@ -64,7 +63,7 @@ private void InitializeComponent() // this.btnOk.Anchor = System.Windows.Forms.AnchorStyles.Bottom; this.btnOk.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnOk.Location = new System.Drawing.Point(368, 464); + this.btnOk.Location = new System.Drawing.Point(444, 552); this.btnOk.Name = "btnOk"; this.btnOk.Size = new System.Drawing.Size(96, 34); this.btnOk.TabIndex = 3; @@ -72,16 +71,6 @@ private void InitializeComponent() this.btnOk.UseVisualStyleBackColor = true; this.btnOk.Click += new System.EventHandler(this.btnOk_Click); // - // label4 - // - this.label4.AutoSize = true; - this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label4.Location = new System.Drawing.Point(12, 66); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(87, 24); - this.label4.TabIndex = 4; - this.label4.Text = "Author(s)"; - // // lvAuthors // this.lvAuthors.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) @@ -92,9 +81,9 @@ private void InitializeComponent() this.colRole}); this.lvAuthors.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lvAuthors.HideSelection = false; - this.lvAuthors.Location = new System.Drawing.Point(105, 66); + this.lvAuthors.Location = new System.Drawing.Point(12, 48); this.lvAuthors.Name = "lvAuthors"; - this.lvAuthors.Size = new System.Drawing.Size(674, 341); + this.lvAuthors.Size = new System.Drawing.Size(971, 447); this.lvAuthors.TabIndex = 5; this.lvAuthors.UseCompatibleStateImageBehavior = false; this.lvAuthors.View = System.Windows.Forms.View.Details; @@ -113,10 +102,9 @@ private void InitializeComponent() // this.AutoScaleDimensions = new System.Drawing.SizeF(17F, 33F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(843, 520); + this.ClientSize = new System.Drawing.Size(995, 608); this.ControlBox = false; this.Controls.Add(this.lvAuthors); - this.Controls.Add(this.label4); this.Controls.Add(this.btnOk); this.Controls.Add(this.lblVersion); this.Controls.Add(this.label1); @@ -124,7 +112,7 @@ private void InitializeComponent() this.Margin = new System.Windows.Forms.Padding(8); this.Name = "frmAbout"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "SIC Simulator"; + this.Text = "Authors and Contributors"; this.Load += new System.EventHandler(this.frmAbout_Load); this.ResumeLayout(false); this.PerformLayout(); @@ -136,7 +124,6 @@ private void InitializeComponent() private System.Windows.Forms.Label label1; private System.Windows.Forms.Label lblVersion; private System.Windows.Forms.Button btnOk; - private System.Windows.Forms.Label label4; private System.Windows.Forms.ListView lvAuthors; private System.Windows.Forms.ColumnHeader colName; private System.Windows.Forms.ColumnHeader colRole; diff --git a/SICVirtualMachine/View/frmAbout.cs b/SICVirtualMachine/View/frmAbout.cs new file mode 100644 index 0000000..a5ea511 --- /dev/null +++ b/SICVirtualMachine/View/frmAbout.cs @@ -0,0 +1,51 @@ +using System; +using System.Windows.Forms; + +namespace SICVirtualMachine.View +{ + public partial class frmAbout : Form + { + public frmAbout() + { + InitializeComponent(); + } + + private void frmAbout_Load(object sender, EventArgs e) + { + lvAuthors.Columns.Clear(); + lvAuthors.GridLines = true; + lvAuthors.View = System.Windows.Forms.View.Details; + lvAuthors.Columns.Add("Author(s)", 350, HorizontalAlignment.Left); + lvAuthors.Columns.Add("Contribution(s)", 1600, HorizontalAlignment.Left); + + lvAuthors.Items.Clear(); + + + string[] ScottPLvItems = { "Scott Piersall", "Chief Architect & Lead Developer VM" }; + lvAuthors.Items.Add(new ListViewItem(ScottPLvItems)); + + + string[] RileySLvItems = { "Riley Strickland", "Pass 1 & 2 of SIC Assembler" }; + lvAuthors.Items.Add(new ListViewItem(RileySLvItems)); + + string[] EllisLLvItems = { "Ellis Levine", "Pass 1 & 2 of SIC Assembler" }; + lvAuthors.Items.Add(new ListViewItem(EllisLLvItems)); + + + string[] KrisWLvItems = { "Kris Wieben", "GUI & VM Testing" }; + lvAuthors.Items.Add(new ListViewItem(KrisWLvItems)); + + string[] BrandonWLvItems = { "Brandon Woodrum", "Absolute Loader" }; + lvAuthors.Items.Add(new ListViewItem(BrandonWLvItems)); + + + lblVersion.Text = "Version: " + Application.ProductVersion.ToString(); + } + + + private void btnOk_Click(object sender, EventArgs e) + { + Close(); + } + } +} diff --git a/SIC Simulator/frmAbout.resx b/SICVirtualMachine/View/frmAbout.resx similarity index 100% rename from SIC Simulator/frmAbout.resx rename to SICVirtualMachine/View/frmAbout.resx diff --git a/SICVirtualMachine/packages.config b/SICVirtualMachine/packages.config new file mode 100644 index 0000000..142ece2 --- /dev/null +++ b/SICVirtualMachine/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file