From 167b88f646380966920283f24e489e35bcaf0468 Mon Sep 17 00:00:00 2001 From: Lars Brinkhoff Date: Tue, 28 Feb 2017 13:41:18 +0100 Subject: [PATCH] SN - snoop terminal. --- README.md | 1 + build/build.tcl | 4 ++ src/sysen3/sn.1 | 166 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 171 insertions(+) create mode 100644 src/sysen3/sn.1 diff --git a/README.md b/README.md index f6bd846f..d7f59f96 100644 --- a/README.md +++ b/README.md @@ -218,6 +218,7 @@ A list of [known ITS machines](doc/machines.md). - SALV, old file system tool for KA and KL. - SCANDL, TTY OUTPUT SPY. - SEND, REPLY, replacements for DDT :SEND. + - SN, snoop terminal. - SPELL, ESPELL spell checker. - SRCCOM, Compares/merges source files, compares binary files. - STINK, linker. diff --git a/build/build.tcl b/build/build.tcl index 655068a7..f1c79bae 100644 --- a/build/build.tcl +++ b/build/build.tcl @@ -1178,6 +1178,10 @@ expect ":KILL" respond "*" ":midas sys1;ts os_sysen2;os\r" expect ":KILL" +# sn +respond "*" ":midas sys2;ts sn_sysen3;sn\r" +expect ":KILL" + # ttyswp respond "*" ":midas sys;ts ttyswp_sysen3;ttyswp\r" expect ":KILL" diff --git a/src/sysen3/sn.1 b/src/sysen3/sn.1 new file mode 100644 index 00000000..bc9e10d9 --- /dev/null +++ b/src/sysen3/sn.1 @@ -0,0 +1,166 @@ +; -*- midas -*- + +title sn - snoop + +a=1 +b=2 +c=3 +ch=4 + +ttyo=10 +ttyi=11 + + loc 42 + jsr tsint + +beg: .break 12,[..rjcl,,consol] ;43 + move a,[440700,,consol] + setom c +beg0: ildb b,a ;46 + jumpe b,beg1 + cail b,"0 + caile b,"9 + jrst beg1 + skipge c + movei c,0 + lsh c,3 + addi c,-"0(b) + jrst beg0 +beg1: jumpge c,beg2 ;60 + move c,[squoze 0,syscon] + .eval c, + setom c + jumpge c,beg2 + .value [ASCIZ /:KILL :NO SYSTEM CONSOLE? /] +beg2: .open ttyo,[%tjmor+20+.uao,,'TTY] + .value + .open ttyi,[.uii,,'TTY] + .value + .suset [.smask,,[%piioc\%pityi]] + movsi a,-sqtlng +beg3: move b,sqtabl+1(a) ;74 + .eval b, + .value + hrrm b,sqtabl(a) + aos a + aobjn a,beg3 + move a,[-77,,1] + .call corblk + .value + move a,@toop + setom first +lup: jsr getch ;107 + trze b,200 + jrst ctlp + .iot ttyo,b + jrst lup +ctlp: caige b,numctl ;114 + jrst @ctltab(b) + jrst lup + +ctltab: tymov ;117 + tymov1 + tyeeof + tyeeol + tyedlf + tyemtf + tyemtn + tyecrl + tyeeo1 + tyebs + tyelf + tyercr + tyeeo1 + tyeeo1 + tyefs + tymov1 + tyeeo1 +numctl==.-ctltab + +tymov: jsr getch ;140 + movem b,oldv + jsr getch +tymov1: ;143 +tymov2: jsr getch ;143 + came b,oldv + .iot ttyo,[^J] + jsr getch + .iot ttyo,[^P] + .iot ttyo,["H] + addi b,10 + .iot ttyo,b + jrst lup +tyemtf: ;154 +tyemtn: ;154 +tyeeo1: ;154 +tyedlf: ;154 +tyeeof: ;154 +tyeeol: jrst lup ;154 +tyefs: .iot ttyo,[^P] + .iot ttyo,["F] + jrst lup +tyecrl: .iot ttyo,[^M] ;160 +tyelf: .iot ttyo,[^J] ;161 + jrst lup +tyebs: .iot ttyo,[^H] ;163 + jrst lup +tyercr: .iot ttyo,[^M] ;165 + jrst lup + +getch: 0 ;167 + camn a,@tobep + sub a,tobl + aosn first + jrst .+3 + camn a,@toop + .hang + ildb b,a + jrst @getch + +sqtabl: ;200 +toip: 3,,0 ;200 + squoze 0,toip +toop: 3,,0 ;202 + squoze 0,toop +tobep: 3,,0 ;204 + squoze 0,tobep +tobl: 0,,0 ;206 + squoze 0,tobl +sqtlng==<.-sqtabl>_-1 + +corblk: setz ;210 + sixbit /corblk/ + movei %cbred + movei %jself + a + setzi 400000 + +tsint: 0 ;216 + 0 + exch a,tsint +tsin1: trze a,400 ;221 + jrst [aos tsint+1 + jrst intret] + trze a,1 + jrst [movei ch,ttyi + .ityic ch, + jrst intret + caie ch,32 + jrst valrt + jrst intret] + .value [ASCIZ /:UNKNOWN INTERRUPT? /] +intret: jumpn a,tsin1 ;226 + move a,tsint + .dismis tsint+1 +valrt: .iot ttyi,ch ;231 + caie ch,^L + jrst valrt1 + .iot ttyo,[^P] + .iot ttyo,["C] +valrt1: .break 16,140000 ;236 + +consol: 0 ;237 +first: 0 ;240 +oldv: 0 ;241 + +end beg