From 173b40a809d54821e349aedda987b254592f8f9d Mon Sep 17 00:00:00 2001 From: Mike Naberezny Date: Mon, 9 Feb 2015 21:31:26 -0800 Subject: [PATCH] Fix ``py65mon --rom`` on Python 3. Closes #28 --- CHANGES.txt | 2 ++ py65/monitor.py | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index 026978b..d7e0f2f 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,5 +1,7 @@ 0.22 (Next Release) + - Fixed a bug where ``py65mon --rom`` would raise an exception + on Python 3. 0.21 (2015-02-09) diff --git a/py65/monitor.py b/py65/monitor.py index 42d060b..e92193d 100644 --- a/py65/monitor.py +++ b/py65/monitor.py @@ -598,7 +598,9 @@ class Monitor(cmd.Cmd): if len(split) == 2: if split[1] == "top": # load a ROM to top of memory - start = self.addrMask - len(bytes) / int(self.byteWidth / 8) + 1 + top_address = self.addrMask + program_size = len(bytes) // (self.byteWidth // 8) + start = top_address - program_size + 1 else: start = self._address_parser.number(split[1]) else: