Neil Webber 2024-04-07 08:55:43 -05:00
parent dfb95bce2e
commit 974674e067

View file

@ -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