;***************************************************************************;
; ;
; New York Alpha Micro Users Society ;
; AMOS/L Telecommunications Utility ;
; By David F. Pallmann ;
; ;
;***************************************************************************;
;
; File uses universal (.UNV) files other
; than SYS, SYSSYM, and TRM.
; These are on the AMUS network
MEM=A1 ;buffer index
MAX=A2 ;buffer end
TRM=A3 ;terminal definition area index
REM=A4 ;remote terminal definition area index
IMP=A5 ;impure area base register
EXT=D4 ;exit character
AMT=D5 ;amount of characters in buffer
INITIA: PHDR -1,0,PH$REE!PH$REU ;program header
GETIMP IMPSIZ,IMP,EXIT ;allocate local memory (exit on error)
TYPESP TELCOM
LEA A0,INITIA+2
VCVT @A0,OT$TRM ;display version number
CRLF ;newline
;get remote terminal name
GETREM: BYP
TRM ;argument on cmd line?
BNE 10$ ; yes
CRLF ; no
TYPESP Enter name of remote terminal:
KBD EXIT
10$: FILNAM REMDDB+D.FIL(IMP),XXX ;get remote terminal name
;look-up remote terminal name in terminal definition chain
LKPREM: MOV TRMDFC,REM ;index base of terminal def chain
10$: CMM 4(REM),REMDDB+D.FIL(IMP);matching trmdef name?
BEQ CHKTRM ; yes
MOV @REM,D0 ; no - advance to next entry
BEQ BADTRM ;zero means end of table - error
MOV D0,REM ;otherwise keep scanning
BR 10$
BADTRM: TYPECR ?bad terminal name
JMP EXIT
;make sure user has not given his own terminal name as the remote
CHKTRM: MOV JOBCUR,A0 ;index own JCB
MOV JOBTRM(A0),TRM ;index own trmdef area
CMM -4(TRM),REMDDB+D.FIL(IMP);same terminal name?
BNE CHKATT ; no - no problem
TYPECR ?that is your terminal name
JMP EXIT ; yes - can't do it
;check that terminal is not attached to a job
CHKATT: ADD #10,REM ;fix header offset for remote
TST T.JLK(REM) ;terminal attached?
BEQ SETTRM ; no
TYPECR ?terminal must be detached first
JMP EXIT
;set own terminal and remote terminal to data mode, no-echo
GETCMD: KBD ;get cmd (1 char)
AND #177,D1 ;mask off parity [CF]
UCS ;fold to upper for comparisons
CMPB D1,#'T
JEQ TALK
CMPB D1,#'S
JEQ SEND
CMPB D1,#'R
JEQ RECEIV
CMPB D1,#'C
JEQ CONFIG
CMPB D1,#'E
JEQ QUIT
BR GETCMD
PAGE
;**********
;* *
;* TALK *
;* *
;**********
;perform conversational I/O with remote system; characters typed by user
;are tramsmitted to the remote system, and characters received from the
;remote system are displayed on the user's terminal.
;Receive a file from the remote system; this function operates analogously
;to TALK (i.e. two-way communication), but everything is recorded in a
;disk file. Can be used to transmit an actual file or just to record a
;communications session.
;This action allows the user to change the various communications options
;available. Currently, these are:
;
; duplex (HALF or FULL) - determines whether or not TELCOM echoes
; the user's input characters during a TALK
; or a RECEIVE.
; xmit/receive mode (DISPLAY or SILENT) - normally, the contents of
; a file being transmitted or received are
; displayed on the user's terminal while
; the I/O is in progress; if the user elects
; to set SILENT mode, nothing is displayed.
; LF/no-LF - normally, LFs are transmitted during SEND operations as
; are all other chars; with the no-LF option
; in effect, LFs are supressed. This is
; desireable when the remote system,
; automatically inserts LFs after every CR.
CONFIG: TYPECR Configure
DUPLEX: TYPESP duplex:
BITW #F.HDX,FLAGS(IMP)
BEQ 10$
TYPE HALF
BR 20$
10$: TYPE FULL
20$: TYPE <; change? >
CALL YESNO
BNE RCVPAR
XORW #F.HDX,FLAGS(IMP)
RCVPAR: TYPESP receive parity:
BITW #F.RP1,FLAGS(IMP)
BEQ 10$
TYPE 1
BR 20$
10$: TYPE 0
20$: TYPE <; change? >
CALL YESNO
BNE SNDPAR
XORW #F.RP1,FLAGS(IMP)
SNDPAR: TYPESP send parity:
BITW #F.SP1,FLAGS(IMP)
BEQ 10$
TYPE 1
BR 20$
10$: TYPE 0
20$: TYPE <; change? >
CALL YESNO
BNE TFRMOD
XORW #F.SP1,FLAGS(IMP)
TFRMOD: TYPESP transfer mode:
BITW #F.SIL,FLAGS(IMP)
BEQ 10$
TYPE SILENT
BR 20$
10$: TYPE DISPLAY
20$: TYPE <; change? >
CALL YESNO
BNE LF.NLF
XORW #F.SIL,FLAGS(IMP)
LF.NLF: TYPESP transmit line feeds:
BITW #F.NLF,FLAGS(IMP)
BEQ 10$
TYPE N
BR 20$
10$: TYPE Y
20$: TYPE <; change? >
CALL YESNO
JNE READY
XORW #F.NLF,FLAGS(IMP)
JMP READY
;subroutine to get Y/N reply
;Z=1 on Y, Z=2 on N (or CR)
YESNO: KBD
AND #177,D1 ; 7/10/84 [CF] strip high bit
UCS
CMPB D1,#'Y
BEQ 10$
CMPB D1,#'N
BEQ 20$
CMPB D1,#CR
BEQ 20$
BR YESNO
10$: TYPECR Yes
LCC #Z
RTN
20$: TYPECR No
LCC #0
RTN