Trailing-Edge
-
PDP-10 Archives
-
BB-H348C-RM_1982
-
swskit-v21/nvt/11host.mac
There is 1 other file named 11host.mac in the archive. Click here to see a list.
.TITLE HOST - CONNECT TI: TO OTHER HOST
.IDENT /003010/
.MCALL CONB$$,CRBDF$,CNBDF$,NSSYM$,ISTAT$,STATE$,TRAN$
.MCALL OPNW$S,CONW$S,REC$S,SND$S,CLS$S
.MCALL DIR$,GMCR$,ASTX$S,DSAR$S,ENAR$S,GPRT$S,SPND$S,EXIT$S
.MCALL ALUN$S,CLEF$S,SETF$S,WTSE$S,QIOW$S,QIO$S
CRBDF$
CNBDF$
NSSYM$
.MACRO ERROR MSG
MOV #'MSG,R0
JMP ERROR
.ENDM ERROR
.MACRO MESSAGE LINE
.NCHR $$$LNG,<LINE>
.ASCII <$$$LNG>\'LINE'\
.ENDM MESSAGE
.MACRO PUSH LIST
.IRP .L,<LIST>
MOV .L,-(SP)
.ENDR
.ENDM PUSH
.MACRO POP LIST
.IRP .L,<LIST>
MOV (SP)+,.L
.ENDR
.ENDM POP
.PSECT POOL,D
AVAIL: .WORD POOL,0
POOL: .WORD 0,POOLNG
.PSECT
;+
; COMMAND LINE PARSER STATE TABLES
;-
ISTAT$ .MCRST,.MCRKW
STATE$
TRAN$ $STRNG ; THE MCR COMMAND.
STATE$
TRAN$ $EOS,$EXIT ; END OF COMMAND
TRAN$ $BLANK ; OR SEPERATOR.
STATE$
TRAN$ $STRNG,,SETNOD ; THE NODE NAME
STATE$ SWTS ; SCAN FOR SWITCHES
TRAN$ $EOS,$EXIT
TRAN$ <'/>
STATE$
TRAN$ !SWTESC,SWTS
TRAN$ !SWTPAU,SWTS
STATE$ SWTESC
TRAN$ "ESCAPE"
STATE$
TRAN$ <':>
STATE$
TRAN$ $NUMBR,$EXIT,SETESN
TRAN$ $ANY,$EXIT,SETESC
STATE$ SWTPAU
TRAN$ "PAUSE"
STATE$
TRAN$ <':>
STATE$
TRAN$ $NUMBR,$EXIT,SETPAN
TRAN$ $ANY,$EXIT,SETPAU
STATE$
.PAGE
;+
; COMMAND PARSER ACTION ROUTINES
;-
.PSECT POOL,D
SETNOD: MOV #6,R0 ; MAX NODE NAME LENGTH.
CMP R0,.PSTCN ; IF NODE NAME TOO LONG
BLO 90$ ; THEN REJECT.
MOV #N.RND+6+SERVER,R1 ; OTHERWISE
10$: MOVB #' ,-(R1) ; CLEAR OUT THE FIELD
SOB R0,10$
MOV .PSTPT,R2 ; AND
MOV .PSTCN,R0
20$: MOVB (R2)+,(R1)+ ; INSERT USER'S NAME.
SOB R0,20$
RETURN
90$: ADD #2,(SP)
RETURN
SETESN: MOVB .PNUMB,ESCAPE
RETURN
SETESC: MOVB .PCHAR,ESCAPE
RETURN
SETPAN: MOVB .PNUMB,PAUSE
RETURN
SETPAU: MOVB .PCHAR,PAUSE
RETURN
.PSECT DATA,D
PAUSE: .BYTE 'X-100
STATUS: .BYTE 0 ; STATUS SWITCHES:
DET = 001 ; DETACH TERMINAL
CLS = 002 ; CLOSE THE LINK
ABT = 004 ; NOTIFY OF LINK ABORT
PAU = 010 ; PAUSE THE PROGRAM
EXT = 020 ; EXIT THE PROGRAM
ESCAPE: .BYTE 'Y-100
BELL: .BYTE 7
TTYBF: .WORD 0,TTYBF
RECLN: .WORD 100.
.PSECT POOL,D
SERVER: CONB$$ TOPS20,310,0
IOSTA: .BLKW 2
MCR: GMCR$
.PSECT POOL,D
NONET: MESSAGE <HOS -- NETWORK NOT ACCESSABLE>
SYNTAX: MESSAGE <HOS -- COMMAND SYNTAX ERROR>
NONODE: MESSAGE <HOS -- TARGET NODE NOT AVAILABLE>
NOSRV: MESSAGE <HOS -- TARGET SERVER NOT AVAILABLE>
NETERR: MESSAGE <HOS -- NETWORK ERROR ON CONNECT: XXX,XXX>
.EVEN
.PSECT TEXT,D
BYE: MESSAGE <HOS -- TARGET SYSTEM HAS DISCONNECTED>
.PSECT POOL,D
START: ALUN$S #1,#"NS,#0
ALUN$S #2,#"NS,#0
OPNW$S #1,#1,#IOSTA
BCS 101$
TSTB IOSTA
BMI 101$
DIR$ #MCR ; GET MCR COMMAND LINE.
BCS 10$ ; IF ONE IS AVAILABLE
MOV #.MCRST,R5 ; THEN
MOV #G.MCRB+MCR,R4 ; PARSE THE COMMAND LINE
MOVB $DSW,R3
MOV #.MCRKW,R2
MOV #3*400+1,R1
CALL .TPARS ; IF SYNTAX ERROR
BCS 102$ ; THEN NOTIFY USER.
10$: DSAR$S
MOV #IOSTA,R5
CONW$S #2,#1,R5,#RECINI,<#SERVER,#N.RQL>
BCS 103$
TSTB (R5)
BMI 103$
JMP ATTCH
101$: ERROR NONET ; NO NETWORK
102$: ERROR SYNTAX ; COMMAND SYNTAX ERROR
103$: CMPB #IE.NRJ,(R5)
BNE 104$
CMPB #NE$NOD,2(R5)
BEQ 105$
CMPB #NE$UOB,2(R5)
BEQ 106$
104$: MOV #NETERR,R0
MOVB (R5),R1
CALL BYTE
MOVB 2(R5),R1
CALL BYTE
ERROR NETERR ; NETWORK ERROR
105$: ERROR NONODE ; NODE NOT AVAILABLE
106$: ERROR NOSRV ; SERVER NOT AVAILABLE
BYTE: CMPB #'X,(R0)+
BNE BYTE
DEC R0
MOV #20114,R2
1$: ASLB R1
ROLB R2
BCC 1$
MOVB R2,(R0)+
CLRB R2
BISB #23,R2
ASL R2
BCC 1$
RETURN
.PSECT CODE,I
GONE: MOV #BYE,R0
ERROR: MOVB (R0)+,R1
QIOW$S #IO.WLB,#3,#3,,,,<R0,R1,#40>
EXIT: EXIT$S
SPND: BICB #PAU,STATUS
SPND$S
ATTCH: QIOW$S #IO.ATA,#3,#3,,,,<#SND>
10$: TSTB STATUS
BEQ 30$
BITB #EXT,STATUS
BNE EXIT
BITB #ABT,STATUS
BNE GONE
BITB #PAU,STATUS
BNE SPND
30$: CLEF$S #1
ENAR$S
WTSE$S #1
40$: DSAR$S
MOV TTYBF,R5
BEQ 10$
MOV R5,R4
MOV (R4)+,TTYBF
BNE 50$
MOV #TTYBF,TTYBF+2
50$: ENAR$S
MOV (R4)+,R3
QIO$S #IO.WAL,#3,,,R5,#60$,<R4,R3,#0>
BR 40$
60$: MOV (SP)+,R0
MOV R0,R1
CMP (R0)+,(R0)+
REC$S #2,,R1,#REC,<R0,RECLN>
BCS 99$
ASTX$S
99$: BPT
SND: CMPB ESCAPE,(SP)
BEQ 70$
CMPB PAUSE,(SP)
BEQ 80$
MOV #5,R1
MOV #AVAIL,R0
CALL $RQCB
BCS 40$
MOV R0,R1
CMP (R0)+,(R0)+
MOVB (SP),(R0) ; INSERT THE CHARACTER.
SND$S #2,,R1,#60$,<R0,#1>
BCS BREAK
20$: TST (SP)+
ASTX$S
40$: QIO$S #IO.WAL,#3,,,,,<#BELL,#1,#0>
BR 20$
60$: MOV (SP)+,R2
MOV #5,R1
MOV #AVAIL,R0
CALL $RLCB
ASTX$S
70$: BISB #DET!CLS!EXT,STATUS ; CLOSE THE LINK
BR 90$
80$: BISB #DET!PAU,STATUS ; DETACH THE TERMINAL
90$: TST (SP)+
ABORT: BITB #DET,STATUS
BEQ 10$
BICB #DET,STATUS
QIOW$S #IO.DET,#3,#1
10$: BITB #CLS,STATUS
BEQ 70$
BICB #CLS,STATUS
CLS$S #1,#1
BCS BREAK
70$: ASTX$S
BREAK: BPT
RECINI: TSTB @(SP)+
BMI 90$
MOV #3.,R2 ; INITIATE 3 READS
60$: MOV #4,R1
ADD RECLN,R1
MOV #AVAIL,R0
PUSH R2
CALL $RQCB
POP R2
BCS 90$
MOV R0,R1
CMP (R0)+,(R0)+
REC$S #2,,R1,#REC,<R0,RECLN>
BCS BREAK
SOB R2,60$
90$: ASTX$S
REC: MOV (SP)+,R0
TSTB (R0)
BMI 40$
BITB #PAU,STATUS
BNE 70$
CLR (R0)
MOV #TTYBF,R1
TST (R1)+
BNE 10$
SETF$S #1
10$: MOV R0,@(R1)+
MOV R0,-(R1)
BR 90$
40$: BISB #DET!CLS!ABT,STATUS
BR ABORT
70$: MOV R0,R1
TST (R0)+
MOV (R0)+,R2
QIOW$S #IO.WAL,#3,#1,,R1,,<R0,R2,#0>
REC$S #2,,R1,#REC,<R0,RECLN>
90$: ASTX$S
.PSECT POOL,D
POOLNG =.-POOL
.END START