From 7f334796e8d0619dc744b1345a7b7b73a27220f9 Mon Sep 17 00:00:00 2001 From: Melodi <62381002+Melodi17@users.noreply.github.com> Date: Sat, 9 Aug 2025 09:45:22 +1000 Subject: added method calling and for loops --- Emulator/Chip/Q1Cpu.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Emulator/Chip') diff --git a/Emulator/Chip/Q1Cpu.cs b/Emulator/Chip/Q1Cpu.cs index 16489e4..ca5ffc8 100644 --- a/Emulator/Chip/Q1Cpu.cs +++ b/Emulator/Chip/Q1Cpu.cs @@ -49,6 +49,10 @@ public partial class Q1Cpu u16 instruction = this.FetchInstruction(out u8 op, out u8 m1, out u8 m2, out _); if (instruction != 0x0101) Console.WriteLine($"CPU.Clock: {pc:X4} | {Disassembler.ParseInstruction(instruction)}"); + for (int i = Q1Layout.StackStart; i < this.SP; i += 2) + { + Console.WriteLine($"Stack value: {this.Bus.ReadWord((u16) i)}"); + } bool ex = m2 > 0; switch (m1, ex) -- cgit v1.3.1