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:
parent
d741fafcf8
commit
b063782906
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user