From aee0bba7aa978bf49cde9b0c63931bb2875e5b33 Mon Sep 17 00:00:00 2001 From: Greg Hewgill Date: Sat, 20 Aug 2011 13:59:36 +1200 Subject: [PATCH] add dump memory command --- cpu6502.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cpu6502.py b/cpu6502.py index 52bc32a..3380b5f 100644 --- a/cpu6502.py +++ b/cpu6502.py @@ -335,6 +335,11 @@ class ControlHandler: self.sock.send("ApplePy 6502 core\n") self.buffer = "" + def cmd_dump(self, args): + addr = int(args[1]) + length = int(args[2]) + self.sock.send(" ".join("%02X" % self.cpu.memory.read_byte(self.cpu.cycles, x) for x in range(addr, addr + length)) + "\n") + def cmd_help(self, args): self.sock.send("commands: %s\n" % ", ".join(sorted(x[4:] for x in dir(self) if x.startswith("cmd_"))))