Question about completion pulse

18 views
Skip to first unread message

Bill E

unread,
Nov 8, 2025, 3:45:38 PM (4 days ago) Nov 8
to [PiDP-1]
Probably Angelo is the one to answer -
I've seen reference to IOT 0 being a wait-for-completion-pulse. It's mentioned in the PDP-1 handbook, but missing from other docs. It seems quite useful now that added IOTs can
use it.

The question - from a glance at the pdp1.c code, doesn't seem to be implemented.
Should be pretty trivial except the code doesn't appear to distinguish between 'wait' and 'need completion pulse', both seem to block.
But I haven't dug into the code to be sure, don't wan tto make even more changes to the core code unless I have to.

The use case is that an IOT request can be made and instead of blocking in a wait,
it can return and later set the completion flag. The program can block when it wants
to by using the IOT 0 instruction.

Bill

Angelo Papenhoff/aap

unread,
Nov 8, 2025, 5:35:48 PM (4 days ago) Nov 8
to [PiDP-1]
I find the completion pulse logic a bit hard to understand but the emulator should have it implemented correctly:
iot_pulse() has an argument nac, that holds whether we Need A Completion pulse for this IOT, and its up to the device
to implement it correctly. When the device is done and the per-device NAC flip-flop is set, IOS should be set, which tells the cpu
to stop waiting for IO and resume execution. The logic for the latter is all in the cpu and should work as expected. You only have to set
IOS under the right conditions (IO done and NAC was set).

NAC is indeed set in two cases, which has to do with non-waiting IO. This is the more confusing part.
If you don't wait you still may want to synchronize with the device. In this case you do something like `tyo-i` to
type out a character asychronously but still expecting a completion pulse. `iot i` then does the waiting for the
completion pulse. I'm pretty sure this `iot i` does not work if the completion pulse has already happened. In fact,
due to a timing bug in my emulator the tyo-completion pulse came earlier than MACRO expected which caused it
to hang (now fixed of course).

Bill E

unread,
Nov 8, 2025, 6:54:48 PM (4 days ago) Nov 8
to [PiDP-1]
Thanks for the prompt reply!
The dynamic IOT support logic lets an IOT issue IOS when a wait is to be cleared, so it should work with the deferred completion pulse also.
I have a current use case, so I'll let you know how it works out. Not sure about how to handle the completion pulse before iot i case, though, other than telling a user to do a status call first. But of course,
that isn't atomic, the completion pulse could come in between the status check and the iot i. A problem for later.

Bill
Reply all
Reply to author
Forward
0 new messages