1
0
mirror of https://github.com/mnaberez/py65.git synced 2024-12-26 17:29:50 +00:00

Merge pull request #80 from patricksurry/issue79

Fix assembly and disassembly of STZ instruction on 65C02

---------

Co-authored-by: Patrick Surry <patrick@hopper.com>
This commit is contained in:
Mike Naberezny 2023-09-12 13:12:26 -07:00 committed by GitHub
commit fa4cf35a34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -167,7 +167,7 @@ class MPU(mpu6502.MPU):
def inst_0x5a(self):
self.stPush(self.y)
@instruction(name="STZ", mode="imp", cycles=3)
@instruction(name="STZ", mode="zpg", cycles=3)
def inst_0x64(self):
self.opSTZ(self.ZeroPageAddr)
self.pc += 1

View File

@ -102,8 +102,8 @@ class Disassembler:
elif addressing == 'zpi':
zp_address = self._mpu.ByteAt(pc + 1)
address_or_label = self._address_parser.label_for(
zp_address, '($' + self.byteFmt % zp_address + ')')
disasm += ' %s' % address_or_label
zp_address, '$' + self.byteFmt % zp_address)
disasm += ' (%s)' % address_or_label
length = 2
elif addressing == 'zpg':

View File

@ -501,8 +501,8 @@ class AssemblerTests(unittest.TestCase):
def test_assembles_64_65c02(self):
mpu = MPU65C02()
self.assertEqual([0x64],
self.assemble('STZ', 0x0000, mpu))
self.assertEqual([0x64, 0x12],
self.assemble('STZ $12', 0x0000, mpu))
def test_assembles_65(self):
self.assertEqual([0x65, 0x44],