1
0
mirror of https://github.com/PDP-10/its.git synced 2026-02-08 17:31:17 +00:00
Files
PDP-10.its/src/sysen3/ttyswp.2
2017-02-19 13:24:17 -08:00

131 lines
1.6 KiB
Groff
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
TITLE TTYSWP
a=1
b=2
c=3
d=4
e=5
f=6
usri==1
jcl: block 16
tty1: -1
tty2: -1
jobnum: 0
start: .break 12,[..rjcl,,jcl]
move a,[440700,,jcl]
numget: setz b,
ildb c,a
jumpe c,doit
cail 3,"0
caile 3,"9
jrst numget+1
nextch: lsh b,3
subi c,"0
ior b,c
ildb c,a
jumpe c,doit
cail c,"0
caile c,"9
skipa
jrst nextch
skipl tty1
jrst .+3
movem b,tty1
jrst numget
movem b,tty2
doit: move a,tty1
jumpl a,detme
tro a,400000
movem a,tty1
.call styget
.lose %lssys
hrrz a,jobnum
tro a,400000
jsr getnam
move c,a
move f,e
move a,tty2
jumpge a,nmytty
.suset [.rtty,,a]
hrli a,0
nmytty: tro a,400000
movem a,tty2
.call styget
.lose %lssys
hrrz a,jobnum
tro a,400000
jsr getnam
move d,a
move b,c
cain b,-1
jrst .+3
.call detach
.lose %lssys
move b,d
cain b,-1
jrst .+6
.call detach
.lose %lssys
move a,tty1
.call attach
.lose %lssys
move 1,tty2
move b,c
move e,f
cain b,-1
jrst .+3
.call attach
.lose %lssys
.value won
detme: .suset [.ruind,,b]
tro 2,400000
.call detach
.lose %lssys
.value won
getnam: 0
cain a,-1
jrst @getnam
.call usropn
.lose %lssys
setz e,
.uset usri,[.rjname,,b]
camn b,[sixbit /hactrn/]
tro e,400000
.close usri,
jrst @getnam
won: asciz /:KILL
:VK
/
detach: setz
sixbit /detach/
%clbit,,20
setz b
attach: setz
sixbit /attach/
%clbtw,,5
b
setz a
usropn: setz
sixbit /open/
%clbit,,10
%climm,,usri
[sixbit /usr/]
a
setzi 0
styget: setz
sixbit /styget/
a
%clout,,jobnum
%clout,,jobnum
setzm jobnum
end start