diff --git a/Makefile b/Makefile index 1aa948be..77b6b748 100644 --- a/Makefile +++ b/Makefile @@ -24,7 +24,7 @@ SRC = system syseng sysen1 sysen2 sysen3 sysnet kshack dragon channa \ tensor transl wgd zz graphs lmlib pratt quux scheme gsb ejs mudsys \ draw wl taa tj6 budd sharem ucode rvb kldcp math as imsrc gls demo \ macsym lmcons dmcg hack hibou agb gt40 rug maeda ms kle aap common \ - fonts zork 11logo + fonts zork 11logo kmp DOC = info _info_ sysdoc sysnet syshst kshack _teco_ emacs emacs1 c kcc \ chprog sail draw wl pc tj6 share _glpr_ _xgpr_ inquir mudman system \ xfont maxout ucode moon acount alan channa fonts games graphs humor \ diff --git a/build/misc.tcl b/build/misc.tcl index 3821838c..1eefb9c9 100644 --- a/build/misc.tcl +++ b/build/misc.tcl @@ -194,6 +194,10 @@ expect ":KILL" respond "*" ":midas sys2;ts octpus_gren;octpus\r" expect ":KILL" +# GOTO +respond "*" ":midas sys3;ts goto_kmp; goto\r" +expect ":KILL" + # binprt respond "*" ":midas sys3;ts binprt_sysen1;binprt\r" expect ":KILL" diff --git a/doc/programs.md b/doc/programs.md index e14c5be6..99f9f6d9 100644 --- a/doc/programs.md +++ b/doc/programs.md @@ -95,6 +95,7 @@ - GLPDEV/XGPDEV, device for viewing GLPSPL/XGPSPL printer queues. - GTLEM, GT40 Lunar Lander. - GO, the Go board game. +- GOTO, go to specified terminal line. - GUESS, a very silly game. - GMSGS, copy system messages to mail file. - H3MAKE, a job that requests DRAGON to build host table. diff --git a/src/kmp/goto.12 b/src/kmp/goto.12 new file mode 100644 index 00000000..996251f4 --- /dev/null +++ b/src/kmp/goto.12 @@ -0,0 +1,95 @@ +title LINE -- jump to screen line given by JCL + +a=:1 +b=:2 +ttyo=:4 +ch=:6 +vpos=:10 +jclflg=:11 + +jclbuf: block 20 ; Give us 16. x 5 = 80. chars of JCL space + -1 ; Tell DDT this is end of buffer + +define type &string + movei a,<.length string> + move b,[440700,,[ascii string]] + syscal SIOT,[%climm,,ttyo ? b ? a] + .lose %lsfil +termin + +define syscal op,args +.call [setz ? sixbit /op/ ? args ((setz))] +termin + +line: setzm vpos ; Init vpos to 0 + setzm jclflg ; Make sure loser uses jcl + .break 12,[..RJCL,,JCLBUF] ; Read JCL + move a,[440700,,JCLBUF] ; Init JCLBUF byte-pointer in a + +loop: ildb ch,a ; Load char from JCLBUF into ch + + caie ch,^M ; If char is a Carriage return... + cain ch,^C ; or if char is a Control-C + jrst print ; then done with loop + + caie ch,^@ ; (Also...) If char is a Null + cain ch,^_ ; or if char is a Control-_ + jrst print ; then done with loop + + cail ch,"0 ; If less than 0 + caile ch,"9 ; or greater than 9 + jrst loop ; then retry + + setom jclflg ; Say he used jcl + imuli vpos,10. ; Move it over a bit + addi vpos,-60(ch) ; Add into vpos the new char + + jrst loop ; Loop + +print: syscal OPEN,[ %clbit,,.uao\%tjdis ? %climm,,ttyo ;open TTY for output + [sixbit /TTY/]] + .lose %lsfil + jumpe jclflg,jclwrn + movei a,^P + .iot ttyo,a + movei a,"V + .iot ttyo,a + movei a,10(vpos) + .iot ttyo,a + movei a,^P + .iot ttyo,a + movei a,"H + .iot ttyo,a + movei a,0 + .iot ttyo,a + movei a,^P + .iot ttyo,a + movei a,"L + .iot ttyo,a + .value [ asciz \:KILL \ ] + +die: .logout 1, + +jclwrn: movei a,^P + .iot ttyo,a + movei a,"H + .iot ttyo,a + movei a,0 + .iot ttyo,a + movei a,^P + .iot ttyo,a + movei a,"L + .iot ttyo,a + .value [ asciz \ +.jname/ : Usage is :6type +: :KILL KILL +:jobp +=:if e q +(.jname/ :6type + 45200,,= :6type +) +:v \ ] + jrst die + +end line + \ No newline at end of file