From 974674e067af51e854aa5f0c6779a779ddcee0c5 Mon Sep 17 00:00:00 2001 From: Neil Webber Date: Sun, 7 Apr 2024 08:55:43 -0500 Subject: [PATCH] Test for https://github.com/outofmbufs/python-pdp11-emulator/issues/14 --- pdptests.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/pdptests.py b/pdptests.py index 68bd61a..04b02ec 100644 --- a/pdptests.py +++ b/pdptests.py @@ -24,6 +24,7 @@ from types import SimpleNamespace import breakpoints as BKP from machine import PDP1170 +from kl11 import KL11 from branches import BRANCH_CODES from pdptraps import PDPTraps import unittest @@ -1695,6 +1696,22 @@ class TestMethods(unittest.TestCase): with self.subTest(i=i, val=val): self.assertEqual(val, p.physmem[recbase + i]) + def test_kl11_bytewrite(self): + # Test for + # https://github.com/outofmbufs/python-pdp11-emulator/issues/14 + # byte writes to KL11 transmit buffer need to work. + p = self.make_pdp() + p.associate_device(KL11(p.ub), 'KL') # console + startaddr = 0o4000 + a = InstructionBlock() + a.clr('r0') # will be incremented to show success + a.movb(13, a.ptr(0o177566)) + a.inc('r0') # r0 will be 1 if the movb worked + a.halt() + self.loadphysmem(p, a, startaddr) + p.run(pc=startaddr) + self.assertEqual(p.r[0], 1) + def test_breakpoints1(self): # test the steps=N breakpoint capability