mirror of
https://github.com/mnaberez/py65.git
synced 2025-04-06 04:41:09 +00:00
Removed duplicates.
This commit is contained in:
parent
9876bdb8fa
commit
97c024ae0d
@ -3744,66 +3744,6 @@ class Common6502Tests:
|
||||
|
||||
# SBC Indirect, Indexed (X)
|
||||
|
||||
def test_sbc_ind_x_all_zeros_and_no_borrow_is_zero(self):
|
||||
mpu = self._make_mpu()
|
||||
mpu.flags &= ~(mpu.DECIMAL)
|
||||
mpu.flags |= mpu.CARRY # borrow = 0
|
||||
mpu.a = 0x00
|
||||
self._write(mpu.memory, 0x0000, (0xE1, 0x10)) #=> SBC ($10,X)
|
||||
self._write(mpu.memory, 0x0013, (0xED, 0xFE)) #=> Vector to $FEED
|
||||
mpu.x = 0x03
|
||||
mpu.memory[0xFEED] = 0x00
|
||||
mpu.step()
|
||||
self.assertEquals(0x00, mpu.a)
|
||||
self.assertEquals(0, mpu.flags & mpu.NEGATIVE)
|
||||
self.assertEquals(mpu.CARRY, mpu.CARRY)
|
||||
self.assertEquals(mpu.ZERO, mpu.flags & mpu.ZERO)
|
||||
|
||||
def test_sbc_ind_x_downto_zero_no_borrow_sets_z_clears_n(self):
|
||||
mpu = self._make_mpu()
|
||||
mpu.flags &= ~(mpu.DECIMAL)
|
||||
mpu.flags |= mpu.CARRY # borrow = 0
|
||||
mpu.a = 0x01
|
||||
self._write(mpu.memory, 0x0000, (0xE1, 0x10)) #=> SBC ($10,X)
|
||||
self._write(mpu.memory, 0x0013, (0xED, 0xFE)) #=> Vector to $FEED
|
||||
mpu.x = 0x03
|
||||
mpu.memory[0xFEED] = 0x01
|
||||
mpu.step()
|
||||
self.assertEquals(0x00, mpu.a)
|
||||
self.assertEquals(0, mpu.flags & mpu.NEGATIVE)
|
||||
self.assertEquals(mpu.CARRY, mpu.CARRY)
|
||||
self.assertEquals(mpu.ZERO, mpu.flags & mpu.ZERO)
|
||||
|
||||
def test_sbc_ind_x_downto_zero_with_borrow_sets_z_clears_n(self):
|
||||
mpu = self._make_mpu()
|
||||
mpu.flags &= ~(mpu.DECIMAL)
|
||||
mpu.flags &= ~(mpu.CARRY) # borrow = 1
|
||||
mpu.a = 0x01
|
||||
self._write(mpu.memory, 0x0000, (0xE1, 0x10)) #=> SBC ($10,X)
|
||||
self._write(mpu.memory, 0x0013, (0xED, 0xFE)) #=> Vector to $FEED
|
||||
mpu.x = 0x03
|
||||
mpu.memory[0xFEED] = 0x00
|
||||
mpu.step()
|
||||
self.assertEquals(0x00, mpu.a)
|
||||
self.assertEquals(0, mpu.flags & mpu.NEGATIVE)
|
||||
self.assertEquals(mpu.CARRY, mpu.CARRY)
|
||||
self.assertEquals(mpu.ZERO, mpu.flags & mpu.ZERO)
|
||||
|
||||
def test_sbc_ind_x_downto_four_with_borrow_clears_z_n(self):
|
||||
mpu = self._make_mpu()
|
||||
mpu.flags &= ~(mpu.DECIMAL)
|
||||
mpu.flags &= ~(mpu.CARRY) # borrow = 1
|
||||
mpu.a = 0x07
|
||||
self._write(mpu.memory, 0x0000, (0xE1, 0x10)) #=> SBC ($10,X)
|
||||
self._write(mpu.memory, 0x0013, (0xED, 0xFE)) #=> Vector to $FEED
|
||||
mpu.x = 0x03
|
||||
mpu.memory[0xFEED] = 0x02
|
||||
mpu.step()
|
||||
self.assertEquals(0x04, mpu.a)
|
||||
self.assertEquals(0, mpu.flags & mpu.NEGATIVE)
|
||||
self.assertEquals(0, mpu.flags & mpu.ZERO)
|
||||
self.assertEquals(mpu.CARRY, mpu.CARRY)
|
||||
|
||||
def test_sbc_ind_x_all_zeros_and_no_borrow_is_zero(self):
|
||||
mpu = self._make_mpu()
|
||||
mpu.flags &= ~(mpu.DECIMAL)
|
||||
|
Loading…
x
Reference in New Issue
Block a user