From 9979938787faa6628b99dfeaa9f19ab0ada5147c Mon Sep 17 00:00:00 2001 From: gatuno Date: Mon, 14 Jun 2021 16:29:02 +0000 Subject: [PATCH] More documentation on InstructionDisassembler --- Gear/EmulationCore/InstructionDisassembler.cs | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/Gear/EmulationCore/InstructionDisassembler.cs b/Gear/EmulationCore/InstructionDisassembler.cs index 0b6c925..560b579 100644 --- a/Gear/EmulationCore/InstructionDisassembler.cs +++ b/Gear/EmulationCore/InstructionDisassembler.cs @@ -28,11 +28,13 @@ namespace Gear.EmulationCore { /// @brief Provides a method for creating the string equivalent of a propeller operation. public static class InstructionDisassembler - { - static InstructionDisassembler() - { - } - + { + /// @brief Default static constructor + static InstructionDisassembler() { } + + /// @brief Translate to text the bytecode opcodes. + /// @param Operation Bytecode opcodes. + /// @return Explicative text from decoded bytecode. public static string AssemblyText(uint Operation) { Assembly.ParsedInstruction instr = new Assembly.ParsedInstruction(Operation); @@ -95,7 +97,7 @@ public static string AssemblyText(uint Operation) return text; } - private static string GetEffectCode(Propeller.MemoryManager memory, bool useShortOpcodes) + private static string GetUsingCode(Propeller.MemoryManager memory, bool useShortOpcodes) { Spin.ParsedAssignment ParsedAssignment = new Spin.ParsedAssignment(memory.ReadByte()); @@ -137,7 +139,7 @@ public static string GetMemoryOp(Propeller.MemoryManager memory, bool useShortOp case Propeller.Spin.MemoryAction.POP: return String.Format("POP {0}", Name); case Propeller.Spin.MemoryAction.EFFECT: - return String.Format("EFFECT {0} {1}", Name, GetEffectCode(memory, useShortOpcodes)); + return String.Format("USING {0} {1}", Name, GetUsingCode(memory, useShortOpcodes)); default: return String.Format("UNKNOWN_{0} {1}", OP.Action, Name); } @@ -166,9 +168,9 @@ public static string InterpreterText(Propeller.MemoryManager memory, bool displa case Propeller.Spin.ArgumentMode.UnsignedOffset: return String.Format(format, Name, DataUnpacker.GetPackedOffset(memory)); case Propeller.Spin.ArgumentMode.UnsignedEffectedOffset: - return String.Format("{0} {1} {2}", Name, DataUnpacker.GetPackedOffset(memory), GetEffectCode(memory, useShortOpcodes)); + return String.Format("{0} {1} {2}", Name, DataUnpacker.GetPackedOffset(memory), GetUsingCode(memory, useShortOpcodes)); case Propeller.Spin.ArgumentMode.Effect: - return String.Format(format, Name, GetEffectCode(memory, useShortOpcodes)); + return String.Format(format, Name, GetUsingCode(memory, useShortOpcodes)); case Propeller.Spin.ArgumentMode.SignedOffset: return String.Format(format, Name, DataUnpacker.GetSignedOffset(memory)); case Propeller.Spin.ArgumentMode.PackedLiteral: