1
0
mirror of https://github.com/PDP-10/its.git synced 2026-01-28 12:59:20 +00:00

SN - snoop terminal.

This commit is contained in:
Lars Brinkhoff
2017-02-28 13:41:18 +01:00
committed by Eric Swenson
parent 5f2302bd74
commit 167b88f646
3 changed files with 171 additions and 0 deletions

166
src/sysen3/sn.1 Normal file
View File

@@ -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