From 4b26ab677487701c0cdc9f73d517e4f9aa696808 Mon Sep 17 00:00:00 2001 From: Anton Lydike Date: Sun, 18 Apr 2021 09:33:00 +0200 Subject: [PATCH] added __repr__ to CPU class --- riscemu/CPU.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/riscemu/CPU.py b/riscemu/CPU.py index 0abc740..740456d 100644 --- a/riscemu/CPU.py +++ b/riscemu/CPU.py @@ -372,3 +372,9 @@ class CPU: for method in vars(CPU): if method.startswith('instruction_'): yield method[12:] + + def __repr__(self): + return "CPU(pc=0x{:08X}, cycle={})".format( + self.pc, + self.cycle + ) \ No newline at end of file