Skip to content

Commit

Permalink
SN - snoop terminal.
Browse files Browse the repository at this point in the history
  • Loading branch information
larsbrinkhoff authored and eswenson1 committed Feb 28, 2017
1 parent 5f2302b commit 167b88f
Show file tree
Hide file tree
Showing 3 changed files with 171 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 4 additions & 0 deletions build/build.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
166 changes: 166 additions & 0 deletions src/sysen3/sn.1
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 167b88f

Please sign in to comment.