Added test for 'SWAP & N flag #5'
This commit is contained in:
parent
a6eceb1ace
commit
2a8b38bc39
1 changed files with 18 additions and 0 deletions
18
pdptests.py
18
pdptests.py
|
@ -464,6 +464,24 @@ class TestMethods(unittest.TestCase):
|
|||
self.assertEqual(p.physmem[dataloc >> 1], bval)
|
||||
self.assertEqual(p.r[0], ptrloc)
|
||||
|
||||
def test_swab(self):
|
||||
# mostly about testing the N bit which behaves... this way
|
||||
instloc = 0o4000
|
||||
a = InstructionBlock()
|
||||
a.mov(0o377, 'r0')
|
||||
a.swab('r0')
|
||||
a.halt()
|
||||
a.swab('r0')
|
||||
a.halt()
|
||||
p = self.make_pdp()
|
||||
self.loadphysmem(p, a, instloc)
|
||||
p.run(pc=instloc)
|
||||
self.assertEqual(p.r[0], 0o377 << 8)
|
||||
self.assertFalse(p.psw_n)
|
||||
p.run() # resume after first halt
|
||||
self.assertEqual(p.r[0], 0o377)
|
||||
self.assertTrue(p.psw_n)
|
||||
|
||||
def test_unscc(self):
|
||||
# more stuff like test_cc but specifically testing unsigned Bxx codes
|
||||
p = self.make_pdp()
|
||||
|
|
Loading…
Add table
Reference in a new issue