diff --git a/src/py65/monitor.py b/src/py65/monitor.py index fa6bc92..80966aa 100644 --- a/src/py65/monitor.py +++ b/src/py65/monitor.py @@ -328,7 +328,11 @@ class Monitor(cmd.Cmd): start += bytes def do_disassemble(self, args): - start, end = self._address_parser.range(args) + split = shlex.split(args) + if len(split) != 1: + return self.help_disassemble() + + start, end = self._address_parser.range(split[0]) if start == end: end += 1 @@ -350,6 +354,7 @@ class Monitor(cmd.Cmd): def help_disassemble(self): self._output("disassemble ") self._output("Disassemble instructions in the address range.") + self._output('Range is specified like ":".') def help_step(self): self._output("step") diff --git a/src/py65/tests/test_monitor.py b/src/py65/tests/test_monitor.py index 496cc3c..bf8d508 100644 --- a/src/py65/tests/test_monitor.py +++ b/src/py65/tests/test_monitor.py @@ -246,6 +246,20 @@ class MonitorTests(unittest.TestCase): out = stdout.getvalue() self.assertTrue(out.startswith('disassemble')) + def test_help_disassemble(self): + stdout = StringIO() + mon = Monitor(stdout=stdout) + mon.help_disassemble() + out = stdout.getvalue() + self.assertTrue(out.startswith('disassemble ')) + + def test_disassemble_shows_help_when_given_extra_args(self): + stdout = StringIO() + mon = Monitor(stdout=stdout) + mon.do_disassemble("c000 c001") + out = stdout.getvalue() + self.assertTrue(out.startswith('disassemble ')) + # fill def test_shortcut_f_for_fill(self):