mirror of
https://github.com/mnaberez/py65.git
synced 2024-12-26 02:29:21 +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:
commit
fa4cf35a34
@ -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
|
||||
|
@ -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':
|
||||
|
@ -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],
|
||||
|
Loading…
Reference in New Issue
Block a user