From b063782906275b52b69b6866a494e2a1c18faa8b Mon Sep 17 00:00:00 2001 From: Mike Naberezny Date: Tue, 18 Aug 2009 21:54:29 -0700 Subject: [PATCH] Use same constructor signature for assembler and disassembler. --- src/py65/assembler.py | 5 +---- src/py65/disassembler.py | 7 ++++++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/py65/assembler.py b/src/py65/assembler.py index 2398bcc..b7e2f53 100644 --- a/src/py65/assembler.py +++ b/src/py65/assembler.py @@ -25,16 +25,13 @@ class Assembler: ['imm', re.compile(r'^#\$([0-9A-F]{2})$')] # "#$12" ] - def __init__(self, mpu=None, address_parser=None): + def __init__(self, mpu, address_parser=None): """ If a configured AddressParser is passed, symbolic addresses may be used in the assembly statements. """ if address_parser is None: address_parser = AddressParser() - if mpu is None: - mpu = MPU() - self._mpu = mpu self._address_parser = address_parser diff --git a/src/py65/disassembler.py b/src/py65/disassembler.py index b894f07..f27ca9d 100644 --- a/src/py65/disassembler.py +++ b/src/py65/disassembler.py @@ -1,5 +1,10 @@ +from py65.utils.addressing import AddressParser + class Disassembler: - def __init__(self, mpu, address_parser): + def __init__(self, mpu, address_parser=None): + if address_parser is None: + address_parser = AddressParser() + self._mpu = mpu self._address_parser = address_parser