From d33cc3d1669f3cbfe927b7a9c95723a60c0b4ebb Mon Sep 17 00:00:00 2001 From: Josh Dersch Date: Fri, 12 Oct 2018 16:40:05 -0700 Subject: [PATCH] Fix for boneheaded mistake in disassembler. --- imlac/Processor.cs | 8 ++++---- imlac/System.cs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/imlac/Processor.cs b/imlac/Processor.cs index 394b434..77288af 100644 --- a/imlac/Processor.cs +++ b/imlac/Processor.cs @@ -920,8 +920,8 @@ namespace imlac { string opr = String.Empty; - string[] lowerCodes = { "CLA", "CMA", "STA", "IAC", "COA", "CIA", "CMA, IAC", "CLA, CMA, IAC" }; - string[] upperCodes = { "CLL", "CML", "STL", "ODA", "CLL, CML", "CML, ODA", "CLL, CML", "CLL, CML, ODA" }; + string[] lowerCodes = { "NOP", "CLA", "CMA", "STA", "IAC", "COA", "CIA", "CMA, IAC", "CLA, CMA, IAC" }; + string[] upperCodes = { "", "CLL", "CML", "STL", "ODA", "CLL, CML", "CML, ODA", "CLL, CML", "CLL, CML, ODA" }; // check for two specially named combinations of upper and lower bits: if (Data == 0x9) @@ -943,11 +943,11 @@ namespace imlac } else if (highIndex != 0) { - opr = upperCodes[highIndex - 1]; + opr = upperCodes[highIndex]; } else if (lowIndex != 0) { - opr = lowerCodes[lowIndex - 1]; + opr = lowerCodes[lowIndex]; } } diff --git a/imlac/System.cs b/imlac/System.cs index ca72443..5002d0b 100644 --- a/imlac/System.cs +++ b/imlac/System.cs @@ -584,7 +584,7 @@ namespace imlac throw new InvalidOperationException(String.Format("Start address must be less than the size of system memory ({0}).", Helpers.ToOctal(Memory.Size))); } - ushort endAddress = (ushort)Math.Min(Memory.Size - 1, startAddress + length); + ushort endAddress = (ushort)Math.Min(Memory.Size, startAddress + length); for (ushort address = startAddress; address < endAddress; address++) {