diff --git a/CHANGES.txt b/CHANGES.txt index 133b4c3..d42144f 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -3,6 +3,9 @@ Next Release - When using the monitor, the nonblocking character input at $F004 should now work on the Microsoft Windows platform. + - Fixed that relative branch calculations would not use the correct + start address when assembling in the monitor. Closes #10. + 0.6 (2009-08-11) - Added monitor shortcut "a" for "assemble". diff --git a/src/py65/monitor.py b/src/py65/monitor.py index 6e68568..5c1f74c 100644 --- a/src/py65/monitor.py +++ b/src/py65/monitor.py @@ -173,7 +173,7 @@ class Monitor(cmd.Cmd): self._output("Bad label: %s" % start) return - bytes = self._assembler.assemble(statement) + bytes = self._assembler.assemble(statement, start) if bytes is None: self._output("Assemble failed: %s" % statement) else: diff --git a/src/py65/tests/test_monitor.py b/src/py65/tests/test_monitor.py index 0fe5c05..0e5eedf 100644 --- a/src/py65/tests/test_monitor.py +++ b/src/py65/tests/test_monitor.py @@ -59,6 +59,14 @@ class MonitorTests(unittest.TestCase): out = stdout.getvalue() self.assertEqual("Assemble failed: foo\n", out) + def test_do_assemble_passes_addr_for_relative_branch_calc(self): + stdout = StringIO() + mon = Monitor(stdout=stdout) + mon.do_assemble('4000 bvs $4005') + + out = stdout.getvalue() + self.assertEqual("$4000 70 03 BVS $4005\n", out) + def test_help_assemble(self): stdout = StringIO() mon = Monitor(stdout=stdout)