diff --git a/README.md b/README.md index 6b7b8209..db326ffb 100644 --- a/README.md +++ b/README.md @@ -134,6 +134,7 @@ There's a [DDT cheat sheet](doc/DDT.md) for Unix users. - SPELL, ESPELL spell checker. - SRCCOM, Compares/merges source files, compares binary files. - STINK, linker. + - STY, pseudo-terminal for multiple sessions. - SUPDUP, Supdup client. - SYSMSG, displays system messages. - TALK/WHO/WHOJ/WHOM/USERS, list users. diff --git a/build/build.tcl b/build/build.tcl index 87f8825c..a050dd3f 100644 --- a/build/build.tcl +++ b/build/build.tcl @@ -810,6 +810,10 @@ respond "*" "nlinks+14/ A,,646471\r" type ":pdump sys1;ts prufd\r" respond "*" ":kill\r" +# STY +respond "*" ":midas sys1;ts sty_sysen2;sty\r" +expect ":KILL" + # ndskdmp tape respond "*" ":link kshack;good ram,.;ram ram\r" respond "*" ":link kshack;ddt bin,.;@ ddt\r" diff --git a/src/sysen2/sty.25 b/src/sysen2/sty.25 new file mode 100644 index 00000000..c979ce9e --- /dev/null +++ b/src/sysen2/sty.25 @@ -0,0 +1,92 @@ +TITLE PSEUDO-TTY HACK + +A=1 +B=2 +C=3 +D=4 +P=17 + +TYI==1 +TYO==2 +PYI==3 +PYO==4 + +GO: MOVEI P,PDL-1 + .SUSET [.SMSK2,,[1_TYI+1_PYI+1_TYO]] + .OPEN TYI,[SIXBIT / $TTY/] + .LOSE %LSFIL + .OPEN TYO,[SIXBIT / %TTY/] + .LOSE %LSFIL + .OPEN PYI,[SIXBIT / STY/] + .LOSE %LSFIL + .OPEN PYO,[SIXBIT / %STY/] + .LOSE %LSFIL + .IOT PYO,[^Z] + JFCL + .HANG ;WAIT, AND WAIT, AND WAIT... + + +ZZ==. +LOC 42 + JSR TSINT +LOC ZZ +TSINT: 0 + 0 + MOVE B,TSINT + TRNE B,1_TYO + PUSHJ P,MORINT + TRNE B,1_TYI + PUSHJ P,INTYI + TRNE B,1_PYI + PUSHJ P,INPYI + .DISMISS TSINT+1 + +INPYI: PUSH P,TSINT+1 + .SUSET [.SDF2,,[1_PYI]] + .SUSET [.SPICLR,,[-1]] +LP: .IOT PYI,C + JUMPL C,OUT ;THAT WASN'T REALLY A CHARACTER + .IOT TYO,C + JRST LP + +CPOPJ: POPJ P, + +INTYI: PUSH P,C + MOVEI C,TYI + .ITYIC C, + JRST POPCJ ;NOT REALLY A CHARACTER THERE + .IOT TYI,C + .IOT PYO,C + JRST POPCJ + +OUT: .SUSET [.SPICLR,,[0]] + .SUSET [.SDF2,,[0]] + POP P,TSINT+1 + POPJ P, + +MORINT: PUSH P,C + MOVEI C,[ASCIZ /--MORE--/] + PUSHJ P,TYPSTR + .IOT TYI,C + PUSH P,C + MOVEI C,[ASCIZ / +/] + PUSHJ P,TYPSTR + POP P,C + CAIE C,40 + CAIN C,177 + CAIA + .IOT PYO,C +POPCJ: POP P,C + POPJ P, + +TYPSTR: HRLI C,440700 +TYPST1: ILDB D,C + JUMPE D,CPOPJ + .IOT TYO,D + JRST TYPST1 + +PDL: BLOCK 50 + +END GO + \ No newline at end of file