mirror of
https://github.com/mnaberez/py65.git
synced 2025-01-01 11:29:32 +00:00
Assembling now tolerates extra whitespace between opcode and operand
This commit is contained in:
parent
f2fe2492c7
commit
c69ebc34ca
@ -7,6 +7,8 @@
|
||||
- Fixed BRK on 65C02 so it clears the decimal flag. On NMOS 6502, the
|
||||
decimal flag is unaffected on BRK. On 65C02, it is always cleared.
|
||||
|
||||
- Assembling now tolerates extra whitespace between opcode and operand.
|
||||
|
||||
0.17 (2013-10-26)
|
||||
|
||||
- Added support for Python 3.2 and 3.3 based on work by David Beazley.
|
||||
|
@ -145,6 +145,8 @@ class Assembler:
|
||||
and parsing the address part using AddressParser. The result of
|
||||
the normalization is a tuple of two strings (opcode, operand).
|
||||
"""
|
||||
statement = ' '.join(str.split(statement))
|
||||
|
||||
# normalize target in operand
|
||||
match = self.Statement.match(statement)
|
||||
if match:
|
||||
|
@ -15,6 +15,9 @@ class AssemblerTests(unittest.TestCase):
|
||||
self.assertRaises(KeyError,
|
||||
self.assemble, 'lda foo')
|
||||
|
||||
def test_assemble_tolerates_extra_whitespace(self):
|
||||
self.assemble(' lda #$00 ') # should not raise
|
||||
|
||||
def test_assemble_bad_number_raises_overflowerror(self):
|
||||
self.assertRaises(OverflowError,
|
||||
self.assemble, 'lda #$fff')
|
||||
|
Loading…
Reference in New Issue
Block a user