mirror of
https://github.com/mnaberez/py65.git
synced 2025-04-08 19:40:03 +00:00
Flags are now set to 0 on reset.
This commit is contained in:
parent
a5482c1e1b
commit
00e247ecb7
@ -13,6 +13,9 @@ Next Release
|
||||
- MPU objects now return a two-line string as their __repr__ with
|
||||
the processor status register displayed as binary for readability.
|
||||
|
||||
- The processor status register is now initialized to 0 on reset.
|
||||
Previously, its unused bit (bit 5) was set to 1 on reset.
|
||||
|
||||
0.6 (2009-08-11)
|
||||
|
||||
- Added monitor shortcut "a" for "assemble".
|
||||
|
@ -44,7 +44,7 @@ class MPU:
|
||||
"%s: %04x %02x %02x %02x %02x %s"
|
||||
|
||||
return out % (indent, self.name,
|
||||
self.pc, self.a, self.x, self.y, self.pc, flags)
|
||||
self.pc, self.a, self.x, self.y, self.sp, flags)
|
||||
|
||||
def step(self):
|
||||
instructCode = self.ImmediateByte()
|
||||
@ -63,7 +63,7 @@ class MPU:
|
||||
self.a = 0
|
||||
self.x = 0
|
||||
self.y = 0
|
||||
self.flags = self.UNUSED
|
||||
self.flags = 0
|
||||
self.processorCycles = 0
|
||||
|
||||
# Helpers for addressing modes
|
||||
|
@ -6,6 +6,17 @@ import py65.devices.mpu6502
|
||||
class Common6502Tests:
|
||||
"""Tests common to 6502-based microprocessors"""
|
||||
|
||||
# Reset
|
||||
|
||||
def test_reset_sets_registers_to_initial_states(self):
|
||||
mpu = self._make_mpu()
|
||||
mpu.reset()
|
||||
self.assertEquals(0xFF, mpu.sp)
|
||||
self.assertEquals(0, mpu.a)
|
||||
self.assertEquals(0, mpu.x)
|
||||
self.assertEquals(0, mpu.y)
|
||||
self.assertEquals(0, mpu.flags)
|
||||
|
||||
# ADC Absolute
|
||||
|
||||
def test_adc_bcd_off_absolute_carry_clear_in_accumulator_zeroes(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user