1
0
mirror of https://github.com/mnaberez/py65.git synced 2024-11-18 15:06:35 +00:00

Use same constructor signature for assembler and disassembler.

This commit is contained in:
Mike Naberezny 2009-08-18 21:54:29 -07:00
parent d741fafcf8
commit b063782906
2 changed files with 7 additions and 5 deletions

View File

@ -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

View File

@ -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