From 5a95c064017c78db1cf138683c43038965f816a7 Mon Sep 17 00:00:00 2001 From: Neil Webber Date: Sat, 18 May 2024 09:08:43 -0500 Subject: [PATCH] test_byteops --- pdptests.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/pdptests.py b/pdptests.py index 9cd1881..1578bf0 100644 --- a/pdptests.py +++ b/pdptests.py @@ -691,6 +691,28 @@ class TestMethods(unittest.TestCase): self.check16(p) self.assertEqual(p.r[2], 1) + def test_byteops(self): + # more tests of various byte operations + # r2 counts test progress + a = InstructionBlock() + a.clr('r2') + a.mov(0o177400, 'r0') + a.tstb('r0') + a.bne('fail') + a.inc('r2') + a.decb('r0') + a.cmp(0o0177777, 'r0') + a.bne('fail') + a.inc('r2') + a.halt() + a.label('fail') + a.halt() + p = self.make_pdp() + instloc = 0o4000 + self.loadphysmem(p, a, instloc) + p.run(pc=instloc) + self.assertEqual(p.r[2], 2) + def test_br(self): # though the bug has been fixed, this is a test of whether # all branch offset values work correctly. Barn door shut...