Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated SLAVE interface to Type 340 display to correct an obvious bug. #2319

Merged
merged 1 commit into from
Jul 23, 2024

Conversation

eswenson1
Copy link
Member

The value of the timeout was getting overwritten by incorrect code. I was seeing timeout errors while trying to write to the display from SHRDLU. The fix seems to help a lot.

The value of the timeout was getting overwritten by incorrect code.
I was seeing timeout errors while trying to write to the display from
SHRDLU.  The fix seems to help a lot.
@larsbrinkhoff
Copy link
Member

My initial concern was that MOVEI T,100. was overridden by the subsequent MOVEI T,1. Your fix doesn't address that.

However, I now see it's more complicated than that. There is also a MOVEI T,10., and T is used as a loop counter. There's also a second loop nested around that. So now I'm not sure at all what this code is supposed to do, only that there are certainly multiple conflicts around the use of T. We'll have to rethink this, and the fix, a bit.

@eswenson1
Copy link
Member Author

eswenson1 commented Jul 23, 2024

I did fix the overwrite of T -- it no longer does that. What I noted, from another similar sleep loop, in the code, which used the D register for the .sleep argument, was that the T value was supposed to be a loop counter, not the value to be passed to .sleep. So we initialize the loop counter (T) with either 20 (for PDP6) or 100 (for PDP10) and loop (over the .sleep) a maximum of that many times before giving up.

Please see the fragment below:

DISLEEP:
        MOVEI A,DNOOP
        MOVEM A,DFUNCTION
        AOS (P)         ;SKIPS IF SLAVE IS ALIVE AND WELL
        MOVEI T,20.             ;ELSE, NOSKIP AND LEAVE ERROR NUMBER IN A
        SKIPL SIXOPD
         MOVEI T,100.           ;FOR PDP10, WAIT UP TO 3.3 SECONDS
DISLP3:
        MOVEI D,1
        .SLEEP D,               ;[FOR PDP6, UP TO .6 SECS] FOR SLAVE TO RESPOND
        SKIPE A,ERRLOC
DISLP4:  SOSA (P)
          SKIPN DFUNCTION
           POPJ P,
        SOJL T,DISLP4
        JRST DISLP3

There is no longer an overwrite of T (two adjacent MOVEI T, instructions). Now, we load it with 20, and then check to see if we're using a PDP6 or PDP10. If we're using a PDP10, we replace the loop counter with 100. Then we sleep for .3 seconds, check for ERRLOC, and then go back to sleep for .3 seconds, repeatedly until the T register is 0 (decrementing each time through the loop).

@larsbrinkhoff
Copy link
Member

Ok thanks, I understand now and agree with your fix.

@eswenson1 eswenson1 merged commit 847c8eb into master Jul 23, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants