From 0039b064659136aa467e71b10171dedea1e339dc Mon Sep 17 00:00:00 2001 From: Adrian Conlon <98398945+AdrianConlon@users.noreply.github.com> Date: Sun, 30 Jun 2024 15:06:46 +0100 Subject: [PATCH] Couple of hacked Z80 disassembler changes --- Z80/Disassembler.cs | 8 ++++++++ Z80/Z80.FuseTest/TestRunner.cs | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/Z80/Disassembler.cs b/Z80/Disassembler.cs index 75a8a40..1b6ef31 100644 --- a/Z80/Disassembler.cs +++ b/Z80/Disassembler.cs @@ -222,6 +222,14 @@ namespace EightBit case 1: switch (z) { + case 0: + specification = $"IN {this.R(y)}, (C)"; + break; + + case 1: + specification = $"OUT (C), {this.R(y)}"; + break; + case 2: switch (q) { diff --git a/Z80/Z80.FuseTest/TestRunner.cs b/Z80/Z80.FuseTest/TestRunner.cs index 1257b34..9221042 100644 --- a/Z80/Z80.FuseTest/TestRunner.cs +++ b/Z80/Z80.FuseTest/TestRunner.cs @@ -33,12 +33,14 @@ namespace Fuse private readonly EightBit.Ram ram = new EightBit.Ram(0x10000); private readonly EightBit.InputOutput ports = new EightBit.InputOutput(); private readonly EightBit.Z80 cpu; + private readonly EightBit.Disassembler disassembler; private int totalCycles = 0; public TestRunner(Test test, Result result) { this.cpu = new EightBit.Z80(this, this.ports); + this.disassembler = new EightBit.Disassembler(this); this.test = test ?? throw new ArgumentNullException(nameof(test)); this.result = result ?? throw new ArgumentNullException(nameof(result)); @@ -388,6 +390,10 @@ namespace Fuse var output = $"**** IM, Expected: {expectedState.IM}, Got: {this.cpu.IM}"; System.Console.Error.WriteLine(output); } + + this.cpu.PC.Word = this.test.RegisterState.Registers[(int)Register.PC].Word; + var disassembled = this.disassembler.Disassemble(this.cpu); + System.Console.Error.WriteLine(disassembled); } }