/	WPLOG - PHONE & LOGON UTILITIES
/
/	028	EMcD	26-Sep-85	Dutch & Spanish Xlations
/	027	EMcD	13-Sep-85	Nordic translations 
/					(conditionalised)
/	026	EMcD	15-Jul_85	Change from ~ to + and ' to ! 
/ 					in command lines
/	025	TCW	06-DEC-84	Remove scrolling regions from logon
/	024	TCW	04-DEC-84	Enlarge number buffer
/	023	TCW	01-NOV-84	Ck. for non-valid edit chars
/	022	TCW	04-OCT-84	Change screen output routines
/	021	TCW	18-SEP-84	Reset LINBUF
/	020	WCE	20-AUG-84	CHANGE FILE OPEN TO USE MNUTFN
/	019	TCW	17-AUG-84	CHANGE INTEGRAL MODEM CK
/	018	GDH	14-AUG-84	Fix DIAL routine -- coordinate TT output.
/	017	GDH	 7-AUG-84	Enhance keyboard input support.
/	016	TCW	03-JUL-84	Integral Modem support
/	015	TCW	12-APR-84	INCLUDE USE OF ARROW & FIND KEYS
/	014	BCR	30-DEC-83	RESTRUCTURE AND ADD PHONE UTILITY
/	013	BCR	4-NOV-83	GIVE ERROR ON MISSING WAIT OBJECT
/	012	BCR	25-OCT-83	DISALLOW OCTAL 8
/	011	GDH	30-SEP-83	Fixed dangling EOF flag.
/	010	GDH	30-SEP-83	CX 'call' to 'chain'
/	009	BCR	21-SEP-83	HANGUP MODEM AT MENU TIME
/	008	BCR	20-SEP-83	FIX ECHO OF USER KEYSTROKES
/	007	BCR	19-SEP-83	CHANGE HOST DRAINING TIMES
/	006	BCR	16-SEP-83	CHANGE '~' TO ACCEPT KBD INPUT
/	005	BCR	16-SEP-83	ADD "MENU" COMMAND
/	004	BCR	24-AUG-83	MIXED UC/LC GO TARGETS
/	003	BCR	 2-AUG-83	ALLOW CR IN WAIT HOST
/	003	BCR	 2-AUG-83	ECHO WAIT KBD ~
/	002	BCR	15-JUL-83	' text delimiter, CR KBD delimiter
/	001	GDH	20-MAY-83	Creation of stub module.
/
/	WRITES OUT WPLOG
/
	*200
	JMP I	.+3
	JMP I	.+1
	7600
	RXLOAD
	*RXLDLS
	RXEWT=4
	RXEWT
	0
	RXQBLK=11
	RXQBLK
	.
	DLOLOG 			/ ++++
	100 			/ ++++
	CDF 20 			/ ++++
	-DSOLOG
	0

/
	FIELD 2
/
	*100		/ THE FIRST 100 LOCATIONS ARE USED FOR THE SYSTEM
/
/
/	THIS MODULE CONTAINS THE LOGON PROCESSOR AND
/	THE TELEPHONE DIRECTOR/AUTODIALER UTILITY.
/	THE LATTER IS THE CODE BETWEEN LOCATIONS
/	"PHSTRT" AND "LOG", THE SUBROUTINE "SUBSTR"
/	AND ASSORTED MESSAGE TEXTS AT THE END.
/	IT CAN EASILY BE MADE INTO AN OVERLAY.

/	THE PHONE DIRECTORY IS A USER DOCUMENT CONTAINING
/	AN UNLIMITED NUMBER OF ENTRIES CONTAINING NAME
/	FIELDS  (WHICH BEGIN WITH <N>) AND TELEPHONE
/	NUMBER FIELDS (WHICH BEGIN WITH <#>).  EACH
/	ENTRY ENDS WITH <> AND MAY CONTAIN OTHER
/	FIELDS WHICH ARE IGNORED.


/-----------WARNING----------------
/	THE PHONE DIRECTORY IS OPENED FOR READ/WRITE.
/	DOCUMENT CORRUPTION CAN RESULT FROM ABNORMAL
/	EXITING.  DO NOT REMOVE THE DISKETTE WITHOUT
/	RETURNING TO MAIN MENU (AND BE CAREFUL WHEN
/	USING CPODT).


/	THESE ARE CONSTANTS USED BY THE LOGON UTILITY
/
	CIFMYF=CIFLP		/ DEFINE OUR FIELD.
	CDFMYF=CDFLP		/  ...
	CIFCX=CIF 40		/ CIF to the CX field.
	CDFCX=CDF 40		/ CDF to the CX field.
	CXLINE=4600		/ Address of DEFAULT CX SETTINGS line.
				/ Set/reset by CX command.
				/ This line buffer resides in the CX field (4).
	FORWRD=AC0004
	IFNZRO	XGETET-4 <FORWRD MUST MAKE XGETET>
	BCKWRD=AC0002
	IFNZRO	XGETST-2 <BCKWRD MUST MAKE XGETST>

	H2DTR=6362		/ MODEM CONTROL IOT			/A016
/
/	FREQUENTLY USED LITERALS AND LOCATIONS
/
BUFPTR,	BUFBEG			/ Ptr to buffer to store chars in.
LINCTR,	1			/ Line # for error reporting.
CHAR,	0			/ THE CURRENT CHARACTER FROM THE FILE
HALT,	XX			/ ADDRESS TO GO TO ON DETECTING GOLD HALT
WTSPTR,	0			/ WAIT PROCESSOR STRING POINTERS
WTXPTR,	0			/ .....HERE BECAUSE OF SCATTERED
WTGPTR,	0			/ .....INDIRECTS
/
EOF,	0			/ Set only if E-O-F or ERROR is encountered.
/D022TTCHRS,	0	/ Count of # of chars in LINBUF (for RUBOUT)/A017
/D022TYPPTR,	LINBUF	/ ptr into LINBUF tt buffer.		/A017


/
/	OCTAL VALUES OF SOME ASCII CHARACTERS
COLON=72
COMMA=54
AMPERS=46
SQUOTE=041	/ Use ! for ' in V3					/m026
TILDA=053	/ Use + for ~ in V3					/m026
SPACE=40
BSPACE=10								/D017
TAB=11
SLASH=57
ZERO=60
EIGHT=70
NINE=71
C=103
L=114
F=106
EOL=ECNWLN
/	SOME LOGON PARAMETERS
ATMSIZ=17		/MAXIMUM CHARACTERS/ATOM
LABSIZ=6		/MAXIMUM CHARACTERS/STATEMENT LABEL
WTTSIZ=31		/MAXIMUM CHARACTERS/WAIT TEXT ITEM
TXTSIZ=144		/MAXIMUM CHARACTERS/ ~ RESPONSE
CXSIZ=26		/DOCUMENTED LENGTH OF CX COMMAND BUFFER
SCRSIZ=120		/WIDTH OF SCREEN
PHNSIZ=55		/ NUMBER OF DIGITS IN A PHONE NUMBER		/A024
/
/	SEE WPF1.PA FOR EQUATES DEFINING CHARACTERS COMING FROM THE FILE.
/
/--------------------


/	THESE ARE CONSTANTS USED BY THE PHONE UTILITY
/
/	OCTAL VALUES OF SOME ASCII CHARACTERS
/BSPACE=10
ESIGN=75
CTLA=1
CTLB=2
BELL=7
LARR=74
RARR=76
NUMSGN=43
N=116
LPAR=50
RPAR=51
DASH=55
A=101
B=102
X=130
G=107
/
/	SOME PHONE PARAMETERS
KEYSIZ=WTTSIZ		/MAX LENGTH OF SEARCH KEY
NAMSIZ=TXTSIZ		/MAX LENGTH OF NAME FIELD
NUMSIZ=WTTSIZ		/MAX LENGTH OF NUMBER FIELD
/
/
/------------
	PAGE


LOGON,				/ENTRY POINT FOR LOGON. COME HERE BY TYPING LG
EXIT,	XX			/COMMON SYSTEM RETURN FOR LOGON & PHONE
	JMP	LOG		/GO START UP LOGON
/
PHONE,	XX			/ENTRY POINT FOR PHONE.
				/COME HERE FROM MAIN MENU COMMAND "PH"
	CDFMYF			/MAP OUR FIELD
	CLA
	TAD	PHONE		/SAVE RETURN POINT IN CASE OF EXIT
	DCA	EXIT		/ VIA LOGON.
	JMP	PHSTRT		/GO START UP THE PHONE UTILITY


/-----------------------------------------
/
/
/
/
/-----------------------------------------

/	EXIT TO MAIN MENU OR CX FROM EITHER LOGON OR PHONE

CLSRTN,	JMS	CLOSE		/ Close the directory document
RTNSY,	CLA			/ Hang up any modem connection			/A009
	TAD	(7402		/ Send hangup code to host			/A009
	JMS	HSOUT
	CIF	60		/ Map COMM buffer field.
	JMS I	(COMXIT)	/ Call COMM Clean-Up code.
	CDFSYS 			/ ++++
	DCA I	(CMADSX) 	/ ++++
RTNXIT,	
/D025	CDFMYF
/D025	CIFMNU			/ Clear date & time and reset scroll
/D025	JMS I	IOACAL
/D025		0
/D025		SCROLR		/ Default scrolling region
/D025		ESCAPE
/D025		LFSTRG		/ Scroll to 1st line.			/M017

	CDIMNU
	JMP I	EXIT

/ PHONE UTILITY


PHSTRT,	JMS	INITER		/INITIALIZE SOME COMMON STUFF
	TAD	(CLSRTN		/SET GOLD HALT RETURN
	DCA	HALT
	JMS	OPENRW		/ OPEN FILE FOR READ-WRITE		/A023
/D023	SPA CLA			/SKIP UNLESS OPEN ERROR
	SZA			/ SKIP UNLESS OPEN ERROR		/A023
	JMP	ERR1		/OPEN ERROR
	DCA	SCANSW		/SET TO SCAN FORWARD
	FORWRD			/FORWARD READ-WRITE
	DCA	GETOP
	IFNZRO	KEY-WTS1 <
	JMS	NULSTR		/CLEAR KEY STRING
		KEY	>
	TAD	(SKP CLA)	/SET TO "NOSCREEN" MODE
	DCA	SCRNSW

/
/	ASK USER FOR A NAME SEARCH KEY.  WE WILL SEARCH
/	THE DIRECTORY FILE FOR THE NEXT ENTRY WHOSE NAME
/	FIELD CONTAINS A MATCH FOR THIS KEY.
/	IF NONE IS SUPPLIED (IE ONLY A CR) THEN WE WILL
/	USE THE PREVIOUS KEY AGAIN.
/	IF THERE IS NO PREVIOUS KEY WE WILL MATCH THE
/	NEXT ENTRY.
/
/
GETKEY,	TAD	(NEXMSG	/INITIALIZE TO NOT DISPLAY OLD KEY		/M015
	DCA	KEYDSP
	TAD	KEY+1	/IS KEY A NULL STRING
	SNA CLA
	JMP	ASKKEY	/YES
	TAD	(OKYMSG	/NO, DISPLAY OLD KEY
	DCA	KEYDSP
/
ASKKEY,	CIFMNU		/ASK USER FOR NAME KEY
	JMS I	IOACAL
	0
	KEYMSG
	0
	0100		/POSITION TO LINE 1
	0200
KEYDSP,	XX		/ADDRESS OF EITHER NULMSG OR OLD KEY MESSAGE
	KEY+1
	0300
	MENMSG		/RETURN TO MM MESSAGE
	0400
	TAD	(SKP CLA)/INITIALIZE OPTION DISPLAY SWITCH
	DCA	OPTSW
/
	JMS	KBGET	/GET FIRST CHARACTER
	DCA	CHAR
	TAD	CHAR	/IS IT A CR
	TAD	(-EDNWLN
	SNA
	JMP	KEYGOT	/YES, USE KEY AGAIN
	TAD	(EDNWLN-EDMENU	/NO, IS IT GOLD MENU
	SNA CLA
	JMP	CLSRTN	/YES, CLOSE DIRECTORY AND RETURN
	JMS	NULSTR	/CLEAR OLD KEY
		KEY
/D022	JMS	RSLNBF		/ RESET LINE INPUT BUFFER		/A021

KEYGO,	TAD	CHAR		/ CK FOR NON-VALID CHARS		/A023
	TAD	(-EDRBWD	/
	SMA CLA			/					/A023
	JMP	KEYRUB		/ CHAR OK - GO PROCESS			/A023
	JMS	BEEPER		/ RING BELL				/A023
	JMP	KEYAGN		/ NO - NON VALID EDIT KEY		/A023
KEYRUB,	TAD	CHAR		/ PICK UP CHAR				/A023
	JMS	CHKRUB
		KEY							/A022
/
/D022	TAD	CHAR	/ADD TO PREVIOUS KEY STRING
	JMS	ADDSTR
		KEY
	JMP	KEYOVF	/KEY TOO LONG
KEYAGN,	JMS	KBGET	/GET ANOTHER KEYSTROKE
	DCA	CHAR	/SAVE IT
	TAD	CHAR	/GET CHARACTER BACK
	TAD	(-EDNWLN	/CHECK FOR CR
	SNA CLA
	JMP	KEYGOT	/YES, END OF KEY
	JMP	KEYGO	/LOOP FOR NEXT KEY CHAR
/
KEYOVF,	JMS	BEEPER	/BEEP FOR TOO LONG
KEYGOT,	JMS	CLRSCN	/CLEAR SCREEN
	JMP	GETFIL
/------------
	PAGE


/	WE HAVE THE COMPLETE KEY.  NOW SEARCH FOR
/	AN ENTRY WITH A MATCH.
/
GETFIL,	JMS	CHKHLT	/CHECK FOR GOLD HALT
	JMS	NXTNAM	/GO GET A NEW NAME AND NUMBER FROM THE DIRECTORY
	JMP	EOFOPT	/END OF DIRECTORY ENCOUNTERED
	JMS	SUBSTR	/CHECK FOR A SUBSTRING MATCH
		KEY
		NAME
	JMP	GETFIL	/NO MATCH. GET ANOTHER ENTRY

/	MATCH FOUND. DISPLAY TO USER
/	DISPLAY KEY OPTIONS ONLY ONCE

OPTSW,	SKP CLA		/SET TO "CLA" WHEN DISPLAY NEED NOT BE REPAINTED
	 JMP	DISPLY
	TAD	(CLA)	/SET NOT TO REDISPLAY THESE MESSAGES
	DCA	OPTSW
	JMS	SHOOPT	/DISPLAY THE USER OPTIONS


/	DISPLAY THE USER EXITS
	CIFMNU
	JMS I	IOACAL
		0
		XITMSG
		1300
		1400
	CLA
	TAD	(SKP CLA)/SET TO ALLOW BOTH ADVANCE & BACKUP
	DCA	ADVAN
	TAD	(SKP CLA)
	DCA	BACK
DISPLY,	TAD	(SKP	/SET SWITCH TO ALLOW DIALING
	DCA	CXLGSW
/
	TAD	NUMBR+1	/CHECK FOR NUMBER FOUND
	SZA
	JMP	DODISP	/YES, GO DO DISPLAY
	JMS	MOVSTR	/SHOW USER 'NO NUMBER'
		NONUM
		NUMBR
	NOP		/SHOULD NEVER TAKE THIS ERROR RETURN
DODISP,	JMS	DISPNM	/DISPLAY NAME AND NUMBER


/	WAIT FOR USER RESPONSE TO OPTIONS DISPLAY

OPTWT,	JMS	KBGET	/GET A CHARACTER
OPTCHK,	TAD	(-EDADVN	/IS IT ADVANCE
	SNA
	JMP	ADVAN	/YES, GO GET NEXT ENTRY
	TAD	(EDADVN-EDBKUP	/IS IT BACKUP
	SNA
	JMP	BACK	/YES, GO GET PREVIOUS ENTRY
	TAD	(EDBKUP-EDFIND	/IS IT GOLD SEARCH
	SNA
	JMP	GETKEY	/YES, GO GET A NEW SEARCH KEY
	TAD	(EDFIND-EDMENU	/IS IT GOLD MENU
	SNA
	JMP	CLSRTN	/YES, BACK TO MAIN MENU
/
CXLGSW,	SKP		/SET TO NOP WHEN CX AND LG ARE NOT ALLOWED
	JMP	BEEP
/
	TAD	(EDMENU-C	/IS IT C
	AND	(7737		/EITHER CASE
	SNA
	JMP	CXTST
	TAD	(C-L		/NO, IS IT L
	SNA
	JMP	LGTST
BEEP,	JMS	BEEPER
	JMP	OPTWT
/
CXTST,	JMS	KBGET	/CHECK FOR POSSIBLE CX
	AND	(7737	/EITHER CASE
	TAD	(-X	/DID WE GET IT
	SZA
	JMP	BEEP	/NO
	JMS	DIALER	/GO DIAL THE NUMBER
	JMP	NOTANS	/NOT ANSWERED
	JMS	CLOSE	/ANSWERED, CLOSE DIRECTORY AND
	JMP	RTNCX	/EXIT TO CX

/		NOT ANSWERED FOR SOME REASON
NOTANS,	JMS	KBGET	/WAIT FOR A KEYSTROKE
	DCA	T1	/SAVE IT
	JMS	DISPNM	/REPAINT NAME AND NUMBER FOR POSSIBLE NEW TRY
	TAD	T1	/GO CHECK OPTION SELECTION
	JMP	OPTCHK

LGTST,	JMS	KBGET	/CHECK FOR POSSIBLE LG
	AND	(7737	/EITHER CASE
	TAD	(-G	/DID WE GET IT
	SZA
	JMP	BEEP	/NO
/D022	JMS	RSLNBF	/ YES - RESET LINE BUFFER			/A021
/
/	AT THIS POINT WE MUST GET THE NAME OF THE LOGON FILE
/	THE USER WANTS TO USE IF HIS PHONE CALL IS COMPLETED.
/	CURRENTLY WE GO TO MN1 AND PROMPT IN THE SAME WAY
/	AS FOR NORMAL LG REQUESTS.  IN THE FUTURE BOTH THE
/	LOGON AND PHONE FILES MAY BE DEFAULTS, CHANGEABLE
/	THROUGH "SO".  IN ANY EVENT, CONTROL MUST ALWAYS
/	RETURN HERE, EVEN IF GOLD MENU IS PRESSED, IN ORDER
/	TO CLOSE THE PHONE FILE (WHICH IS STILL OPEN IN CASE
/	THE USER WANTS A DIFFERENT ENTRY OR THE LINE IS BUSY)
/	AND TO CLEANUP CX.

MENXIT,	CIFMNU		/YES, ASK FOR LOGON FILE NAME
	JMS I	MNUCAL
		DLMED1
	CLA
	CDFMNU
	TAD I	(MUBUF+MNSYSA	/CHECK FOR GOLD MENU
	CDFMYF
	TAD	(-EDMENU!4000
	SNA CLA		/SKIP IF NOT
	JMP	CLSRTN	/YES, BACK TO SYSTEM
	JMS	DISPNM	/REPOSITION THE CURSOR
/
	JMS	DIALER	/GO DIAL THE NUMBER
	JMP	NOTANS	/NOT ANSWERED
	JMS	CLOSE	/CLOSE DIRECTORY
	JMP	LOG	/EXIT TO LOGIN


/------------
	PAGE


BACK,	SKP CLA		/SET TO NOP WHEN "BACK" NOT ALLOWED
	JMP	BEEP
	AC7777		/SET TO SCAN BACKWARD
	JMP	BACADV
/
ADVAN,	SKP CLA		/SET TO NOP WHEN "ADVAN" NOT ALLOWED
	JMP	BEEP
/
BACADV,	DCA	SCANSW	/SAVE SCAN DIRECTION
	JMS	NXTNAM	/GO GET ANOTHER ENTRY
	JMP	GOTEOF	/END OF DIRECTORY REACHED
	JMP	OPTSW

/	END OF FILE ENCOUNTERED
GOTEOF,	CLA
	TAD	SCANSW	/WHICH WAY WERE WE GOING
	SZA
	JMP	BACEOF	/BACKWARD

/	END OF FILE IN FORWARD DIRECTION = END OF FILE
	AC7777		/SET TO BACK OVER ONE ENTRY
	DCA	BACKUP
	TAD	(ENDMSG	/SHOW END OF FILE
	DCA	ENDBEG
	TAD	(BCKMSG	/SHOW ONLY "BACKUP"
	DCA	ADVBCK
	TAD	(NOP)	/DISALLOW "ADVANCE" NOW
	DCA	ADVAN
	TAD	(SKP CLA)/AND ALLOW "BACKUP"
	DCA	BACK
	JMP	SHOEND

/	END OF FILE IN BACKWARD DIRECTION = BEGINNING OF FILE
BACEOF,	AC7776		/SET TO BACK OVER TWO ENTRIES
	DCA	BACKUP
	TAD	(BEGMSG	/SHOW BEGINNING OF FILE
	DCA	ENDBEG
	TAD	(ADVMSG	/SHOW ONLY "ADVANCE"
	DCA	ADVBCK
	TAD	(NOP)	/DISALLOW "BACKUP" NOW
	DCA	BACK
	TAD	(SKP CLA)/AND ALLOW "ADVAN"
	DCA	ADVAN
/
SHOEND,	CIFMNU
	JMS I	IOACAL
		0
		EODMSG
		0400								/M015
ENDBEG,		XX		/BEGINNING OR END OF FILE MESSAGE
		0500								/M015
		0700								/M015
		1000
ADVBCK,		XX
		ENTMSG
		1300
	TAD	(SKP CLA)/SET TO REPAINT OPTIONS
	DCA	OPTSW
	TAD	(NOP)	/SET TO DISABLE DIALING
	DCA	CXLGSW
	DCA	EOF	/CLEAR EOF FLAG
	TAD	SCANSW	/FLIP SCAN TO OTHER DIRECTION
	CMA
	DCA	SCANSW
	JMP	OPTWT	/GO WAIT FOR A KEYSTROKE

/	REPAINT THE USER OPTIONS
EOFOPT,	JMS	SHOOPT
	JMP	GOTEOF

SCANSW,	0		/0 = FORWARD SCAN, -1 = BACKWARD

/
/CMPSTR - COMPARE 2 7-BIT ASCIIZ STRINGS
/
/	JMS	CMPSTR
/	ADDRESS OF FIRST STRING
/	ADDRESS OF SECOND STRING
/	NOT EQUAL RETURN   (AC=0)
/	EQUAL RETURN   (AC=0)
/
/	A LOWER CASE CHARACTER IN THE FIRST
/	STRING WILL COMPARE EQUAL TO EITHER
/	LOWER OR UPPER CASE VERSIONS OF
/	THAT CHARACTER IN THE SECOND STRING.
/
/	STRINGS MUST BE OF EQUAL LENGTH TO
/		COMPARE EQUAL.
/
CMPSTR,	XX
	CLA
	TAD I	CMPSTR	/GET ADDR OF S1
	DCA	X1
	ISZ	CMPSTR
	TAD I	CMPSTR	/GET ADDR OF S2
	DCA	X2
	ISZ	CMPSTR	/POINT TO NOT EQUAL RETURN
CMPLOP,	TAD I	X1	/FETCH A CHARACTER FROM S1
	SNA
	JMP	CMPE1
	AND	(177	/COMPARE ONLY 7 BITS
	DCA	CMPC1
	TAD I	X2	/FETCH A CHARACTER FROM S2
	SNA
	JMP I	CMPSTR	/SECOND STRING SHORTER
	AND	(177
	CIA		/SAVE -SECOND CHAR
	DCA	CMPC2
	DCA	CMPULA	/CLEAR UPPER/LOWER ADJUSTER
	TAD	CMPC1	/IS FIRST STRING CHARACTER L/C
	TAD	(-172
	SMA SZA
	JMP	CMPCMP	/NO, >z
	TAD	(172-141
	SPA CLA
	JMP	CMPCMP	/NO, <a
	TAD	(-40	/FIRST CHAR IS L/C. SET ADJUSTER
	DCA	CMPULA
CMPCMP,	CLA		/COMPARE THE PAIR OF CHARACTERS
	TAD	CMPC1
	TAD	CMPC2
	SZA
	TAD	CMPULA
	SNA CLA		/SKIP IF NOT EQUAL NOW
	JMP	CMPLOP	/GO CHECK NEXT PAIR
	JMP I	CMPSTR	/TAKE NOT EQUAL RETURN
			/END OF STRING1
CMPE1,	TAD I	X2	/CHECK FOR END OF STRING2
	SNA CLA
	ISZ	CMPSTR	/TAKE EQUAL RETURN
	JMP I	CMPSTR	/RETURN

CMPC1,	0
CMPC2,	0
CMPULA,	0

/	RESET LINE INPUT BUFFER						/A021

/D022RSLNBF,	XX							/A021
/D022	TAD	(LINBUF)	/ 					/A021
/D022	DCA	TYPPTR		/					/A021
/D022	DCA	TTCHRS		/					/A021
/D022	JMP I	RSLNBF		/					/A021

	X=.
/------------
	PAGE


/	GET THE NAME AND NUMBER FIELDS FROM THE NEXT
/	PHONE ENTRY IN WHICHEVER DIRECTION WE ARE
/	CURRENTLY SCANNING.

/	JMS	NXTNAM
/		end of directory return
/		normal return

NXTNAM,	XX
	TAD	SCANSW	/CHECK SCAN DIRECTION
	SZA
	JMP	NXBACK	/GO BACK UP ONE ENTRY AND THEN READ FORWARD
NXTBK,	AC7776		/BACK TWO ENTRIES & FORWARD ONE WHEN BACKING UP
	DCA	BACKUP
/
/	READ ALL FIELDS IN THE FORWARD DIRECTION
NXT1,	FORWRD		/SET FOR FORWARD READ-WRITE
	DCA	GETOP
	JMS	GETNXT	/LOOK FOR A <
	TAD	(-LARR
	SZA CLA
	JMP	NXT1
	JMS	GETNXT	/FOLLOWED BY AN N
	TAD	(-N
	SZA CLA
	JMP	NXT1
	JMS	GETNXT	/FOLLOWED BY A >
	TAD	(-RARR
	SZA CLA
	JMP	NXT1
/
	JMS	NULSTR	/CLEAR NAME STRING
		NAME
	JMS	NULSTR	/CLEAR NUMBER STRING
		NUMBR
GETNAM,	JMS	GETNXT	/STUFF IN ALL CHARACTERS UP TO A <
	TAD	(-LARR
	SNA
	JMP	CHKNUM
	TAD	(LARR
	JMS	ADDSTR
		NAME
	JMP	GETNAM	/IGNORE OVERFLOW CHARACTERS
	JMP	GETNAM
/
LOOKNU,	JMS	GETNXT	/SKIP TO A <
	TAD	(-LARR
	SZA
	JMP	LOOKNU	/NOT FOUND YET
CHKNUM,	JMS	GETNXT	/CHECK FOR #
	TAD	(-RARR
	SNA
	JMP	GETRTN	/WE HAVE <>
	TAD	(RARR-NUMSGN
	SNA
	JMP	GETNAR	/WE HAVE <#
	TAD	(NUMSGN-N
	SZA CLA
	JMP	LOOKNU	/SKIP TO NEXT <
	JMS	GETNXT	/WE HAVE <N
	TAD	(-RARR
	SZA CLA
	JMP	LOOKNU	/SKIP TO NEXT <
	JMP	GETDIA	/WE HAVE <N>. SKIP TO <>
GETNAR,	JMS	GETNXT
	TAD	(-RARR
	SZA
	JMP	LOOKNU	/<#> NOT FOUND YET. LOOK FOR <
/
GETNUM,	JMS	GETNXT	/STUFF CHARACTERS INTO NUMBER UP TO A <
	TAD	(-LARR
	SNA
	JMP	ENDNUM
	TAD	(LARR
	JMS	ADDSTR
		NUMBR
	JMP	GETNUM	/IGNORE OVERFLOW DIGITS
	JMP	GETNUM
/
/	< FOUND. SEE IF IT WAS <>
ENDNUM,	JMS	GETNXT	/GET PAST <>
	TAD	(-RARR
	SNA
	JMP	GETRTN
GETDIA,	JMS	GETNXT	/LOOK FOR THE <
	TAD	(-LARR
	SZA
	JMP	GETDIA	/LOOP BACK FOR <
	JMP	ENDNUM	/< FOUND. NOW CHECK FOR >
GETRTN,	ISZ	NXTNAM	/TAKE NORMAL RETURN
/
GETEOF,	JMP I	NXTNAM	/TAKE EOF RETURN
/
/	BACK UP TO THE <N> AT THE START OF THE PREVIOUS ENTRY
NXBACK,	BCKWRD		/SET BACKWARD READ-WRITE
	DCA	GETOP
	TAD	BACKUP	/GET -NUMBER OF ENTRIES TO GO BACK
	DCA	BACKCT
NXTB1,	JMS	GETNXT
	TAD	(-RARR	/ > FOUND?
	SZA
	JMP	NXTB1	/NOT YET
	JMS	GETNXT
	TAD	(-N	/ N> FOUND?
	SZA
	JMP	NXTB1	/NOT YET
	JMS	GETNXT
	TAD	(-LARR
	SZA
	JMP	NXTB1
	ISZ	BACKCT	/<N> FOUND. BACK ANOTHER ENTRY?
	JMP	NXTB1	/YES
	JMP	NXTBK	/NOW READ ENTRY IN THE FORWARD DIRECTION
BACKCT,	XX		/COUNT OF ENTRIES WHILE BACKING UP
BACKUP,	XX		/-1 OR -2 ENTRIES TO BACKUP NEXT TIME


/	GET NEXT CHARACTER FROM PHONE DIRECTORY FILE
/	IGNORING HARD RETURN.
/	GO TO GETEOF IF EOF OR BOF.
/
GETNXT,	XX
GETNX1,	JMS	GETCHR	/FETCH A CHARACTER
	JMP	GETEOF	/NONE FOUND
	MQL
	MQA
	TAD	(-ECNWLN	/CHECK FOR HARD RETURN
	SNA CLA
	JMP	GETNX1	/IGNORE IT AND GET ANOTHER CHARACTER
	MQA		/RESTORE CHARACTER
	JMP I	GETNXT

/D022CSTRNG,	TEXT	/^A^A!L/	/ IOA text string to output LINBUF with.
/D022CRSTRG,	CR;0			/ return to col 1 before display.
LFSTRG,	LF;0			/ scroll to next line.
/------------
	PAGE

/	 LOGON UTILITY
/	THIS IS THE START OF THE LOGON PROCESSOR
/	COME HERE FROM MAIN MENU COMMAND "LG"
/
LOG,	CDFMYF			/ Map our field.
	JMS	INITER		/ Initialize some common stuff
	AC0001			/ Init some counters/pointers.		/A011
	DCA	LINCTR		/  ...					/A011
	DCA	LINBMP		/					/A011
	TAD	(BUFBEG)	/ Init ptr to saved text.		/A011
	DCA	BUFPTR		/  ...					/A011
	TAD	(BUFBEG-1)	/ Zero out saved text buffer.		/A011
	DCA	X0		/  ...					/A011
	TAD	(BUFBEG-BUFEND-1)/ Buffer size.				/A011
	DCA	T1		/  ...					/A011
INIT1,	DCA I	X0		/ zero out the buffer.			/A011
	ISZ	T1		/ Loop on negative size count.		/A011
	JMP	INIT1		/  ....					/A011
	DCA	TEMODE		/ SET INITIAL "TEXTSCAN" MODE
	TAD	(NOP)		/ INITIALIZE TO "SCREEN"
	DCA	SCRNSW
	TAD	(SKP CLA)	/ INITIALIZE TO STUFF ERROR BUFFER
	DCA	NEXTSW
	TAD	(XRDFNC		/ SET FOR READ ONLY
	DCA	GETOP
	TAD	(LOGHLT		/SET UP GOLD HALT ADDRESS
	DCA	HALT
	JMS	CLRSCN		/ CLEAR SCREEN				/A025
/D025	CIFMNU			/ Set up to call IOA
/D025	JMS I	IOACAL		/ use IOA to clear the screen.
/D025		0		/ Do I/O to terminal.
/D025		SCROLS		/ Set scrolling region to 2-24
/D025		0100		/ Clear screen
/D025		ESCAPE
/D025		ESCAPE
/D025		0100

	CDFMNU			/ Get the file number from MENU area.
	TAD I	(MUBUF+MNUTFN)	/  ...					/M020
	CDFMYF
	CIFFIO			/ Open file for READ-ONLY.
	FILEIO			/  ...
	XRDFIN
	SMA CLA			/ Skip if error condition occurs (shouldn't).
	JMP	PARSE1		/ And away we go...
ERR1,	JMS	ABORT;1		/ Report file open failure.

/-----------------------------------------
/
/
/	END OF LOGON PRECESSING
/
/
/-----------------------------------------

RTNCX,	JMS	CLRSCN		/ Clear screen
ENDCMD,	CDFMNU			/ Map MENU field.
	AC7777			/ Tell CX that we're bypassing init.
	DCA I	(MUBUF+MNTMP6)	/  ...
	TAD	LOADCX		/ Tell WPCMD that re're chaining to WPCX	/A011
	DCA I	(MUBUF+MNONUM	/ CX overlay 	#		/A011
	TAD	LOADCX+1						/A011
	DCA I	(MUBUF+MNONUM+1	/ start address			/A011
	TAD	LOADCX+2						/A011
	DCA I	(MUBUF+MNONUM+2	/ CIF to CX field			/A011
	CDFMYF			/ Back to our field.
	ISZ	EXIT		/ BUMP TO 'CHAIN' RETURN
	JMP	RTNXIT		/ EXIT

/	INITIALIZE SOME THINGS COMMON TO PHONE AND LOGON

INITER,	XX
	JMS	INITWS		/ INITIALIZE ASCIIZ WORK STRINGS
	DCA	EOF		/ NOT AT END OF FILE
	DCA	TEMODE		/ INITIAL "TEXTSCAN" MODE
/D022	TAD	(LINBUF)	/ Initialize Screen text pointer.	/A017
/D022	DCA	TYPPTR		/  ...					/A017
/D022	DCA I	TYPPTR		/ Init buffer to MT.			/A017
	TAD	(SKP)
	DCA	ECHOSW		/ SET TO ECHO KEYSTROKES
	JMS	CPYTIM		/ COPY DATE & TIME
	JMP I	INITER


/	CLEAR THE SCREEN
CLRSCN,	XX
	CIFMNU
	JMS I	IOACAL
		0
		CLRMSG		/ Clear screen
		0
	JMP I	CLRSCN


/
LOADCX,	3		/CX OVERLAY, ADDRESS, AND FIELD			/A011
	200								/A011
	CIF	20							/A011
/
/	COME HERE ON GOLD HALT DURING LOGON
LOGHLT,	JMS	ABORT;2		/EXIT THROUGH ABORT ROUTINE

/ OPEN FILE FOR READ-WRITE						/A023

OPENRW,	XX			/					/A023
	CDFMNU			/ Get the file number from MENU area.
	TAD I	(MUBUF+MNUTFN)	/  ...					/M020
	MQL			/PUT IN MQ & CLEAR AC
	CDFMYF
	CIFFIO			/ Open file for READ-WRITE.
	FILEIO			/  ...
	XDSKIN
	JMP I	OPENRW		/					/A023

/	CLOSE THE DIRECTORY DOCUMENT

CLOSE,	XX
	CIFFIO
	FILEIO
	XDSKCL
	JMP I	CLOSE

/------------
X=.
	PAGE


/	THIS IS THE PARSER FOR THE LOGON PROCESSOR.
/	THE FIRST (OR ONLY) WORD OF A COMMAND IS
/	PARSED OFF HERE, AND CONTROL PASSED TO A
/	ROUTINE TO PERFORM THE REQUESTED ACTION.
/
/	COME TO PARSE1 TO START PARSE1G THE FIRST STATEMENT
/
/	JUMP TO "PARSER" WHEN THROUGH PROCESSING ANY STATEMENT LINE
/
PARSE1,	JMS	NEXTCH	/FETCH NEXT/FIRST CHARACTER
	TAD	EOF	/CHECK FOR EOF
	SZA
	JMP	ERR3	/GIVE ERROR MESSAGE IF SO

PARSER,	JMS	SKIPBL	/SKIP TO NON-BLANK
	JMP	PARSE1	/GO GET NEW LINE IF EOL

	JMS	GETATM	/GET AN ATOM
	TAD	CHAR
	TAD	(-COLON	/CHECK FOR COLON DELIMITER
	SZA
	JMP	PBRNCH	/GO CHECK ATOM FOR KNOWN COMMAND
	JMS	NEXTCH	/ATOM IS A LABEL. GO GET NEXT ATOM
	JMP	PARSER

PBRNCH,	JMS	LISTBR	/EXIT TO A ROUTINE TO PROCESS COMMAND
		CMDLST
	JMP	ERR5	/NO MATCH. NOT A VALID COMMAND


ERR3,	JMS	ABORT;3
ERR5,	JMS	ABORT;5

NOSCRN,	TAD	(SKP CLA-NOP)	/ Load a SKP CLA instr for NOSCREEN.	/M017
SCREEN,	TAD	(NOP)		/ load a NOP instr for SCREEN.		/M017
	DCA	SCRNSW		/ SCRNSW = SKP CLA/NOP for NOSCREEN/SCREEN.
	JMP	PARSER		/ Do next command.


/
/	MENU, ABORT, AND END STATEMENTS ARE PROCESSED HERE.
/	EACH DRAINS THE COMM LINE UNDER THE CURRENT
/	SCREEN/NOSCREEN SPECIFICATION BEFORE RELINQUISHING
/	CONTROL.
/
/
/	MENU STATEMENT
/
MENU,	JMS	DRAINH		/ Drain HOST buffer
	JMP	RTNSY		/ Back to MAIN MENU
/
/
/	ABORT STATEMENT
/
ABORTC,	JMS	DRAINH		/ Drain HOST buffer
	JMS	ABORT;6		/ Go to abort routine
/
/
/	END STATEMENT
/
ENDCM,	JMS	DRAINH		/ Drain HOST buffer
	JMP	ENDCMD		/ Exit to CX

/
/	CX COMMAND PROCESSED HERE
/
/CALL:	JMP	CXCMND
/
/	parses CX command which looks like:	CX KH HS KP etc.
/	note: the 'CX' is already parsed off.
/
CXCMND,	TAD	(CXLINE-1)	/ Get address of where to stuff CX commands.
	DCA	X0		/ Set aside.
	TAD	(-CXSIZ		/ Get length OF CX buffer
	DCA	CXCNT
	JMS	NEXTCH		/ Get first character.
	JMS	SKIPBL		/ Skip any leading blanks
	JMP	CXDONE		/ Jump if EOL
CXLOOP,	TAD	CHAR		/ Get character
	TAD	(-SLASH)	/ Check for comments
	SNA CLA
	JMS	EOLINE		/ Skip rest of line
	TAD	CHAR
	TAD	(-EOL		/ Line Terminator?
	SNA			/ Skip if no.
	JMP	CXDONE		/ Jmp if yes. We are done.
	ISZ	CXCNT		/ Bump buffer count
	SKP
	JMP	ERR4		/ Too long
	TAD	(EOL		/ Restore character back to normal.
	JMS	UPPER		/ Change character to upper case.
	CDFCX			/ Map CX field.
	DCA I	X0		/ Stuff char into CX Line buffer.
	CDFMYF			/ Back to our field.
	JMS	NEXTCH		/ Get next character
	JMP	CXLOOP		/ and go test it.

CXDONE,	CDFCX			/ Map CX field.
	DCA I	X0		/ Set line terminator (null) in CX line buffer.
	CDFMYF			/ Back to our field.
	JMP	PARSER		/ Back to command decoder loop.


UPPER,	XX			/ Routine to UPPER-CASE a character.
				/ Character is passed back & forth in AC.
	TAD (-173);SMA;JMP UPPER1
	TAD (173-141);SMA;TAD (-40)
	TAD (141-173)
UPPER1,	TAD (173)
	JMP I	UPPER
CXCNT,	0

/
/	ROUTINE TO DELAY ONE SECOND
WAIT1,	XX
	JMS	TIMER
WAIT1L,	JMS	TIMER
	SNA CLA
	JMP	WAIT1L
	JMP I	WAIT1



/
/TIMER
/
/CALL:	JMS	TIMER
/
/	Returns w/ AC = # of secs since last call.
/
TIMER,	XX			/ Entry point.
	CIFSYS
	JWAIT
	JMS	CHKHLT		/ Check HALT FLAG and clear the AC.
	JMS	DOTIME		/ Update date & time on screen
	TAD	LSTIME		/ Get time of last time.
	CIA			/ Negate for compare.
	CDFSYS			/ Map SYS field.
	TAD I	(CLOCK+2)	/ Get current SEC value.
	CDFMYF			/ Back to our field.
	DCA	T1		/ Save the difference.
	TAD	T1		/ Get back.
	TAD	LSTIME		/ compute current time
	DCA	LSTIME		/  and save for next time.
	TAD	T1		/ Get the difference back.
	SPA;TAD	(74)		/ If negative then we bumped a minute. Fix.
	JMP I	TIMER		/ Return to caller.

LSTIME,	0			/ Temp to hold the time of the last time.
SECNDS,	0

ESCAPE,	33;0
/------------
	PAGE


/	GO - LOGON PROCESSOR GO STATEMENT HANDLER
/
/	THE CURRENT ATOM IS "GO"
/
/	THE JOB OF THIS ROUTINE IS TO GET THE
/	STATEMENT NAME FOLLOWING THE "GO" AND
/	READ FILE LINES UNTIL ONE IS FOUND
/	THAT BEGINS WITH THAT NAME FOLLOWED BY
/	A COLON.  IF FOUND, CONTROL IS TO BE
/	RETURNED TO THE PARSER.  IF NOT FOUND,
/	IT IS A USER ERROR.
/
/	"WAIT" ENTERS THIS ROUTINE AT "GOT" WHEN A
/	STRING WITH A TARGET IS MATCHED. THE TARGET
/	LABEL WILL BE IN "GOTRGT".
/
/
GO,	JMS	SKIPTO	/GET NEXT ATOM (SKIPPING OPTIONAL "TO")
	JMS	MOVSTR	/MOVE ATOM TO TARGET
		ATOM
		GOTRGT
	JMP	ERR4	/TARGET MORE THAN 6 CHARACTERS
/
/		GOTRGT CONTAINS THE LABEL TO GO TO
GOT,	TAD	(NOP)	/TELL NEXTCH TO STOP STUFFING
	DCA	NEXTSW	/THE ERROR MESSAGE BUFFER.
	TAD	LINCTR	/SAVE THE LINE NUMBER IN CASE OF ERROR
	DCA	GOWLIN
/
GOTNXT,	JMS	EOLINE	/GET TO NEXT LINE
	JMS	NEXTCH	/START NEW LINE
	JMS	GETATM	/LOOK FOR A STATEMENT LABEL
	TAD	CHAR	/IS ATOM FOLLOWED BY A :
	TAD	(-COLON
	SZA CLA
	JMP	GOTNXT	/NO, TRY NEXT LINE
/
/	FORCE ALL UPPERCASE ALPHAS IN ATOM TO LOWER CASE FOR MATCHING
	TAD	(ATOM+1
	DCA	T1	/START OF STRING
/
GOTLCL,	CLA
	TAD I	T1	/FETCH A CHARACTER
	SNA
	JMP	GOTLCC	/END OF STRING
	TAD	(-101	/CHECK FOR A
	SPA
	JMP	GOTLCB	/SMALLER THAN A. LEAVE ALONE
	TAD	(101-132	/CHECK FOR Z
	SPA SNA
	TAD	(40	/UPPER-CASE ALPHA. FORCE TO LOWER
	TAD	(132
	DCA I	T1	/STORE BACK
GOTLCB,	ISZ	T1	/BUMP TO NEXT CHARACTER
	JMP	GOTLCL	/AND TEST AGAIN
/
GOTLCC,	JMS	CMPSTR	/SEE IF THIS LABEL IS THE ONE WE WANT
		ATOM
		GOTRGT
	JMP	GOTNXT	/NO, TRY FOR ANOTHER
/
/	YES, TARGET FOUND.
	TAD	(SKP CLA)/TURN ON THE BUFFER STUFFING AGAIN
	DCA	NEXTSW
/
/	CLEAR THE ERROR MESSAGE BUFFER
/	SO THAT IT WILL BE CURRENT.
	TAD	(BUFBEG-1
	DCA	X1
GOCLR,	DCA I	X1	/CLEAR A CHARACTER
	TAD	X1	/CHECK IF ALL DONE
	TAD	(-BUFEND
	SZA CLA
	JMP	GOCLR	/NOT YET, DO NEXT
	TAD	(BUFBEG	/RESET POINTER TO START
	DCA	BUFPTR
/
/	PUT THE TARGET NAME IN THE BUFFER AS THE START OF THE LINE
	TAD	(GOTRGT	/GET TARGET NAME LOCATION
	DCA	X1
GOTBUF,	TAD I	X1	/FETCH A CHARACTER
	SNA
	JMP	GOCOL	/END OF NAME. PUT OUT :
	JMS	PUTBUF	/PUT CHARACTER INTO BUFFER
	JMP	GOTBUF	/GO FOR ANOTHER
GOCOL,	TAD	CHAR	/PUT OUT THE DELIMITING :
	JMS	PUTBUF
/
	JMP	PARSER	/RETURN TO THE PARSER
ERR4,	JMS	ABORT;4	/ELEMENT TOO LONG
GOWLIN,	0		/LINE NUMBER OF GO OR WAIT FOR POSSIBLE ERROR MESSAGE


/	TYPE - LOGON PROCESSOR TYPE STATEMENT HANDLER
/
/	THE CURRENT ATOM IS "TYPE"
/
/	THIS ROUTINE DETERMINES WHETHER WE ARE TO
/	DO "TYPE [TO] HOST" OR "TYPE [TO] SCREEN" AND THEN
/	CALLS "TEXT" TO GET THE CHARACTERS TO BE SENT
/	OUT TO THE REQUESTED DESTINATION.
/
/
/
TYPE,	JMS	SKIPTO	/GET NEXT ATOM (SKIPPING OPTIONAL "TO")

	JMS	CMPSTR	/LOOK FOR "SCREEN" OR "HOST"
		SCRENS
		ATOM
	SKP
	JMP	TYPSLP	/"SCREEN" FOUND
	JMS	CMPSTR
		HOSTS
		ATOM
	JMP	ERR7	/NEITHER FOUND
/
/	DO TYPE HOST
	JMS	DRAINH	/DRAIN HOST INPUT BUFFER TO SCREEN OR BIT BUCKET
TYPHLP,	JMS	TEXTSC	/GO GET NEXT TEXT CHARACTER IN AC
	JMP	ERR10	/TEXT ERROR
	JMP	PARSER	/END OF TEXT ENCOUNTERED
	JMS	HSOUT	/PUT CHARACTER OUT TO HOST
	JMP	TYPHLP	/LOOP FOR NEXT
/
/	DO TYPE SCREEN
TYPSLP,	JMS	TEXTSC	/GO GET NEXT TEXT CHARACTER IN AC
/D022	JMP	TYPERR	/TEXT ERROR
/D022	JMP	TYPDON	/END OF TEXT ENCOUNTERED
/D022	SPA		/DON'T ALLOW BREAK OR DTR TO SCREEN
/D022	 JMP	TYPERR
/D022	JMS	TTADD	/ Add character to IOA buffer.
/D022	JMP	TYPSLP	/LOOP FOR NEXT

/D022TYPDON,	JMS	TTDISP	/ Display stored up buffer.
/D022	JMP	PARSER	/ Return to perser.

/
	JMP	ERR10	/ TEXT ERROR					/A022
	JMP	PARSER	/ END OF TEXT					/A022
	SPA		/ DON'T ALLOW BREAK OR DTR			/A022
	JMP	ERR10	/						/A022
	JMS	KBOUT	/ OUTPUT CHAR					/A022
	JMP	TYPSLP	/ LOOP FOR NEXT					/A022

ERR7,	JMS	ABORT;7	/MUST BE SCREEN OR HOST


/D022TYPERR,	JMS	TTDISP	/ Display stored up buffer.
ERR10,	JMS	ABORT;10/BAD TEXT ELEMENT

/	FETCH THE NEXT ATOM.
/	IF IT IS "TO", AND NOT THE LAST ATOM OF THE LINE,
/	IGNORE IT AND FETCH AGAIN.

SKIPTO,	XX
	JMS	GETATM	/GET NEXT ATOM
	JMS	SKIPBL	/MAKE SURE THIS ATOM IS NOT THE LAST ONE
	JMP I	SKIPTO	/EOL FOUND, SO DO NOT IGNORE "TO"

	JMS	CMPSTR	/CHECK FOR OPTIONAL "TO"
		TOS
		ATOM
	SKP		/NOT FOUND, SO RETURN
	JMS	GETATM	/IGNORE. GET NEXT ATOM
	JMP I	SKIPTO
/------------
	PAGE

/	"TEXTSCAN" - LOGON PROCESSOR TEXT HANDLER
/
/	JMS	TEXTSCAN
/	ERROR RETURN  (AC=0)
/	END OF TEXT RETURN  (AC=0)
/	NORMAL RETURN  (AC=NEXT TEXT CHARACTER)
/		(WARNING:  USES X3 WHILE IN MODE 3!)
/
/	ACCEPTABLE INPUTS VIA "NEXTCH":
/	CR (UPPER OR LOWER-CASE)
/	LF (DITTO)
/	BRK (DITTO)  (RETURNS 7401)
/	DTR (DITTO)  (RETURNS 7402)
/	OCTAL DIGIT STRINGS
/	'    TEXT    '
/	'~   TEXT    '
/	BLANKS OR TABS SURROUNDING ANY OF THE FOREGOING
/	& BETWEEN ANY OF THE FOREGOING
/	, AND EOL TERMINATING THE TEXT
/
TEMODE,	0
/
/	TEMODE IS USED TO KEEP TRACK OF THE CURRENT
/	STATE OF THE SCAN.  IT SHOULD START OUT AT 0.
/
/
/	DISPATCH TO THE PROPER ENTRY POINT
/	BASED ON THE VALUE OF ARG.
TEXTSC, XX
	TAD 	TEMODE	/GET -ARG
	TAD	(JMP I LOTABL)
	DCA	.+1;XX	/ Dispatch.

LOTABL,	TEXT0		/ MODE 0 --> Initial call.
	TEXT1		/ MODE 1 --> Not initial call, but not inside of a '
	TEXT2		/ MODE 2 --> Currently inside of a '
	TEXT3		/ MODE 3 --> Cureently inside of a '~

/	INITIAL CALL
TEXT0,	JMS	SKIPBL	/SKIP ANY LEADING BLANKS
	JMP	TEDXIT	/EOL FOUND TAKE DONE RETURN
	ISZ	TEMODE	/SET MODE TO 1
	JMP	TEXT11	/GO GET FIRST CHARACTER

TEXT25,	AC0001		/SET MODE TO 1
	DCA	TEMODE
/	JMP	TEXT1	/GO SEE WHAT (IF ANYTHING)
/	ROUTINE INITIALIZED, BUT NOT INSIDE OF A '
TEXT1,	JMS	SKIPBL	/SKIP ANY BLANKS
	JMP	TEDXIT	/EOL FOUND
	TAD	CHAR	/CHECK FOR  COMMA
	TAD	(-COMMA
	SNA
	JMP	TEDXIT	/TAKE THE DONE RETURN
	TAD	(COMMA-AMPERS	/CHECK FOR CONCATENATION &
	SZA CLA
	JMP	TEXT11	/GO GET NEXT TEXT ITEM
	JMS	NEXTCH	/SKIP OVER CONCATENATION
	JMS	SKIPBL
	JMP	TEEXIT	/EOL AFTER & IS AN ERROR
/
/	CHECK NEXT ITEM FOR ', OCTAL DIGITS, CR, LF
TEXT11,	TAD	CHAR
	TAD	(-SQUOTE	/IS IT '
	SNA
	JMP	TEXT16	/YES, CHECK FOR '~
	TAD	(SQUOTE-EIGHT	/CHECK FOR OCTAL DIGIT
	SMA
	JMP	TEXT14	/NOT OCTAL
	TAD	(EIGHT-ZERO
	SPA
	JMP	TEXT14	/NOT OCTAL DIGIT
	DCA	TEOCT	/SAVE BIT VALUE
/
/	WE ARE SCANNING ONE OR MORE OCTAL DIGITS
TEXT12,	JMS	NEXTCH	/LOOK FOR ANOTHER DIGIT
	TAD	CHAR
	TAD	(-EIGHT	/IS IT ANOTHER OCTAL
	SMA
	JMP	TEXT13	/NO
	TAD	(EIGHT-ZERO
	SPA
	JMP	TEXT13	/NO
	DCA	TEMP	/YES, COMBINE WITH PREVIOUS RESULTS
	TAD	TEOCT
	R3L		/MAKE ROOM FOR 3 MORE BITS
	TAD	TEMP	/AND PUT IN CURRENT VALUE
	DCA	TEOCT
	JMP	TEXT12
TEXT13,	CLA		/LAST OCTAL DIGIT IN.
	TAD	TEOCT	/RETURN COMPOSITE RESULT
	AND	P177
	JMP	TENXIT
/
/
/	CHECK FOR CR, LF, BRK, OR DTR
TEXT14,	JMS	GETELM	/GET WHATEVER ELEMENT COMES NEXT IN ATOM
	JMS	LISTBR	/BRANCH BY CONTENTS
		TXTLST
	JMP	TEEXIT	/NO MATCH FOUND. TAKE ERROR RETURN
/
/	ACTION ROUTINES
TCR,	TAD	(CR-LF		/CR
TLF,	TAD	(LF-7401	/LF
TBRK,	TAD	(7401-7402	/BREAK CODE
TDTR,	TAD	(7402		/DTR - HANGUP CODE
/	JMP	TENXIT	/RETURN TO CALLER
/
/	RETURN POINTS
TENXIT,	ISZ	TEXTSCAN	/NORMAL RETURN
	SKP
TEDXIT,	DCA	TEMODE		/DONE RETURN.  BACK TO MODE 0.
	ISZ	TEXTSCAN
TEEXIT,				/ERROR RETURN
	JMP I	TEXTSCAN
/
/
/	' FOUND. CHECK FOR '~
TEXT16,	ISZ	TEMODE	/SET MODE TO 2
	JMS	NEXTCH	/GET NEXT CHAR
	TAD	CHAR
	TAD	(-TILDA	/IS IT ~
	SNA CLA
	JMP	TEXT21	/YES, GO CHECK FOR '~'
/	JMP	TEXT2
/	CURRENTLY INSIDE OF A ' BUT NOT '~
TEXT2,	TAD	CHAR
	TAD	(-EOL
	SNA CLA
	JMP	TEEXIT	/TAKE ERROR EXIT ON EOL
	TAD	CHAR
	DCA	TEMP	/SAVE CURRENT CHAR
	TAD	CHAR
	TAD	(-SQUOTE	/CHECK FOR '
	SNA CLA
	JMP	TEXT20	/' FOUND. GO CHECK FOR ''
	JMS	NEXTCH	/GET NEXT CHARACTER
	TAD	TEMP	/RETURN THE CURRENT CHARACTER
	JMP	TENXIT
/
/	' FOUND. IT MAY BE THE LITERAL TERMINATOR
/	OR THE FIRST OF A '' PAIR TO BE TREATED
/	AS TEXT OF '.
TEXT20,	JMS	NEXTCH
	TAD	CHAR
	TAD	(-SQUOTE	/IS THE NEXT CHAR ' ALSO
	SZA
	JMP	TEXT25	/NO. WE HAD A ' TERMINATOR
	JMS	NEXTCH
	TAD	(SQUOTE	/YES, WE HAD ''. RETURN A SINGLE '
	JMP	TENXIT



/
/	ROUTINE TO DO A CR LF
/
CRLF,	XX
	CLA
	TAD	(CR
/D022	JMS	TTADD	/SEND CR
	JMS	KBOUT	/SEND CR					/A022
	TAD	(LF
/D022	JMS	TTADD	/SEND LF
	JMS	KBOUT	/SEND LF					/A022
	JMP I	CRLF
/------------
	PAGE

/
/	'~ HAS BEEN FOUND. IF IT IS '~' FOLLOWED BY
/	& OR , OR BLANK OR EOL WE WILL ACCEPT KEYBOARD TEXT AT ONCE	/A006
/	OTHERWISE WHAT FOLLOWS IT IS A PROMPT TO THE USER.			/A006
TEXT21,	JMS	NEXTCH
	TAD	CHAR	/CHECK NEXT CHARACTER
	TAD	(-EOL
	SNA
	JMP	TEEXIT	/ERROR IF IT WAS EOL
	TAD	(EOL-SQUOTE
	SZA CLA
	JMP	TEXT22	/PROMPT IF IT WAS NOT '
	JMS	NEXTCH	/SEE WHAT FOLLOWS '~'
	TAD	CHAR
	TAD	(-SQUOTE
	SNA
	JMP	TEXT22	/WE HAVE '~'' SO PROMPT SINGLE '
	TAD	(SQUOTE-SPACE	/CHECK BLANK
	SZA
	TAD	(SPACE-COMMA	/CHECK ,
	SZA
	TAD	(COMMA-AMPERS	/CHECK &
	SZA
	TAD	(AMPERS-EOL
	SZA CLA		/CHECK EOL
	JMP	TEEXIT	/ERROR IF '~' NOT FOLLOWED BY ONE OF THE ABOVE
	JMP	TEXT26	/GO GET USER KEYSTROKES WITHOUT PROMPTING	/A006
/
/	PROCESSING '~
/	SEND REST OF TEXT ITEM TO SCREEN AS A PROMPT
TEXT22,	TAD	CHAR
/D022	JMS	TTADD	/SEND CHAR
	JMS	KBOUT	/ SEND CHAR					/A022
	JMS	NEXTCH	/GET NEXT CHAR
	TAD	CHAR
	TAD	(-EOL	/IS IT EOL
	SNA CLA
/D022	 JMP	TEXT2E	/YES.  > ERROR
	JMP	TEEXIT	/ YES. > ERROR					/A022
	TAD	CHAR
	TAD	(-SQUOTE	/IS IT '
	SZA CLA
	JMP	TEXT22	/NO, GO DO ANOTHER
	JMS	NEXTCH	/YES, SEE WHAT FOLLOWS THE '
	TAD	CHAR
	TAD	(-SQUOTE
	SNA CLA
	JMP	TEXT22	/WE HAVE '', SO PROMPT WITH '
/D022	JMS	TTDISP	/ Display (via IOA), the prompt.		/A017
/D022	DCA	TTCHRS	/ Reset # of rubout-able chars.			/A017
/
/	WE HAVE REACHED THE PROMPT TERMINATOR,
/	ACCUMULATE THE RESPONSE IN TSTRNG.
TEXT26,	JMS	NULSTR	/INITIALIZE TSRTNG TO NULL				/M006
		TSTRNG
/D022	DCA	TTCHRS	/ Clear rubout character count.			/M017

/	CHECK THE FIRST RESPONSE CHAR & IF IT IS A RUBOUT
/	DO NOT ECHO THE RESPONSE ON THE SCREEN

	JMS	KBGET	/GET FIRST CHAR
	DCA	TEMP	/SAVE IT
	TAD	TEMP
	TAD	(-EDRBCH
	SZA CLA		/SKIP IF A RUBOUT
	JMP	TEXT28	/NOT RUBOUT, PROCEED NORMALLY
	TAD	(CLA)	/SET SWITCH TO NOT ECHO THIS TEXT
	DCA	ECHOSW

TEXT23,	JMS	KBGET	/GET A RESPONSE CHARACTER
	DCA	TEMP	/SAVE RESPONSE
TEXT28,	TAD	TEMP
	TAD	(-EDNWLN	/IS THIS THE END OF RESPONSE
	SNA CLA
	JMP	TEXT24	/YES, GO SEND IT OUT
	TAD	TEMP	/NO, CHECK FOR RUBOUT AND ECHO
	JMS	CHKRUB
		TSTRNG							/A022
/D022	TAD	TEMP	/NO, ADD CHARACTER TO STRING
	JMS	ADDSTR
		TSTRNG
	JMP	TEEXIT	/STRING FULL  > ERROR
	JMP	TEXT23	/GO BACK FOR MORE RESPONSE

/D022TEXT2E,	JMS	TTDISP	/ Display the prompt.			/A017
/D022	JMP	TEEXIT	/ Take error exit.				/A017
/
/	RESPONSE IS COMPLETE
TEXT24,	TAD	(SKP)	/SET ECHO SWITCH TO ECHO MODE
	DCA	ECHOSW
	JMS	CRLF	/ Echo CR-LF					/A017

	ISZ	TEMODE	/SET MODE TO 3
	TAD	(TSTRNG	/POINT TO STRING ROOT
	DCA	X3


/	SEND THE USER RESPONSE TO A ~ PROMPT
/	FROM TSTRNG, ONE CHARACTER AT A TIME

TEXT3,	TAD I	X3	/FETCH NEXT RESPONSE CHAR
	SZA		/END OF STRING
	JMP	TENXIT	/NO, RETURN CHARACTER
	AC0001		/SET ARG TO 1
	DCA	TEMODE
	JMP	TEXT1	/BACK TO MAIN TEXT SCAN
/
TEMP,	0
TEOCT,	0

/
/
/ 	 SCREEN LINES ARE USED AS FOLLOWS:
/ 0	date and time
/ 1	ENTER SEARCH KEY
/ 2	OR PRESS GOLD MENU TO RETURN TO THE MAIN MENU
/ 3	search key
/ 4	unused
/ 5	name selected
/ 6	phone number and dialing status
/ 7	unused
/10	PRESS ADVANCE OR BACKUP TO SEE ANOTHER ENTRY
/11	PRESS GOLD SEARCH TO ENTER A NEW SEARCH KEY
/12	PRESS GOLD MENU TO RETURN TO THE MAIN MENU
/13	TYPE CX TO DIAL AND ENTER CX
/14	TYPE LG TO DIAL AND ENTER LOGON
/15 +	MN1 FILE SELECTION TEXT AFTER THE USER TYPES LG
/
/

/	DISPLAY THE NAME AND NUMBER
DISPNM,	XX
	CIFMNU
	JMS I	IOACAL
		0
		NAMMSG
		1500
		0400
		NAME+1
		0500
		NUMBR+1
	JMP I	DISPNM



SHOOPT,	XX
	CIFMNU		/DISPLAY USER OPTIONS
	JMS I	IOACAL
		0
		OPTMSG
		0700
		1000
		1100
		1200
		MENMSG
	JMP I	SHOOPT
/------------
	PAGE

/
/	WAIT - LOGON PROCESSOR WAIT STATEMENT HANDLER
/
/	THE CURRENT ATOM IS "WAIT"
/
/	THIS ROUTINE DISCARDS OPTIONAL "FOR" AND CHECKS THE NEXT
/	ATOM FOR "KBD" OR "HOST" (IF NEITHER IS PRESENT THEN
/	THIS IS A SIMPLE TIME WAIT).  THE NEXT ATOM
/	IS THE TIME INTERVAL IN SECONDS.
/	THE NEXT ATOM IS THE GO TO TARGET FOR TIME
/	EXPRIATION (IF NOT PRESENT THEN THE NEXT STATEMENT
/	IS IMPLIED).  ANY REMAINING ITEMS WILL BE
/	TEXT / GO TO TARGET PAIRS (OF WHICH THERE MAY
/	BE UP TO FIVE).  THE TEXT IS LIMITED TO 25
/	CHARACTERS EACH.
/
/	WTMODE WILL BE SET TO 0 FOR TIME ONLY WAIT
/			      1 FOR WAIT HOST
/	                      2 FOR WAIT KBD
WTMODE,	0
/
WAIT,	JMS	GETATM	/GET NEXT ATOM

	JMS	CMPSTR	/CHECK FOR "FOR"
		FORS
		ATOM
	SKP		/SKIP IF NOT
	JMS	GETATM	/IGNORE. GET NEXT ATOM

	DCA	WTMODE	/SET WAIT MODE TO TIME ONLY
	DCA	WTNSTR	/CLEAR TEXT PAIRS COUNT
	JMS	CMPSTR	/CHECK NEXT ATOM
		HOSTS	/IS IT HOST?
		ATOM
	SKP
	JMP	WTHOST	/YES
	JMS	CMPSTR
		KBDS	/IS IT KBD
		ATOM
	JMP	WTT	/NOT KBD OR HOST. MUST BE TIME

/	WAIT KBD
/
	ISZ	WTMODE

/	WAIT HOST
/

WTHOST,	ISZ	WTMODE
	JMS	GETATM
WTT,	JMS	MOVSTR	/SAVE TIME INTERVAL
		ATOM
		WTTIME
	JMP	ERR11	/BAD TIME SPEC
/
/	TIME IS KEPT IN DOUBLE PRECISION
	DCA	WTSECL	/INITIALIZE TO 0
	DCA	WTSECH
	TAD	(WTTIME
	DCA	X1

/	CONVERT TO DP BINARY
WTCTL,	TAD I	X1
	SNA
	JMP	WTCTX	/END OF TIME STRING. GO LOOK AT TEXTS
	DCA	WTTMP
	TAD	WTTMP	/CHECK FOR NUMERIC
	TAD	(-NINE
	SMA SZA
	JMP	ERR11	/NOT NUMERIC
	TAD	(NINE-ZERO
	SPA
	JMP	ERR11	/NOT NUMERIC
	DCA	WTTMP


/	MULTIPLY PREVIOUS RESULT BY 10
	CLL
	TAD	WTSECL
	RAL
	MQL
	TAD	WTSECH
	RAL
	SWP
	RAL
	SWP
	RAL
	SWP
	TAD	WTSECL
	SWP
	SZL
	IAC
	TAD	WTSECH
	SWP
	RAL
	SWP
	RAL
	SWP
	TAD	WTTMP	/ADD IN NEW DIGIT
	DCA	WTSECL
	SWP
	SZL
	IAC
	TAD	WTSECH
	DCA	WTSECH
	JMP	WTCTL	/LOOP BACK FOR NEXT DIGIT

/	ALL DIGITS NOW CONVERTED
WTCTX,	TAD	WTSECH	/STORE -NUMBER OF SECONDS
	CMA CLL
	DCA	WTSECH
	TAD	WTSECL
	CIA
	DCA	WTSECL
	SZL
	ISZ	WTSECH
	SKP
	JMP	ERR11	/DON'T ALLOW WAIT 0
	JMS	NULSTR	/CLEAR TIME GO TO TARGET
		WTGO
	JMS	SKIPBC	/SKIP TABS, BLANKS AND COMMAS
	JMP	WTW	/EOL FOUND. GO WAIT
	JMS	GETATM	/GET TIME TARGET
	JMS	MOVSTR
		ATOM
		WTGO
	JMP	ERR4
	TAD	(WTSLST	/GET STRING LIST ADDRESS
	DCA	WTSPTR
	TAD	(WTGLST	/SET POINTER TO LIST OF TARGETS
	DCA	WTGPTR
	TAD	(WTXLST	/SET POINTER TO LIST OF STRING POSITIONS
	DCA	WTXPTR
	JMP	WTTL1	/GO GET TEXT STRING / TARGET PAIRS
/
ERR11,	JMS	ABORT;11

X=.
/------------
	PAGE

/
/	GATHER TEXT STRING / GO TO TARGET PAIRS
/
WTTL1,	JMS	SKIPBC	/SKIP DELIMITERS
	JMP	WTW	/EOL FOUND. GO WAIT
	TAD	WTMODE	/CHECK FOR TIME ONLY WAIT			/A013
	SNA CLA		/NO, WAIT HOST OR KBD				/A013
	JMP	ERR7	/YES, SHOULD NOT HAVE STRINGS			/A013
	TAD I	WTSPTR	/GET STRING ADDRESS
	SNA
	JMP	ERR12	/END OF LIST REACHED. TOO MANY PAIRS
	DCA	WTSS1
	TAD I	WTSPTR
	DCA	WTSS2
	TAD I	WTSPTR	/ADD TO LIST OF FIRST CHARACTERS
	IAC
	DCA I	WTXPTR
	ISZ	WTXPTR
	ISZ	WTSPTR
	TAD I	WTGPTR	/GET TARGET ADDRESS
	DCA	WTSS3
	TAD I	WTGPTR
	DCA	WTSS4
	ISZ	WTGPTR
	ISZ	WTNSTR	/BUMP COUNT OF TEXT STRINGS
	JMS	NULSTR	/CLEAR A TEXT STRING
WTSS1,	0	
WTTXL,	JMS	TEXTSCAN	/GO GET A TEXT CHARACTER
	JMP	ERR10
	JMP	WTETX	/END OF TEXT
	SPA		/DON'T ALLOW BREAK OR DTR
	JMP	ERR10
	DCA	WTTMP	/SAVE TEXT CHARACTER
	TAD	WTTMP
	SNA		/DON'T ALLOW NULLS
	JMP	ERR10
	TAD	(-177
	SNA CLA		/OR RUBOUTS
	JMP	ERR10
	TAD	WTTMP
	TAD	(-CR	/CHECK FOR CR
	SZA CLA
	JMP	WTTNCR	/NOT CR
	AC7776
	TAD	WTMODE	/CHECK FOR WAIT KBD
	SNA CLA		/SKIP IF NOT
	JMP	WTTCR	/WAIT KBD ... CR FOUND, DO NOT PUT ON STRING
WTTNCR,	TAD	WTTMP
	JMS	ADDSTR	/APPEND CHARACTER TO STRING
WTSS2,	0
	JMP	ERR4
	JMP	WTTXL	/GO GET ANOTHER
/
/	WAIT KBD ... CR FOUND. SHOULD BE THE END OF TEXT ITEM
WTTCR,	JMS	TEXTSCAN	/SYNTAX ERROR IF MORE TEXT AFTER A CR
	JMP	ERR10
	SKP
	JMP	ERR10
/
/	NOW GET THE TARGET ASSOCIATED WITH THE TEXT
WTETX,	JMS	NULSTR	/CLEAR TARGET
WTSS3,	0
	JMS	SKIPBC
	JMP	WTW	/EOL FOUND
	JMS	GETATM	/GET TARGET
	JMS	MOVSTR
	ATOM
WTSS4,	0
	JMP	ERR4
	JMP	WTTL1	/GO LOOK FOR ANOTHER PAIR
/
/	ALL TEXT / GO TO PAIRS ARE IN
WTW,	JMS	TIMER	/INITIALIZE THE SYSTEM TIMER
	AC7776
	TAD	WTMODE	/SEE WHAT KIND OF WAIT THIS IS
	SZA
	JMP	WTTIML	/NOT WAIT KBD. GO CHECK TIME.
/		WAIT KBD
	JMS	NULSTR	/INITIALIZE THE KEYBOARD STRING
		WTKBS
/D022	DCA	TTCHRS	/RESET KEYSTROKE COUNTER
	JMP	WTTIML	/START TIMING AND MONITORING THE KBD
/
ERR12,	JMS	ABORT;12

/D022TTADD, XX / Common routine to add character (from file) to IOA buffer.
/D022	DCA I	TYPPTR		/ Stuff character into buffer.
/D022	TAD I	TYPPTR		/ Get character back.
/D022	ISZ	TYPPTR		/ Bump buffer ptr.
/D022	TAD	(-LF)		/ Did we just output a LINE FEED?
/D022	SNA CLA			/ Skip if no. If yes, dump stored buffer.
/D022	 JMS	TTDUMP		/ Dump stored up buffer.
/D022	JMP I	TTADD		/ Return to caller.

/D022TTDUMP,	XX		/ Common routine to dump stored up buffer.
/D022	JMS	TTDISP		/ Display stored buffer (thus far).
/D022	TAD	(LINBUF)	/ Initialize buffer ptr.
/D022	DCA	TYPPTR		/  ...
/D022	DCA	TTCHRS	/ Reset # of characters in TT buffer (for Rubout).
/D022	JMP I	TTDUMP		/ Return to caller.

/D022TTDISP,	XX		/ Routine to display contents of stored buffer.
/D022	DCA I	TYPPTR		/ Set stopper.
/D022	CIFMNU			/ Call IOA to output what we've got thus far.
/D022	JMS I	IOACAL		/ ...
/D022		KBOUT		/ Use KBOUT routine to output (also check for HALT).
/D022		CSTRNG		/ Control string /^A/
/D022		CRSTRG		/ 1st output a CR.
/D022		LINBUF		/ where the actual text to output is.
/D022	JMP I	TTDISP		/ Return to caller.

/D022TTADDD,	XX			/ Called from IOACAL to output PUTMSG txt.	/A018
/D022	DCA	TTDISP		/ Save char.
/D022	RDF			/ Get return field.
/D022	TAD	CIDF0		/ Create a return CIF CDF instr.
/D022	DCA	TTADEX		/ Save for the exit.
/D022	CDFMYF			/ Map our field.
/D022	TAD	TTDISP		/ Get char to output.
/D022	SZA			/ Skip if the end.
/D022	 JMS	TTADD		/ if not the end then add to buffer.
/D022TTADEX,	XX			/ Return CIF CDF instruction.
/D022	JMP I	TTADDD		/ Return to caller.

FOFMES,	IFDEF ENGLSH  < TEXT	/&FILE &OPEN &FAILURE/>
	IFDEF ITALIAN < TEXT /&DOCUMENTO DI COLLEGAMENTO NON ESITENTE/>
	IFDEF V30NOR  < TEXT  '&KAN IKKE FINNE FIL'>			/A027
	IFDEF V30SWE  < TEXT '&FEL VID \VPPNING AV FIL'>
	IFDEF DUTCH   < TEXT '&FOUT BIJ OPENEN BESTAND'>
	IFDEF SPANISH < TEXT '&FALLO AL &ABRIR &FICHERO'>


/------------
	PAGE


/	UPDATE THE TIME LIMIT FOR THIS WAIT
/
WTTIML,	JMS	TIMER	/GET ELAPSED SECONDS
	CLL
	TAD	WTSECL	/APPLY TO LIMIT
	DCA	WTSECL
	SZL
	ISZ	WTSECH
	SKP
	JMP	WTTEXP	/TIME LIMIT HAS EXPIRED
/
	TAD	WTMODE	/CHECK KIND OF WAIT WE ARE DOING
	CIA
	SNA
	JMP	WTTIML	/TIME WAIT ONLY
	IAC
	SNA CLA
	JMP	WTH	/GO TO WAIT HOST
	JMP	WTK	/GO TO WAIT KBD
/
/	THE TIME LIMIT HAS EXPIRED
/
WTTEXP,	CLA
	TAD	(WTGO	/GET THE ADDRESS OF THE GO TO TARGET
	JMP	WTEXIT
WTXGO,	TAD	(WTGLST	/GET THE ADDRESS OF THE STRING'S TARGET
	TAD	WTNSTR
	TAD	WTSCTR
	DCA	WTTMP
	TAD I	WTTMP
WTEXIT,	DCA	WTTARG	/SAVE TARGET STRING ADDRESS
	TAD	WTTARG	/CHECK FOR NULL TARGET
	DCA	X1
	TAD I	X1
	SZA CLA
	JMP	WTTGO	/EXIT TO TARGET
	JMS	EOLINE	/NULL TARGET STRING. GO TO NEXT LINE
	JMP	PARSER
WTTGO,	JMS	MOVSTR	/MOVE TARGET STRING
WTTARG,	0
	GOTRGT
	JMP	ERR4
	JMP	GOT	/EXIT VIA THE GO PROCESSOR
WTTMP,	0
WTNSTR,	0
WTSCTR,	0
WTSECL,	0		/WAIT SECONDS, LOW ORDER
WTSECH,	0		/WAIT SECONDS, HIGH ORDER


/	WAIT KBD
WTK,	JMS	KBINPT	/GET A CHAR
	JMP	WTTIML
	DCA	WTKCH	/SAVE KEYBOARD CHARACTER
	TAD	WTKCH
	JMS	CHKRUB	/ECHO IT
		WTKBS							/A022
/D022	TAD	WTKCH	/IS IT CR
	TAD	(-EDNWLN
	SNA CLA
	JMP	WTKCR	/YES
	TAD	WTKCH	/NO, APPEND TO KEYBOARD STRING
	JMS	ADDSTR
	WTKBS
	JMP	ERR4
	JMP	WTTIML	/GO CHECK ON TIME AGAIN
/
/	CR FOUND. THE KEYBOARD ENTRY IS COMPLETE
WTKCR,	TAD	(LF	/CR FOUND. ADD A LF
	JMS	KBOUT
/
	TAD	WTNSTR	/CHECK NUMBER OF STRINGS TO MATCH
	SNA
	JMP	WTTIML	/NONE. GO CHECK TIME
	CIA		/SAVE -COUNT
	DCA	WTSCTR
	TAD	(WTSLST	/GET LIST OF STRING ADDRESSES
	DCA	WTKPTR
WTKCR2,	TAD I	WTKPTR	/GET A STRING ADDRESS
	DCA	WTKSAD
	JMS	CMPSTR	/CHECK FOR A MATCH
WTKSAD,	0
	WTKBS
	SKP
	JMP	WTXGO	/MATCH FOUND. GO TO THE TARGET LABEL
	ISZ	WTSCTR	/THIS STRING DID NOT MATCH. ARE THERE MORE
	JMP	WTKNXT	/YES, TRY NEXT
	JMS	NULSTR	/NO, CLEAR KEYBOARD STRING
	WTKBS
	JMP	WTTIML	/GO CHECK TIME AND WAIT FOR MORE KB INPUT
/
WTKNXT,	ISZ	WTKPTR	/BUMP TO NEXT STRING ADDRESS
	JMP	WTKCR2
WTKCH,	0
WTKPTR,	0

/
/	PUSH THE AC CHARACTER INTO A CIRCULAR BUFFER FOR
/	USE BY THE ABORT ERROR PROCESSOR.  DO IT
/	HERE RATHER THAN AT THE GETCHR LEVEL SO
/	THAT MISSING GO TARGETS DON'T WIPE OUT
/	THE EVIDENCE.
/
PUTBUF,	0
	DCA I	BUFPTR		/ Save character in character buffer.
	TAD	BUFPTR		/ Now to update buffer pointer.
	TAD	(-BUFEND)	/ See if currently at last buffer posn.
	SMA			/ Skip if not yet.
	TAD	(BUFBEG-BUFEND-1)	/ Re-orient to start of buffer.
	TAD	(BUFEND+1)	/ Bump ptr by 1.
	DCA	BUFPTR		/ Save ptr.
	JMP I	PUTBUF		/RETURN
/------------
	PAGE

/	WAIT HOST
WTH,	JMS	HSINPT	/WAIT HOST. GET A CHAR
	JMP	WTTIML	/NONE FOUND
	AND	P177	/KEEP ONLY 7 BITS
	SNA
	JMP	WTTIML	/SKIP NULLS
	DCA	WTHCHR	/SAVE CHARACTER
	TAD	WTHCHR
	JMS	SCROUT	/GO DISPLAY IF "SCREEN" IN EFFECT
/
/
/	LATEST CHARACTER FROM THE HOST IS IN WTHCHR.
/	CHECK FOR A MATCH WITH ANY OF THE TEXT STRINGS.
/	A LOWER CASE ALPHA STRING CHARACTER WILL MATCH
/	EITHER A LOWER OR UPPER CASE HOST CHARACTER
/	IN WTHCHR.
/
/
	TAD	WTNSTR	/GET NUMBER OF STRINGS TO BE CHECKED
	SNA
	JMP	WTTIML	/NO STRINGS. GO CHECK TIME LIMIT
	CIA
	DCA	WTSCTR
	TAD	(WTXLST	/INITIALIZE LIST POINTERS
	DCA	WTXPTR
	TAD	(WTSLST
	DCA	WTSPTR
WTXL1,	TAD I	WTXPTR	/GET ADDRESS OF A STRING CHARACTER
	DCA	WTADDR
	DCA	WTUCLC	/CLEAR THE UPPER/LOWER ADJUSTER
	TAD I	WTADDR	/GET THE CHARACTER
	TAD	(-172	/IS IT LOWER CASE
	SMA SZA
	JMP	WTNLC	/NO
	TAD	(172-141
	SPA CLA
	JMP	WTNLC	/NOT LOWER CASE
	TAD	(40	/STRING CHARACTER IS LOWER CASE
	DCA	WTUCLC	/STORE ADJUSTMENT
WTNLC,	CLA
	TAD I	WTADDR	/GET THE STRING CHARACTER AGAIN
	CIA
	TAD	WTHCHR	/DOES IT MATCH
	SZA
	TAD	WTUCLC
	SZA CLA
	JMP	WTXNO	/DOES NOT MATCH
	ISZ 	WTADDR	/MATCHES, BUMP TO NEXT CHARACTER IN STRING
	TAD I	WTADDR	/CHECK IF END OF STRING
	SNA CLA
	JMP	WTXGO	/YES. THIS STRING HAS BEEN MATCHED
	TAD	WTADDR	/NOT THE END YET. SET TO TEST NEW CHAR NEXT TIME
	DCA I	WTXPTR
	JMP	WTXNXT
/	THE LATEST CHARACTER DID NOT MATCH THE ONE
/	POINTED TO IN THIS STRING.  BACK UP OVER ANY
/	REPEATED SEQUENCES AND TRY AGAIN.  IF NO
/	REPEATS, RESET THE POINTER TO THE BEGINNING
/	OF THE STRING.
WTXNO,	TAD I	WTSPTR	/GET ADDRESS OF FIRST STRING CHAR
	IAC
	DCA	WTLOPS
	TAD	WTLOPS	/SEE IF WE ARE BEYOND FIRST CHAR
	CIA
	TAD	WTADDR
	SNA CLA
	JMP	WTXNXT	/NO, THE MISMATCH WAS AT THE BEGINNING
	TAD	WTLOPS	/GET ADDRESS OF SECOND CHAR
	IAC
	DCA	WTHIPS
WTXNO1,	TAD	WTHIPS	/CHECK IF UP TO CURRENT MISMATCH
	CIA
	TAD	WTADDR
	SNA CLA
	JMP	WTXNO4	/YES, NO MORE REPEATS TO CHECK
	TAD	WTLOPS	/INITIALIZE THE LOW RUNNING POINTER
	DCA	WTLOP
	TAD	WTHIPS	/INITIALIZE THE HIGH RUNNING POINTER
	DCA	WTHIP
WTXNO2,	TAD I	WTLOP	/GET A LOW CHARACTER
	CIA
	TAD I	WTHIP	/COMPARE TO A HIGH CHARACTER
	SNA CLA
	JMP	WTXNO3	/THEY MATCH, SO THIS MAY BE A REPEATED SEQUENCE
	ISZ	WTHIPS	/NO MATCH. TRY ONE FARTHER UP
	JMP	WTXNO1
WTXNO3,	ISZ	WTLOP	/BUMP BOTH RUNNING POINTERS
	ISZ	WTHIP
	TAD	WTHIP	/CHECK IF WE ARE UP TO THE CURRENT MISMATCH
	CIA
	TAD	WTADDR
	SZA CLA
	JMP	WTXNO2	/NO, KEEP GOING ON THIS REPEAT
	TAD	WTLOP	/COMPLETE REPEAT FOUND.
	DCA I	WTXPTR	/RESUME MATCHING AFTER IT
	JMP	WTXL1
WTXNO4,	TAD	WTLOPS	/NO REPEAT. POINT BACK TO STRING START
	DCA I	WTXPTR
	JMP	WTXL1	/TEST FOR MATCH THERE
WTXNXT,	ISZ	WTSCTR	/CHECK FOR MORE STRINGS TO TEST
	SKP
	JMP	WTTIML	/NONE. GO CHECK TIME LIMIT
	ISZ	WTXPTR	/POINT TO THE NEXT ONE
	ISZ	WTSPTR
	JMP	WTXL1
WTLOP,	0
WTLOPS,	0
WTHIP,	0
WTHIPS,	0
WTUCLC,	0
WTHCHR,	0
WTADDR,	0

/D025SCROLS,	TEXT	/^P!E^A&[2;24R^A&[?6H^P/	/SET SCROLL 2 TO 24
/D025SCROLR,	TEXT	/!X^A&[R!L!Y^A/	/RESET SCROLL
/------------
	PAGE

/
/		"DIAL" COMMAND.
/		PARSE OFF COMMA DELIMITED PHONE NUMBER TEXT
/		AND SEND TO THE DIALER.  IF NOT ANSWERED, TRY
/		THE NEXT NUMBER (IF ANY).  EXIT THROUGH ABORT
/		IF NO CALLS COMPLETED.


DIAL,	JMS	DRAINH	/CLEAR OUT THE COMM LINE
	JMS	NULSTR	/CLEAR OUT THE PHONE NUMBER
		NUMBR
	JMS	CRLF	/GET TO A FRESH LINE
	JMS	PUTMSG	/SHOW "DIALING"
		DIAMSG

DIGET,	JMS	TEXTSC	/GET A PHONE NUMBER CHARACTER
	JMP	ERR10	/SYNTAX ERROR
	JMP	DIGOT	/FULL NUMBER NOW FETCHED
	SPA		/DON'T ALLOW BREAK OR DTR
	JMP	ERR10
	DCA	T1

	TAD	T1	/DISPLAY IF "SCREEN" IN EFFECT
	JMS	SCROUT	/ Add to TT buffer (if SCREEN in effect).
/D022	JMS	TTDISP	/ Update screen.
	TAD	T1
	JMS	ADDSTR	/APPEND TO NUMBER
		NUMBR
	JMP	ERR4	/TOO BIG
	JMP	DIGET	/GO BACK FOR ANOTHER

DIGOT,	JMS	DIALER	/GO TRY DIALING THE NUMBER
	JMP	DINOA	/NOT ANSWERED
	JMS	EOLINE	/ANSWERED. SKIP REST OF LINE
	JMP	PARSE1	/BACK TO PARSE NEXT LINE

DINOA,	JMS	CRLF	/GET NEW LINE
	JMS	SKIPBC	/LOOK FOR ANOTHER NUMBER TO TRY
	SKP		/NONE
	JMP	DIAL	/BACK TO TRY AGAIN
	JMS	ABORT;14	/NO NUMBER ANSWERED. ABORT

/
/KBINPT
/
/CALL:	JMS	KBINPT
/	RETURN 1:  no char return point (AC set to 0)
/	RETURN 2:  char return in AC.
/
/	if no character, JWAIT  is executed before return.
/
KBINPT,	XX			/ entry point.
	CIFSYS			/ Map SYS field.
	XLTIN			/ Get keyboard input character.
	JMP	KBINP1		/ Take nothing exit.
	ISZ	KBINPT		/ Map return.
	TAD	(-EDTAB		/ Check for TAB
	SNA
	TAD	(ECTAB-EDTAB	/ Turn into a real TAB
	TAD	(EDTAB
	JMP	KBINP2		/ Return w/ character in AC.

KBINP1,	CIFSYS			/ Map sys field.
	JWAIT			/ Let others run.
KBINP2,	JMP I	KBINPT		/ Return to caller. w/ character (or 0) from XLTIN

/
/KBOUT
/
/CALL:	JMS	KBOUT		(AC = character to output)
/
/	character is output to terminal, JWAITing and checking HALT flag
/	as necessary. Return is made only after character is output.
/	This routine is made cross-field callable so that it may be used
/	as the output routine for IOA calls.
/
KBOUT,	XX			/ entry point.
	DCA	KBTEMP		/ Save character.
/D022	RDF			/ Get field of caller.
/D022	TAD	CIDF0		/ Make our return CIF CDF instr.
/D022	DCA	KBEXIT		/ Return to caller.
/D022	CDFMYF			/ back to our field.
KBOUT1,	TAD	KBTEMP		/ Get character to output.
	TAD	(-TAB		/ TAB ?					/A022
	SNA			/ NO					/A022
	TAD	(SPACE-TAB	/ CONVERT TABS TO SPACES		/A022
	TAD	(TAB		/ RESTORE CHAR				/A022
	CIFSYS			/ Map SYS field.
	TTYOU			/ output character.
	 SKP			/ Skip if couldn't.
	  JMP I	KBOUT		/ RETURN WHEN CHAR IS OUTPUTTED		/A022
/D022	  JMP	KBEXIT		/ Return when character is outputted.
	JMS	CHKHLT		/ Check HALT flag.
	CIFSYS			/ Map SYS field for JWAIT.
	JWAIT			/ Let others run.
	JMP	KBOUT1		/ Try again.

/D022KBEXIT,	XX			/ Set to return CIF CDF.
/D022	JMP I	KBOUT		/ Return to caller.

KBTEMP,	0			/ a temp for the char being output.

/
/HSINPT
/
/CALL:	JMS	HSINPT
/	RETURN 1:  no char return point (AC set to 0)
/	RETURN 2:  char return (AC set to 7 bit character).
/
/	additionally, if no character, JWAIT is executed before return.
/
HSINPT,	XX			/ entry point.
	JMS	CHKHLT		/ See if to be halted.
	CIFSYS			/ Map SYS field.
	HS2IN			/ Get character from HOST line.
	JMP	HSINP1		/ Take nothing exit.
	ISZ	HSINPT		/ Map return.
	JMP	HSINP2		/ Return w/ character in AC.

HSINP1,	CIFSYS			/ Map sys field.
	JWAIT			/ Let others run.
HSINP2,	JMP I	HSINPT		/ Return to caller. w/ character (or 0) from TTYIN

/
/HSOUT
/
/CALL:	JMS	HSOUT		(AC = character to output)
/
/	MAY DESTROY T1
/
/	character is output to terminal, JWAITing and checking HALT flag
/	as necessary. Return is made only after character is output.
/
HSOUT,	XX			/ entry point.
HSOUT1,	CIFSYS			/ Map SYS field.
	HS2OU			/ output character.
	SKP			/ Skip if couldn't.
	JMP I	HSOUT		/ Return upon success.
	DCA	T1		/ Save character.
	JMS	CHKHLT		/ Check HALT flag.
	TAD	T1		/ Get character back.
	CIFSYS			/ Map SYS field for JWAIT.
	JWAIT			/ Let others run.
	JMP	HSOUT1		/ Try again.

/
/CHKHLT
/
/CALL:	JMS	CHKHLT
/
/	If HALT FLAG is set, reset it and go to halt address.
/	Otherwise, return with AC=0.
/
CHKHLT,	XX			/ entry point.
	CLA			/ init AC.
	CDFSYS			/ Map SYS field.
	TAD I	HLTFLG		/ Get halt flag indicator.
	CDFMYF			/ Back to our field.
	SNA CLA			/ Skip if set.
	JMP I	CHKHLT		/ Return to caller.
	CDFSYS			/ Clear HLTFLG
	DCA I	HLTFLG
	CDFMYF
	JMP I	HALT		/ GOLD HALT HAS BEEN SENT

TIMMSG,	TEXT	/!X^A&[?6L^P^A!L^A&[?6H!Y/
CLRMSG,	TEXT	/^P!E/
/------------
	PAGE

/
/	SUBROUTINE TO DIAL A NUMBER
/
/	MOVE NUMBER TEXT TO ASCIIZ STRING "NUMBR"
/	JMS	DIALER
/	NOT ANSWERED RETURN
/	ANSWERED RETURN

DIALER,	XX
/D022	JMS	RSLNBF	/ RESET LINE BUFFER				/A021
	CDFMNU		/ CK FOR INTEGRAL MODEM ENABLED			/A016
	TAD I	(MUBUF+MNFMAT)	/					/A016
	CDFMYF		/						/A016
	AND	(MNFM4X	/						/A016
	SNA CLA		/ SKIP IF ENABLED				/A019
	JMP	IMODC1	/ NO - ASSUME DF03				/A019
	TAD	(4003	/ ISSUE ENABLE					/A019
	H2DTR		/						/A019
	CLA		/ MUST BE CLEARED				/A019
	LAS		/ CK IF THE MODEM IS PRESENT			/A019
	AND	(4000	/ BIT 0 IS MODEM BIT				/A019
	SNA CLA		/ 0 = ENABLED					/A019
	JMP	ADIMCK	/ YES - GO INIT., RET. AT IMODEX,		/A019
IMODC1,	JMS	DRAINH	/ NO - CLEAR INPUT BUFFER			/A016
	TAD	(CTLA	/ ASSUME DF03					/A016
	JMS	HSOUT	/						/A016
	JMS	WAIT1	/						/A016
	TAD	(CTLB	/						/A016
	JMS	HSOUT	/						/A016
	JMS	WAIT1	/						/A016
IMODEX,	TAD	(-43	/INITIALIZE A 35 SECOND WAIT			/M016
	DCA	SECNDS
	JMS	PUTMSG	/TELL USER TO BE PATIENT
		WATMSG
	TAD	(NUMBR	/POINT TO NUMBER
	DCA	X1
/	SEND DIGITS ONE AT A TIME
NUMLOP,	CLA
	TAD I	X1	/FETCH A CHARACTER
	SNA
	JMP	DIALWT	/LAST DIGIT SENT. WAIT FOR RESPONSE
	TAD	(-DASH	/CHECK FOR IGNORED CHARACTERS
	SZA
	TAD	(DASH-LPAR
	SZA
	TAD	(LPAR-RPAR
	SZA
	TAD	(RPAR-SPACE
	SNA
	JMP	NUMLOP	/IGNORE THIS CHAR AND GET ANOTHER
	TAD	(SPACE)		/ RESTORE CHAR				/A024

/D024	TAD	(SPACE-ESIGN	/CHECK FOR =
/D024	SZA
/D024	JMP	NUMTST	/GO CHECK FOR VALID DIGIT
/D024	TAD	(ESIGN	/= IS A VALID DELAY CHAR
/D024	JMP	SEND	/SEND IT OUT
/
/D024NUMTST,	TAD	(ESIGN-ZERO	/CHECK FOR VALID DIGIT
/D024	SPA
/D024	JMP	BADNUM
/D024	TAD	(ZERO-NINE
/D024	SMA SZA
/D024	JMP	BADNUM
/D024	TAD	(NINE

SEND,	JMS	HSOUT	/SEND DIGIT TO DIALER
	JMP	NUMLOP	/GO GET NEXT DIGIT


/	NUMBER HAS BEEN COMPLETELY DIALED. WAIT FOR ANSWER
DIALWT,	TAD	(43	/ # SIGN FOR INTEGRAL MODEM			/A016
	JMS	HSOUT	/						/A016

DIALW1,	JMS	CHKHLT	/CHECK FOR GOLD HALT
	JMS	TIMER	/WAIT 35 SECONDS AFTER START OF DIALING
	TAD	SECNDS
	DCA	SECNDS
	TAD	SECNDS
	SMA
	JMP	UNKOWN	/NO RESPONSE AT ALL
	JMS	HSINPT	/WAIT FOR A CHAR
	JMP	DIALW1	/NONE YET
	AND	(177	/ SEVEN BITS ONLY				/A016
	TAD	(-A	/IS IT A
	SMA		/						/A016
	SKP		/						/A016
	JMP	DIALW1	/ LESS THAN "A" DON'T CARE			/A016
	SNA		/ GREATER THAN "A" - CONTINUE			/A016
	JMP	ANSW	/YES. LINE ANSWERED
	TAD	(A-B	/IS IT B
	SNA		/ NO - CONTINUE					/M016
	JMP	DALBSY	/ YES - LINE IS BUSY				/A016
	TAD	(B-N	/ CK FOR "No"					/A016
	SNA		/ 						/A016
	JMP	NOANS	/ YES - 					/A016
	JMP	DIALW1	/ NO - GO BACK AND WAIT				/A016

/	LINE ANSWERED
ANSW,	JMS	WAIT1	/ WAIT FOR REST OF STRING			/A016
	JMS	DRAINH	/ CLEAR INPUT BUFFER				/A016
	JMS	PUTMSG	/TELL USER
		ANSMSG
	ISZ	DIALER	/TAKE SECOND RETURN

/	DIALING COMPLETED. RETURN SUCCESS OR FAILURE
DIALX,	JMS	WAIT1	/ALLOW A SECOND FOR USER TO SEE MESSAGE
	JMS	CRLF	/GET TO NEXT LINE ON SCREEN
	JMP I	DIALER
/
BADNUM,	JMS	PUTMSG	/BAD CHAR IN NUMBER. TELL USER
		BADMSG
	JMP	DIALX	/TAKE NO ANSWER RETURN
/
UNKOWN,	JMS	PUTMSG	/UNKNOWN RESPONSE FROM DIALER
		UNKMSG
	JMP	DIALX	/TAKE NO ANSWER RETURN
/------------
	PAGE

/
/ABORT
/
/CALL:	JMS	ABORT
/		n
/
/	 n is an argument indicating which error message to display.
/
/	 1 = FILE OPEN FAILURE
/	 2 = GOLD HALT DETECTED
/	 3 = MISSING END STATEMENT
/	 4 = ELEMENT TOO LONG
/	 5 = INVALID COMMAND
/	 6 = ABORT STATEMENT EXECUTION.
/	 7 = TYPE OR WAIT OBJECT NOT SPECIFIED				/A013
/	10 = INVALID TEXT ELEMENT
/	11 = INVALID TIME SPECIFICATION
/	12 = TOO MANY WAIT STRINGS
/	13 = MISSING GO/WAIT TARGET
/	14 = DIALING NOT COMPLETED
/	USES T1
/

ABORT,	XX			/ Entry point.
PURGEK,	JMS	KBINPT		/ Purge keystrokes
	SKP			/ Skip if none
	JMP	PURGEK		/ Loop for more
	CIFMNU			/ Map menu field.
	JMS I	IOACAL		/ Display start of message.
		0		/ No alternate routine for output.
		ABRMSG		/ Abortion message.
		0		/ Posn cursor to HOME.
		0424		/ Posn cursor to line 4 col 20.
	TAD I	ABORT		/ Get calling argument.
	TAD	(ABRTBL-1)	/ Index into message pointer table.
	DCA	T1		/ Get ptr to message address.
	TAD I	T1		/ Get Message address.
	DCA	ABRTL1		/ plop down.
	DCA	NOTYET		/ Init 'seen EOL' flag.			/A011
	TAD	ABRTL1		/ Check for ABORT 13
	TAD	(-GOWMES	/ Which has a different format message
	SZA CLA			/ Skip if GO/WAIT message
	JMP	ABRTT1		/ Jump for all other messages
	CIFMNU			/ Map menu display
	JMS I	IOACAL		/ Display the missing GO/WAIT label
		0
		GOWMES
		GOTRGT+1	/ Start of target name
	JMP	ABRTT2		/ Rejoin other messages
ABRTT1,	CIFMNU			/ Map IOACAL.
	JMS I	IOACAL		/ Display the reason
		0		/  to the screen.
ABRTL1,		XX		/ Set to message to display.
ABRTT2,	CIFMNU			/ Now display where the error occurred.
	JMS I	IOACAL		/  ...
		0		/ To the terminal
		DSPMSG		/  the message.
		0624		/  line 6, col 20
		LINCTR		/ ptr to the line #.
		1000		/ Where to put up the text.
	TAD	BUFPTR		/ Get ptr to saved text.
	DCA	T1		/ initialize bufptr.
	JMP	ABRTL3

ABRTL2,	TAD	T1		/ Check for doneness.
	CIA			/  ...
	TAD	BUFPTR		/   ...
	SNA CLA			/ Skip if not done.
	 JMP	ABRTL6		/ Jmp when done outputting saved text.
ABRTL3,	TAD	NOTYET		/ displaying yet?
	SNA CLA			/ Skip if yes.
	 JMP	ABRTL4		/ JMP if no.
	TAD I	T1		/ Get character to output.
	SNA			/ Skip if not null.
	JMP	ABRTL5		/ Jmp if null character. Go to next.
	JMS	KBOUT		/ Output character
ABRTL4,	TAD I	T1		/ Get character just output.
	SNA
	JMP	ABRTL9		/ Jump if null
	TAD	(-ECNWLN)	/ Check for NEW LINE.
	SZA CLA			/ Skip if yes.
	JMP	ABRTL5		/ NOPE! continue below.
	TAD	(CR)		/ get to start of next line.
	JMS	KBOUT
ABRTL9,	ISZ	NOTYET		/ time to display!!!
ABRTL5,	TAD	T1		/ Now check for buffer wrap.
	TAD	(-BUFEND)	/  ...
	SMA			/ Skip if not at end.
	TAD	(BUFBEG-BUFEND-1)	/ Wrap to start of buffer.
	TAD	(BUFEND+1)	/ ...
	DCA	T1		/ Save in register.
	JMP	ABRTL2		/ Go do next character.

ABRTL6,	TAD	NOTYET		/ Are we displaying
	SZA CLA			/ Skip if no. have to re-display.
	JMP	ABRTL7		/ Go finish up.
	ISZ	NOTYET		/ enable display.
	JMP	ABRTL3		/ Go re-display the text.
ABRTL7,	CIFMNU			/ Map menu.
	JMS I	IOACAL		/ Finish the display.
		0		/ No alternate output routine.
		FINMSG		/ Finish the display...
		2014		/ Line 16 col 12
		MENMSG
		2214		/ Line 18 col 12
ABRTLP,	JMS	KBGET		/ Look for RETURN or GOLD MENU
	TAD	(-EDMENU)	/ GOLD:MENU!!! return to Main Menu.
	SNA			/ Skip if no.
	JMP	RTNSY		/ JMP if yes!!! Back to Main Menu.
	TAD	(EDMENU-EDNWLN)	/ RETURN?
	SNA CLA			/ Skip if no. Report error.
	JMP	RTNCX		/ YES! Onward to CX.
	JMS	BEEPER		/ REPORT ERROR
	JMP	ABRTLP		/ Get another input.

/	ROUTINE TO UPDATE OUR DISPLAY OF THE DATE & TIME

DOTIME,	XX
	CIFPRT			/ Call FLABUZ in printer field.
	JMS I	(FLABUZ)	/  ... (display printer error if appropriate)
	CIFMNU			/ Now display updated time.
	JMS I	TIMCAL		/  ...
	JMP I	DOTIME		/ no time change. don't update display.
	JMS	CPYTIM		/ Copy new time values.
	CIFMNU			/ Now to update the screen.
	JMS I	IOACAL		/  ...
		0		/ output directly to the terminal.
		TIMMSG		/  ...
		ESCAPE
		0072		/ Line 1, col 59.
		DATTIM		/ Time/Date string.
		ESCAPE
	JMP I	DOTIME

NOTYET,	0			/ set to <> 0 when start displaying saved lines.

/
/	ROUTINE TO RING THE BELL
/
BEEPER,	XX
	CLA
	TAD	(BELL
	JMS	KBOUT
	JMP I	BEEPER
/------------
	PAGE



/	ROUTINE TO WAIT FOR A CHARACTER FROM THE KEYBOARD
/	AND RETURN IT IN THE AC. THE DATE AND TIME DISPLAY
/	WILL BE UPDATED WHILE WAITING.
/
KBGET,	XX
KBGETL,	JMS	DOTIME	/UPDATE DATE & TIME DISPLAY
	JMS	CHKHLT	/CHECK FOR GOLD HALT
	JMS	KBINPT	/GET THE NEXT KEYSTOKE IN THE AC
	JMP	KBGETL	/NOT FOUND
	JMP I	KBGET	/FOUND. RETURN CHAR IN AC

/
/	ROUTINE TO PUT THE AC ON THE SCREEN, TAKING
/	APPROPRIATE ACTION FOR RUBOUT.
/
/
/	ROUTINE TO PUT THE AC ON THE SCREEN, TAKING
/	APPROPRIATE ACTION FOR RUBOUT.
/
CHKRUB,	XX
	DCA	GTTEMP		/ Save incoming char.
	TAD I	CHKRUB		/ Get string pointer.
	DCA	CHKPTR		/ Save for positioning the pointers.
	ISZ	CHKRUB		/ Bump to actual return.
ECHOSW,	SKP			/ SET TO (CLA) WHEN USER WANTS NO ECHOING/A022
	JMP	CHKXIT		/ RETURN IF ECHO IS OFF			/A022
CKRUB1,	ISZ	CHKPTR		/ Bump string pointer.
	TAD I	CHKPTR		/ Get next char of string.
	SZA CLA			/ Skip if not at string end yet.
	 JMP	CKRUB1		/ Keep looping until just after last char.
	TAD	GTTEMP		/ Get char back.
	TAD	(-EDRBCH	/ RUB CHAR?
	SNA			/ Skip if no.
	 JMP	GTRBCH		/ JMP if so. Rubout the last character.
	TAD	(EDRBCH-EDRBWD	/ RUB WORD?
	SNA			/ Skip if no.
	 JMP	GTRBWD		/ JMP if so. Rubout the last word.
	TAD	(EDRBWD		/ Restore the character.
	JMS	KBOUT		/ Display (echo) the character.
CHKXIT,	TAD	GTTEMP		/ Get character.
	JMP I	CHKRUB		/ return to caller.

/
/	GTRBCH - RUBOUT A CHARACTER.
/
GTRBCH,	JMS	GTRBCR		/ CALL RUB CHAR
CKBEEP,	 JMS	BEEPER		/ NO CHARACTERS TO RUBOUT
	JMP	CHKXIT		/ Something successfully rubbed out. exit.

/
/	GTRBWD - RUBOUT A WORD
/
GTRBWD,	JMS	GTBKCR		/ Get character one back from here
	TAD	(-40)
	SMA SZA CLA		/ Skip if a space or less (ie not a character).
	 JMP	GTRBW2		/ found a character (start of word).
	JMS	GTRBCR		/ Rub out leading spaces, tabs, etc.
	 JMP	CHKXIT		/ Line empty return.
	JMP	GTRBWD		/ do rest of leading spaces, tabs, etc.
GTRBW2,	JMS	GTBKCR		/ Get character one back from here
	TAD	(-40)
	SMA SZA CLA		/ Skip if not a word character.
	 JMS	GTRBCR		/ Rub out a character of word.
	  JMP	CHKXIT		/ Line empty, so done.
	JMP	GTRBW2		/ check out next (preceding) character.

/
/	GTRBCR - RUB A CHARACTER
/		 IF THERE ARE NO CHARS IT WILL DO A NON SKIP RETURN
/		 IF DID RUB OUT SOMETHING THEN A NORMAL (2ND) RETURN
/
GTRBCR,	XX
	AC7777			/ Decrement the character pointer.
	TAD	CHKPTR
	DCA	CHKPTR
	TAD I	CHKPTR		/  ...
	SPA CLA			/ Skip if there's a char to rubout.
	 JMP I	GTRBCR		/ Take MT return.
	ISZ	GTRBCR		/ Bump to successful return.
	TAD	(BSPACE		/ OUTPUT BS SP BS
	JMS	KBOUT		/
	TAD	(SPACE		/
	JMS	KBOUT		/
	TAD	(BSPACE		/
	JMS	KBOUT		/
	JMP I	GTRBCR		/ Return

GTBKCR,	XX
	AC7777			/ Back up the char pointer.
	TAD	CHKPTR		/  ...
	DCA	T1		/   ....
	TAD I	T1		/  ...
	SMA			/ Skip if buffer MT.
	 JMP I	GTBKCR		/ Return w/ prior character.
	JMP	CKBEEP		/ Buffer MT. Report error & take early return.

GTTEMP,	0			/ Temp.
CHKPTR,	0			/ Pointer into string that holds prior (echoed) text.

/
/	ROUTINE TO DRAIN TEXT FROM TTHE HOST.
/	PUT IT ON THE SCREEN IF "SCREEN" IN EFFECT;
/	OTHERWISE THROW IT AWAY.
/

DRAINH,	XX
DRLOOP,	JMS	HSINPT	/SEE IF ANYTHING IN HOST BUFFER
	JMP I	DRAINH							/A022
/D022	JMP	DREXIT	/ Update screen & return if not.
	JMS	SCROUT	/GO DISPLAY OR DISCARD
	JMP	DRLOOP	/GO CHECK FOR MORE

/D022DREXIT,	JMS	TTDISP	/ Update screen.			/A017
/D022	JMP I	DRAINH	/ Return to caller.				/A017




/	ROUTINE TO PUT THE AC ON THE SCREEN IF
/	"SCREEN" IS IN EFFECT.

SCROUT,	XX
SCRNSW,	NOP		/CHANGED TO SKP CLA FOR "NOSCREEN"
	 JMS	KBOUT							/A022
/D022	 JMS	TTADD	/ Add char to display buffer.			/M017
	JMP I	SCROUT


/	ROUTINE TO PUT THE NEXT CHARACTER FROM THE
/	FILE INTO CHAR.
/	IF NEXTSW IS NOP, PUSH CHAR INTO THE ERROR
/	MESSAGE BUFFER.  IF IT IS SKP, DO NOT DO
/	THIS SO THAT THE USER WILL SEE THE GO/WAIT
/	THAT COULD NOT BE SATISFIED.
/
NEXTCH,	0
	JMS	GETCHR	/GET NEXT FILE CHARACTER
	JMP	ERR13	/END OF FILE REACHED
	DCA	CHAR
	TAD	LINBMP		/ Start of new line?
	SZA CLA
	ISZ	LINCTR		/ Yes, bump line number
	DCA	LINBMP
	TAD	T1		/ Get character.
	AND	P177		/ Check for line terminator.
	TAD	(-ECNWLN)	/ this is one set,
	SZA			/ SKip if yes.
	TAD	(ECNWLN-ECNWPG)	/ this one's the other set.
	SNA CLA			/ Skip if not line terminator.
	ISZ	LINBMP		/ Set to bump line counter.
NEXTSW,	SKP CLA			/CHANGED TO NOP DURING GO/WAIT TARGET SEARCHES
	JMP I	NEXTCH
	TAD	CHAR		/PUT CHAR IN ERROR MESSAGE BUFFER
	JMS	PUTBUF
	JMP I	NEXTCH
/
ERR13,	TAD	GOWLIN		/RECOVER LINE NUMBER OF GO OR WAIT
	DCA	LINCTR		/RESTORE TO LINE COUNTER
	JMS	ABORT;13	/MISSING GO/WAIT TARGET
/
LINBMP,	0

X=.
/------------
	PAGE

/	ROUTINE TO GET THE NEXT ATOM.
/	ATOMS ARE ELEMENTS (SEE BELOW) THAT MAY
/	INCLUDE (IE ARE NOT TERNIMATED BY) & CHARACTERS.
/	THIS IS BECAUSE WE DIDN'T EXCLUDE & IN LABELS
/	IN THE DISTRIBUTED DOCUMENTATION.
/

GETATM,	XX
	JMS	GETELM	/GO GET NEXT ELEMENT
	TAD	CHAR	/CHECK DELIMITER FOR &
	TAD	(-AMPERS
	SZA CLA
	JMP I	GETATM	/NOT & SO RETURN ELEMENT AS ATOM
	JMP	GETELN	/GO BACK AND ADD TO CURRENT ELEMENT
			/UNTIL IT IS NOT DELIMITED BY &.
/
/
/
/	ROUTINE TO GET THE NEXT ELEMENT IN ATOM.
/	ELEMENTS ARE DELIMITED BY BLANK, TAB, COMMA,
/	COLON, AMPERSAND, SLASH OR EOL.
/	THE DELIMITER IS RETURNED IN CHAR.
/
GETELM,	XX
	JMS	NULSTR	/CLEAR THE ATOM
		ATOM
	JMS	SKIPBL	/GET TO FIRST CHARACTER
	JMP I	GETELM	/EOL FOUND
GETELL,	TAD	CHAR
	TAD	(-SPACE	/CHECK FOR TERMINATORS
	SZA
	TAD	(SPACE-TAB
	SZA
	TAD	(TAB-COMMA
	SZA
	TAD	(COMMA-COLON
	SZA
	TAD	(COLON-AMPERS
	SZA
	TAD	(AMPERS-SLASH
	SZA
	TAD	(SLASH-EOL
	SNA CLA
	JMP I	GETELM	/ATOM COMPLETE
GETELN,	TAD	CHAR
	JMS	ADDSTR	/APPEND CHAR TO ATOM
		ATOM
	JMP	ERR4
	JMS	NEXTCH	/GET NEXT CHARACTER
	JMP	GETELL	/GO TEST IT FOR TERMINATORS


/
/
/	ROUTINE TO CHECK ATOM AGAINST TEXT STRINGS AND BRANCH
/	TO THE ADDRESS ASSOCIATED WITH A MATCH.
/
/	JMS	LISTBR
/		LIST
/	NO MATCH RETURN  (AC=0)
/	MATCH RETURN  (AC=0)
/	.
/	.
/	.
/LIST,	ADDRESS OF TEXT1;MATCH ADDRESS1;
/	.
/	.
/	.
/	ADDRESS OF TEXTn; MATCH ADDRESSn;
/	0
/
LISTBR,	XX
	AC7777
	TAD I	LISTBR	/GET ADDRESS OF LIST
	DCA	X0
	ISZ	LISTBR

LSTCMP,	TAD I	X0	/CHECK FOR END OF LIST
	SNA
	JMP I	LISTBR	/END. WE DIDN'T RECOGNIZE THIS ATOM
	DCA	LSTADD
	TAD I	X0	/GET ROUTINE ADDRESS
	DCA	LSTXIT
	JMS	CMPSTR	/CHECK IF ATOM IS A MATCH
LSTADD,		0
		ATOM
	JMP	LSTCMP	/NOT A MATCH. GO TEST NEXT CANDIDATE
	JMP I	LSTXIT	/MATCHED. GO TO PROCESSING ROUTINE
LSTXIT,	0

/
/	ROUTINE TO SKIP TO A SCANNABLE CHARACTER
/	I.E. IF CHAR IS BLANK OR TAB CALL NEXTCH UNTIL IT IS NOT.
/	IF CHAR IS /, REST OF LINE IS A REMARK - SKIP IT.
/	IF AT EOL TAKE THE FIRST RETURN;
/	OTHERWISE TAKE SECOND RETURN

/	JMS	SKIPBL
/		EOL RETURN  (AC=0)
/		NORMAL RETURN  (AC=0)

SKIPBL,	XX
SK1,	CLA
	TAD	CHAR	/GET  CHAR
	TAD	(-SPACE	/SKIP BLANKS AND TABS
	SZA
	TAD	(SPACE-TAB
	SZA
	JMP	SK2
	JMS	NEXTCH
	JMP	SK1
SK2,	TAD	(TAB-SLASH
	SNA CLA
	JMS	EOLINE	/SKIP ALL OF REMARK
	TAD	CHAR	/CHECK FOR EOL
	TAD	(-EOL
	SZA CLA		/FOUND. TAKE FIRST RETURN
	ISZ	SKIPBL	/TAKE NORMAL RETURN
	JMP I	SKIPBL
/
/	SKIP OVER COMMAS AS WELL AS CHARACTERS
/	SKIPPED BY SKIPBL
/	TAKE FIRST RETURN IF EOL ENCOUNTERED,
/	OTHERWISE RETURN TO SECOND LOCATION
/	WITH NEXT NON-BLANK, NON-COMMA IN "CHAR"
/
SKIPBC,	XX
SKIPCL,	JMS	SKIPBL	/SKIP BLANKS AND TABS
	JMP I	SKIPBC	/TAKE EOL RETURN

	TAD	CHAR
	TAD	(-COMMA	/ARE WE AT A COMMA
	SZA CLA
	JMP	SKIPCX	/NO, EXIT
	JMS	NEXTCH	/YES, FETCH NEXT CHARACTER
	JMP	SKIPCL	/NOW CHECK AGAIN
SKIPCX,	ISZ	SKIPBC	/TAKE NORMAL RETURN
	JMP I	SKIPBC


/	ROUTINE TO MAKE SURE CHAR IS EOL
/
EOLINE,	XX
EL1,	CLA
	TAD	CHAR	/IS CHAR EOL
	TAD	(-EOL
	SNA CLA
	JMP I	EOLINE	/YES
	JMS	NEXTCH	/NO, GET NEXT AND TEST AGAIN
	JMP	EL1



CPYTIM,	XX			/ Routine to copy the DATE & TIME string
	AC7777			/ less 1 for index registers
	CDFMNU			/ From the menu field to our field.
	TAD I	(DATESP)	/ This will get the address of the string.
	DCA	X0		/ Set from pointer.
	TAD	(DATTIM-1)	/ Where we will put it.
	DCA	X1		/  ...
CPYTM1,	CDFMNU			/ Map where to get from.
	TAD I	X0		/ Get Date & Time character.
	CDFMYF			/ Back to us.
	SNA			/ Skip if not at end of string.
	 JMP I	CPYTIM		/ Return to caller when done.
	DCA I	X1		/  ...
	JMP	CPYTM1		/ Loop until done the copy.

	/ "No Answer" RESPONSE FROM MODEM				/A016

NOANS,	JMS	PUTMSG		/ TELL USER				/A016
		NASMSG		/					/A016
	JMP	DIALX		/ TAKE NO ANSWER RETURN			/A016

/	LINE IS BUSY

DALBSY,	JMS	PUTMSG	/TELL USER
		BSYMSG
	JMP	DIALX	/WAIT A SECOND AND TAKE FIRST RETURN
/------------
	PAGE

/
/GETCHR
/
/CALL:	JMS	GETCHR
/	ERROR RETURN/END-FILE RETURN
/	NORMAL RETURN
/	AC = CHARACTER ON RETURN.
/	     IF ERROR, AC IS NEGATIVE; IF E-O-F, AC IS 0.
/
/	Characters are read from the LOGON file, one at a time, and
/	stripped/ignored as follows:
/		modified flags		ignored
/		dead-key seqs		ignore start & end sequence chars
/		hard return		passed thru
/		soft return		ignored
/		page markers		ignored
/		soft spaces		ignored
/		paragraph marker	turn into hard return
/		centered line		turn into hard return
/		select point		ignore
/		position marker		ignore
/		justification marker	ignore
/		ruler			ignore in entirty
/		normal chars		strip attributes
/
/	Additionally, the 1st time E-O-F is encountered, an end-of-line
/	is returned. Thereafter, return is made to the E-O-F/ERROR return.
/
GETCHR,	XX			/ Routine to return next char from file.
	JMS	CHKHLT		/ See if HALT FLAG is set. Return only if no.
	TAD	EOF		/ See if E-O-F has been detected.
	SZA CLA			/ Skip if no. Continue processing.
	 JMP	GOTEND		/ Take E-O-F return w/ zero AC.
GETCH1,	JMS	DOCHAR		/ Get a character.
	DCA	T1		/ Save character.
	TAD	T1		/ Get character.
	AND	P177		/ Isolate character bits.
	TAD	(-ECSPC)	/ bigger than a space?
	SMA SZA			/ Skip if no.
	 JMP	GOTCHR		/ Jmp if yes. return char minus attributes.
	CLA			/ Get origional char back.
	TAD	T1		/  ...
	TAD	(-ECMDFL)	/ Line modified?
	SZA			/ Skip if yes. Ignore.
	TAD	(ECMDFL-ECRMFL)	/ RULER modified?
	SZA			/ Skip if yes. Ignore.
	TAD	(ECRMFL-ECSTOV)	/ Start of DEAD-KEY sequence?
	SZA			/ Skip if yes. Ignore.
	TAD	(ECSTOV-ECNDOV)	/ End of DEAD-KEY sequence?
	SZA			/ Skip if yes. Ignore.
	TAD	(ECNDOV-ECNWPG)	/ NEW PAGE marker?
	SZA			/ Skip if yes. Ignore.
	TAD	(ECNWPG-ECPMRK)	/ PAGE marker?
	SZA			/ Skip if yes. Ignore.
	TAD	(ECPMRK-ECJSPC)	/ Justifing space?
	SZA			/ Skip if yes. Ignore.
	TAD	(ECJSPC-ECWWLN)	/ Wrapped line?
	SZA			/ Skip if yes. Ignore.
	TAD	(ECWWLN-ECHYLN)	/ Wrapped line w/ hyphen?
	SZA			/ Skip if yes. Ignore.
	TAD	(ECHYLN-ECSLPT)	/ Select point?
	SZA			/ Skip if yes. Ignore.
	TAD	(ECSLPT-ECTMRK)	/ position marker?
	SZA			/ Skip if yes. ignore.
	TAD	(ECTMRK-ECCMRK)	/ REJUST posn marker?
	SNA			/ Skip if no.
	JMP	GETCH1		/ Ignore character.
	TAD	(ECCMRK-ECSPC)	/ SPACE character?
	SNA			/ skip if no.
	 JMP	GOTCHR		/ return SPACE character.
	TAD	(ECSPC-ECTAB)	/ TAB character?
	SNA			/ Skip if no.
	JMP	GETCH4		/ return TAB
	TAD	(ECTAB-ECNWLN)	/ check for HARD return,
	SZA			/ skip if yes.
	TAD	(ECNWLN-ECPGRF)	/ PARAgraph marker.
	SZA			/ Skip if yes.
	TAD	(ECPGRF-ECENLN)	/ and CENTERED line.
	SNA			/ skip if none-of-the-above.
	 JMP	GETCH3		/ Turn them into HARD returns.
	TAD	(ECENLN-ECPCT1)	/ Start PRINT CONTROL?
	SNA			/ Skip if no.
	 JMP	GETCHA		/ Jmp if yes. process Print Control block.
	TAD	(ECPCT1-ECSTRL)	/ Start of ruler?
	SZA			/ Skip if yes. Skip to end of ruler.
	JMP	GETCH1		/ other wise ignore character.

GETCH2,	JMS	DOCHAR		/ Get next character from file.
	TAD	(-ECNDRL)	/ END-OF-RULER?
	SNA CLA			/ Skip if no. ignore character & try next.
	 JMP	GETCH1		/ Done PC/RULER. Process next character.
	JMP	GETCH2		/ we are still in PC or RULER. loop.

GETCHA,	JMS	DOCHAR		/ Get next character from disk file.
	TAD	(-ECPCT2)	/ END-OF-PRINT-CONTROL?
	SNA CLA			/ Skip if no. ignore character & try next.
	 JMP	GETCH1		/ Done PC/RULER. Process next character.
	JMP	GETCHA		/ we are still in PC or RULER. loop.


EOLERR,	CLA			/ return HARD return 1st time.
ERRXIT,	ISZ	EOF		/ Set E-O-F flag for next time.
GETCH3,	TAD	(ECNWLN-ECTAB)	/ Return HARD return.
GETCH4,	TAD	(ECTAB-ECSPC	/ Return TAB character
GOTCHR,	TAD	(ECSPC)		/ Turn back into a character.
	ISZ	GETCHR		/ take normal (skip) return.
GOTEND,	JMP I	GETCHR		/ Return w/ AC=character.

/	ROUTINE TO GET THE NEXT CHARACTER FROM THE
/	CURRENT DOCUMENT. FOR LOGON DOCUMENTS THIS
/	INVOLVES A READ-ONLY FETCH VIA XRDFIN.
/	FOR PHONE DIRECTORIES WE DO READ-WRITE
/	FETCHES: XGETET FOLLOWED BY XPUTST FOR
/	FORWARD FETCHES, AND XGETST FOLLOWED BY
/	XPUTET FOR BACKWARD FETCHES.


DOCHAR,	XX
	CIFFIO
	FILEIO
GETOP,	XX			/ GET A CHARACTER
	SPA SNA			/ Skip if got a character.
	JMP	EOLERR		/ Take end exit.
	DCA	T1
	TAD	GETOP		/ IS THIS READ-ONLY?
	TAD	(-XRDFNC
	SNA
	JMP	DOCRET		/ YES

/	CHANGE XGETET TO XPUTST OR XGETST TO XPUTET
	IFNZRO	XRDFNC-7 <NEXT 2 LINES DEPEND ON THIS VALUE>
	IFNZRO	XGETET-4 <NEXT 2 LINES DEPEND ON THIS VALUE>
	IFNZRO	XPUTST-3 <NEXT 2 LINES DEPEND ON THIS VALUE>
	IFNZRO	XGETST-2 <NEXT 2 LINES DEPEND ON THIS VALUE>
	IFNZRO	XPUTET-5 <NEXT 2 LINES DEPEND ON THIS VALUE>
	CIA			/ NO, MAKE WRITE-BACK OPERATOR
	DCA	PUTOP
	TAD	T1		/ PUT CHARACTER BACK IN FILE
	CIFFIO
	FILEIO
PUTOP,	XX			/ WRITE THE CHARACTER BACK
DOCRET,	TAD	T1		/ Get character to return.
	JMP I	DOCHAR		/ return to caller w/ character in AC.

/
/	ROUTINE TO PUT A TEXT MESSAGE AT THE CURRENT
/	CURSOR POSITION.
/
PUTMSG,	XX
	CLA
	TAD I	PUTMSG	/GET ADDRESS OF TEXT
	DCA	PUTMA
	ISZ	PUTMSG
	CIFMNU
	JMS I	IOACAL	/SEND TO IO
		0							/A022
/D022		TTADDD	/ add to TT buffer.
PUTMA,		XX
/D022	JMS	TTDISP	/ display tt buffer.
	JMP I	PUTMSG
/------------
	PAGE

/
/ADDSTR - ADD A 7-BIT CHARACTER TO AN ASCIIZ STRING
/THESE ASCIIZ STRINGS START WITH A WORD
/CONTAINING THE NEGATIVE COUNT OF THE NUMBER
/OF WORDS RESERVED FOR THE STRING (INCLUDING
/THAT ONE).  SO, THE MAXIMUM NUMBER OF
/CHARACTERS IT CAN CONTAIN IS COUNT-2.
/
/RUBOUT CHARACTERS ARE PROPERLY HANDLED.
/
/	PUT CHARACTER TO BE ADDED IN THE AC
/	JMS	ADDSTR
/	ADDRESS OF STRING
/	"STRING FULL" RETURN (CHARACTER NOT ADDED)
/	NORMAL RETURN
/		(AC=0 FOR EITHER RETURN)
/
/
ADDSTR,	XX
	DCA	ADDCHR		/SAVE THE CHARACTER
	TAD I	ADDSTR		/ Get string address.
	DCA	ADDDST		/ Save.
	ISZ	ADDSTR		/ point to 1st return.
	TAD I	ADDDST		/ Get -max count.
	SMA			/ check for negative.
	JMP	ADDERR		/ bad string. take error return.
	IAC			/ compute negative of one less than size.
	DCA	ADDLEN		/  ...
	DCA	MAXLEN		/ Init string size.
ADDLOP,	ISZ	MAXLEN		/ Count size+1 of string.
	ISZ	ADDDST		/ Bump to next char posn.
	TAD I	ADDDST		/ Check for zero stopper.
	SZA CLA
	 JMP	ADDLOP
	TAD	ADDCHR		/ Check for RUBOUT request.
	TAD	(-EDRBCH
	SNA			/ Skip if not RUBCHR
	 JMP	ADRBCH		/ Process RUBCHR.
	TAD	(EDRBCH-EDRBWD)	/ How 'bout RUBWRD?
	SNA CLA			/ Skip if not RUBWRD.
	 JMP	ADRBWD		/ Process RUBWRD.
	TAD	MAXLEN		/ Get current size.
	TAD	ADDLEN		/ Compare to negative of max size.
	SMA CLA			/ If >= 0 then string already at max size.
	 JMP I	ADDSTR		/ no more room.
	TAD	ADDCHR		/ get character to add
	AND	P177
	DCA I	ADDDST		/ store char in string.
	ISZ	ADDDST		/ Bump to stopper.
	DCA I	ADDDST		/ set stopper in string.
ADDRET,	ISZ	ADDSTR		/ Take normal return.
ADDERR,	CLA
	JMP I	ADDSTR

/
/	ADRBCH - RUBOUT A CHARACTER.
/
ADRBCH,	JMS	ADRBCR		/ CALL RUB CHAR
	 NOP			/ Ignore beginning of buffer.
	JMP	ADDRET		/ Something successfully rubbed out. exit.

/
/	ADRBWD - RUBOUT A WORD
/
ADRBWD,	JMS	ADBKCR		/ Get character one back from here
	TAD	(-40)
	SMA SZA CLA		/ Skip if a space or less (ie not a character).
	 JMP	ADRBW2		/ found a character (start of word).
	JMS	ADRBCR		/ Rub out leading spaces, tabs, etc.
	 JMP	ADDRET		/ Line empty return.
	JMP	ADRBWD		/ do rest of leading spaces, tabs, etc.
ADRBW2,	JMS	ADBKCR		/ Get character one back from here
	TAD	(-40)
	SMA SZA CLA		/ Skip if not a word character.
	 JMS	ADRBCR		/ Rub out a character of word.
	  JMP	ADDRET		/ Line empty, so done.
	JMP	ADRBW2		/ check out next (preceding) character.

/
/	ADRBCR - RUB A CHARACTER
/		 IF THERE ARE NO CHARS IT WILL DO A NON SKIP RETURN
/		 IF DID RUB OUT SOMETHING THEN A NORMAL (2ND) RETURN
/
ADRBCR,	XX
IFDEF FORIN <
	AC7777			/ Once-only check for ACCENT before character.
	DCA	T1		/
> / end IFDEF FORIN.
	AC7777			/ Any chars to rubout?
	TAD	MAXLEN		/  ...
	SNA CLA			/ Skip if YES.
	 JMP I	ADRBCR		/ Take 1st return if NO.
	ISZ	ADRBCR
ADRBC1,	AC7777			/ Decrement the character pointer.
	TAD	ADDDST		/  ...
	DCA	ADDDST		/   ....
	DCA I	ADDDST		/ Set new stopper.
	AC7777			/ Decrement the count of chars too.
	TAD	MAXLEN		/  ...
	DCA	MAXLEN		/   ....
IFDEF FORIN <
	ISZ	T1		/ Already checked for ACCENT?
	 JMP I	ADRBCR		/ Return if yes.
	JMS	ADBKCR		/ Get prior character.
	CIFMNU			/ Map MENU field.
	JMS I	(SRTAB1		/  to see if it's an accent.
	SKP CLA			/ No, Just return.
	JMP	ADRBC1		/ Yes, Delete it too.
> / end ifdef FORIN
	JMP I	ADRBCR		/ Return

ADBKCR,	XX
	AC7777
	TAD	MAXLEN		/ Any chars in line?
	SNA CLA			/ Skip if yes.
	 JMP	ADDRET		/ Take early exit if no.
	AC7777			/ point back 1 char posn.
	TAD	ADDDST		/  ...
	DCA	ADTEMP		/   ....
	TAD I	ADTEMP		/ Get prior char.
	JMP I	ADBKCR		/ Return with char.

ADDCHR,	0
ADDDST,	0
ADDLEN,	0
MAXLEN,	0			/ Set to the maximum size.
ADTEMP,	0

/
/MOVSTR - MOVE AN ASCIIZ STRING
/
/	JMS	MOVSTR
/	ADDRESS OF SOURCE STRING
/	ADDRESS OF DESTINATION STRING
/	ERROR RETURN - DESTINATION TOO SHORT AC=0
/	NORMAL RETURN   (AC=0)
/THESE ASCIIZ STRINGS START WITH A WORD
/CONTAINING THE NEGATIVE COUNT OF THE NUMBER
/OF WORDS RESERVED FOR THE STRING (INCLUDING
/THAT ONE).  SO, THE MAXIMUM NUMBER OF
/CHARACTERS IT CAN CONTAIN IS COUNT-2.
/
MOVSTR,	XX
	CLA
	TAD I	MOVSTR	/GET ADDR OF SOURCE
	DCA	X1
	ISZ	MOVSTR
	TAD I	MOVSTR	/GET ADDR OF DESTINATION
	CIA;CMA		/POINT TO -LENGTH
	DCA	X2
	TAD I	X2	/GET -DESTINATION LENGTH
	DCA	MOVMAX
	ISZ	MOVSTR	/POINT TO FIRST RETURN
MOVLOP,	ISZ	MOVMAX	/COUNT CHARACTERS
	SKP
	JMP I	MOVSTR	/TAKE ERROR RETURN
	TAD I	X1	/FETCH A SOURCE CHARACTER
	SNA
	JMP	MOVEND
	DCA I	X2	/STORE IT
	JMP	MOVLOP	/GO FOR ANOTHER
MOVEND,	DCA I	X2	/END OF STRING
	ISZ	MOVSTR	/NORMAL RETURN
	JMP I	MOVSTR

MOVMAX,	0

/ INITIALIZE INTEGRAL MODEM - (SET TO BURST MODE)			/A019

ADIMCK,	
	JMS	DRAINH	/ CLEAR INPUT BUFFER				/A019
	TAD	(CTLA	/ ^A INIT. MODEM (ACU)				/A019
	JMS	HSOUT	/						/A019
	JMS	WAIT1	/						/A019
	JMS	HSINPT	/ CK RESPONSE					/A019
	JMP	IMODEX	/ NOTHING PRESENT - IN BURST MODE		/A019
	JMS	DRAINH	/ CLEAR INPUT BUFFER AGAIN			/A019
	TAD	(CTLA	/ THIS ONE SHOULD DO IT.			/A019
	JMS	HSOUT	/						/A019
	JMP	IMODEX	/ 						/A019

/------------
X=.
	PAGE

/
/SUBSTR - COMPARE 2 7-BIT ASCIIZ STRINGS
/	RETURN EQUAL IF THE FIRST STRING IS A
/	SUBSTRING OF THE SECOND STRING.
/
/	JMS	SUBSTR
/	ADDRESS OF FIRST STRING
/	ADDRESS OF SECOND STRING
/	NOT EQUAL RETURN   (AC=0)
/	EQUAL RETURN   (AC=0)
/
/	UPPER/LOWER CASE INDEPENDENT
/
/
SUBSTR,	XX
	CLA
	TAD I	SUBSTR	/GET ADDR OF S1
	DCA	SUBS1
	ISZ	SUBSTR
	TAD I	SUBSTR	/GET ADDR OF S2
	DCA	SUBS2
	ISZ	SUBSTR	/POINT TO NOT EQUAL RETURN
SUBTRY,	TAD	SUBS1	/INITIALIZE FOR A SUBSTRING PASS
	DCA	X1
	TAD	SUBS2
	DCA	X2
	ISZ	SUBS2	/BUMP STRING2 START POINT FOR NEXT TRY
/
SUBLOP,	TAD I	X1	/FETCH A CHARACTER FROM S1
	SNA
	JMP	SUBE1
	AND	(177	/COMPARE ONLY 7 BITS
	DCA	SUBC1
	TAD I	X2	/FETCH A CHARACTER FROM S2
	SNA
	JMP I	SUBSTR	/SECOND STRING SHORTER
	AND	(177
	CIA		/SAVE -SECOND CHAR
	DCA	SUBC2
	TAD	SUBC1	/IS FIRST STRING CHARACTER L/C
	TAD	(-172
	SMA SZA
	JMP	SUBCMP	/NO, >z
	TAD	(172-141
	SPA
	JMP	SUBCMP	/NO, <a
	TAD	(101	/SET FIRST CHAR TO UPPER
	DCA	SUBC1
SUBCMP,	CLA		/COMPARE THE PAIR OF CHARACTERS
	TAD	SUBC1
	TAD	SUBC2
	SZA
	TAD	(40	/TREAT LOWER CASE AS UPPER
	SNA CLA		/SKIP IF NOT EQUAL NOW
	JMP	SUBLOP	/GO CHECK NEXT PAIR
	JMP	SUBTRY	/GO BACK AND TRY AGAIN 1 POSITION FARTHER ALONG
			/END OF STRING1
SUBE1,	ISZ	SUBSTR	/TAKE EQUAL RETURN
	JMP I	SUBSTR	/RETURN
SUBS1,	0
SUBS2,	0
SUBC1,	0
SUBC2,	0

/NULSTR - SET AN ASCIIZ STRING EMPTY (NULL)
/
/	JMS	NULSTR
/	ADDRESS OF STRING
/	RETURN  (AC=0)
/
NULSTR,	XX
	CLA
	TAD I	NULSTR	/GET ADDRESS OF FIRST SLOT
	DCA	X1
	DCA I	X1	/SHOW STRING EMPTY
	ISZ	NULSTR	/POINT TO RETURN
	JMP I	NULSTR	/RETURN

/
/	SUBROUTINE TO INITIALIZE AN ASCIIZ STRING.
/
/	THESE ASCIIZ STRINGS START WITH A WORD
/	CONTAINING THE NEGATIVE COUNT IF THE NUMBER
/	OF WORDS RESERVED FOR THE STRING (INCLUDING
/	THAT ONE). SO, THE MAXIMUM NUMBER OF
/	CHARACTERS IT CAN CONTAIN IS COUNT-2.
/
/	JMS	INISTR
/		ADDRESS OF STRING
/		POSITIVE MAX CHARS (IE. COUNT-2)
/	NORMAL RETURN
/
/
INISTR,	XX
	TAD I	INISTR	/GET STRING ADDRESS
	DCA	T1
	ISZ	INISTR
	AC0002
	TAD I	INISTR	/GET +COUNT
	CIA		/MAKE NEG
	DCA I	T1	/STORE IN STRING HEADER WORD
	ISZ	T1
	DCA I	T1	/SHOW STRING EMPTY (NULL)
	ISZ	INISTR	/RETURN
	JMP I	INISTR



/	SET UP THE ASCIIZ STRING WORK SPACES

INITWS,	XX
	JMS	INISTR
		ATOM;ATMSIZ
	JMS	INISTR
		TSTRNG;TXTSIZ
	JMS	INISTR
		WTTIME;5
	JMS	INISTR
		GOTRGT;LABSIZ
	JMS	INISTR
		WTGO;LABSIZ
	JMS	INISTR
		WTKBS;WTTSIZ
	JMS	INISTR
		WTG1;LABSIZ
	JMS	INISTR
		WTG2;LABSIZ
	JMS	INISTR
		WTG3;LABSIZ
	JMS	INISTR
		WTG4;LABSIZ
	JMS	INISTR
		WTG5;LABSIZ
	JMS	INISTR
		WTS1;WTTSIZ
	JMS	INISTR
		WTS2;WTTSIZ
	JMS	INISTR
		WTS3;WTTSIZ
	JMS	INISTR
		WTS4;WTTSIZ
	JMS	INISTR
		WTS5;WTTSIZ
	JMS	INISTR							/A024
		WTS6;PHNSIZ						/A024

	JMP I	INITWS
/------------
	PAGE


/	ADDRESS LISTS
/
/	PAIRS OF COMMAND TEXT ADDRESSES AND PROCESSING
/	ROUTINE ADDRESSES.
CMDLST,	GOS;	GO	/ GO command
	TYPES;	TYPE	/ TYPE command
	DIALS;	DIAL	/ DIAL command
	WAITS;	WAIT	/ WAIT command
	SCRENS;	SCREEN	/ SCREEN command
	NSCRNS;	NOSCRN	/ NOSCREEN command
	MENUS;	MENU	/ MENU command
	ABORTS;	ABORTC	/ ABORT command
	CXS;	CXCMND	/ CX command
	ENDS;	ENDCM	/ END command
		0	/ MUST END WITH 0

/
/	PAIRS OF TEXT ITEM TEXT ADDRESSES AND
/	PROCESSING ROUTINE ADDRESSES.
TXTLST,	CRS;	TCR	/ CR
	LFS;	TLF	/ LF
	BRKS;	TBRK	/ BRK
	DTRS;	TDTR	/ DTR
		0	/ MUST END WITH 0
/
/
/	LIST OF WAIT TEXT STRING ADDRESSES
/	MUST BE TERMINATED BY A 0.
WTSLST,	WTS1;WTS2;WTS3;WTS4;WTS5;0
/
/	LIST OF WAIT GO TO TARGET STRING ADDRESSES.
WTGLST,	WTG1;WTG2;WTG3;WTG4;WTG5
/
/	ABORT ERROR MESSAGE ADDRESSES
ABRTBL,	FOFMES			/ File open failure message.
	GHTMES			/ Gold Halt message.
	ENDMES			/ Missing END statment
	ITLMES			/ Item too long
	IVCMES			/ Invalid command
	ABRMES			/ Abort statement execution.
	TYPMES			/ Missing HOST, KBD or SCREEN		/A013
	TXTMES			/ BAD TEXT ELEMENT
	TIMMES			/ BAD TIME SPECIFICATION
	WAIMES			/ TOO MANY WAIT STRINGS
	GOWMES			/ GO/WAIT TARGET MISSING
	DNCMSG			/ DIALING NOT COMPLETED
/
/	ASCIIZ STRINGS
/
NONUM,	IFDEF ENGLSH<-12;"N;"o;" ;"n;"u;"m;"b;"e;"r;0>
	IFDEF ITALIAN<-12;"N;"e;"s;"s;"u;"n;" ;"n;"u;"m;"e;"r;"o;0>
	IFDEF V30NOR<-12;"N;"o;" ;"n;"u;"m;"b;"e;"r;0>
	IFDEF V30SWE<-12;"N;"o;" ;"n;"u;"m;"b;"e;"r;0>
	IFDEF DUTCH<-12;"N;"o;" ;"n;"u;"m;"b;"e;"r;0>
	IFDEF SPANISH<-12;"N;"o;" ;"n;"u;"m;"b;"e;"r;0>

/
/
/	ALL LOWER CASE IN ORDER TO MATCH UPPER OR LOWER
/	CASE IN CMPSTR ROUTINE.
/
	IFDEF ENGLSH <
TYPES,	-6;"t;"y;"p;"e;0
TOS,	-4;"t;"o;0
GOS,	-4;"g;"o;0
WAITS,	-6;"w;"a;"i;"t;0
FORS,	-5;"f;"o;"r;0
SCRENS,	-10;"s;"c;"r;"e;"e;"n;0
NSCRNS,	-12;"n;"o;"s;"c;"r;"e;"e;"n;0
MENUS,	-6;"m;"e;"n;"u;0
DIALS,	-6;"d;"i;"a;"l;0
ABORTS,	-7;"a;"b;"o;"r;"t;0
CXS,	-4;"c;"x;0
ENDS,	-5;"e;"n;"d;0
HOSTS,	-6;"h;"o;"s;"t;0
KBDS,	-5;"k;"b;"d;0
CRS,	-4;"c;"r;0
LFS,	-4;"l;"f;0
BRKS,	-5;"b;"r;"k;0
DTRS,	-5;"d;"t;"r;0
	>
	IFDEF ITALIAN <
TYPES,	-6;"i;"n;"v;"i;"o;"_;"a;0
TOS,	-4;"a;0
GOS,	-4;"s;"a;"l;"t;"o;0
WAITS,	-6;"a;"t;"t;"e;"s;"a;0
FORS,	-5;"p;"e;"r;0
SCRENS,	-10;"v;"i;"d;"e;"o;0
NSCRNS,	-12;"n;"o;"_;"v;"i;"d;"e;"o;0
MENUS,	-6;"m;"e;"n;"u;0
DIALS,	-6;"c;"h;"i;"a;"m;"a;"t;"a;0
ABORTS,	-7;"i;"n;"t;"e;"r;"r;"u;"z;"i;"o;"n;"e;0
CXS,	-4;"e;"t;0
ENDS,	-5;"f;"i;"n;"e;0
HOSTS,	-6;"o;"s;"p;"i;"t;"e;0
KBDS,	-5;"t;"s;"t;0
CRS,	-4;"r;"i;"t;0
LFS,	-4;"l;"f;0
BRKS,	-5;"i;"n;"c;0
DTRS,	-5;"d;"t;"r;0
	>

	IFDEF V30NOR <
TYPES,	-6;"t;"y;"p;"e;0
TOS,	-4;"t;"o;0
GOS,	-4;"g;"o;0
WAITS,	-6;"w;"a;"i;"t;0
FORS,	-5;"f;"o;"r;0
SCRENS,	-10;"s;"c;"r;"e;"e;"n;0
NSCRNS,	-12;"n;"o;"s;"c;"r;"e;"e;"n;0
MENUS,	-6;"m;"e;"n;"u;0
DIALS,	-6;"d;"i;"a;"l;0
ABORTS,	-7;"a;"b;"o;"r;"t;0
CXS,	-4;"c;"x;0
ENDS,	-5;"e;"n;"d;0
HOSTS,	-6;"h;"o;"s;"t;0
KBDS,	-5;"k;"b;"d;0
CRS,	-4;"c;"r;0
LFS,	-4;"l;"f;0
BRKS,	-5;"b;"r;"k;0
DTRS,	-5;"d;"t;"r;0
	>

IFDEF V30SWE <
TYPES,	-6;"t;"y;"p;"e;0
TOS,	-4;"t;"o;0
GOS,	-4;"g;"o;0
WAITS,	-6;"w;"a;"i;"t;0
FORS,	-5;"f;"o;"r;0
SCRENS,	-10;"s;"c;"r;"e;"e;"n;0
NSCRNS,	-12;"n;"o;"s;"c;"r;"e;"e;"n;0
MENUS,	-6;"m;"e;"n;"u;0
DIALS,	-6;"d;"i;"a;"l;0
ABORTS,	-7;"a;"b;"o;"r;"t;0
CXS,	-4;"c;"x;0
ENDS,	-5;"e;"n;"d;0
HOSTS,	-6;"h;"o;"s;"t;0
KBDS,	-5;"k;"b;"d;0
CRS,	-4;"c;"r;0
LFS,	-4;"l;"f;0
BRKS,	-5;"b;"r;"k;0
DTRS,	-5;"d;"t;"r;0
	> / END IFDEF V30SWE

	IFDEF DUTCH <
TYPES,	-6;"t;"y;"p;"e;0
TOS,	-4;"t;"o;0
GOS,	-4;"g;"o;0
WAITS,	-6;"w;"a;"i;"t;0
FORS,	-5;"f;"o;"r;0
SCRENS,	-10;"s;"c;"r;"e;"e;"n;0
NSCRNS,	-12;"n;"o;"s;"c;"r;"e;"e;"n;0
MENUS,	-6;"m;"e;"n;"u;0
DIALS,	-6;"d;"i;"a;"l;0
ABORTS,	-7;"a;"b;"o;"r;"t;0
CXS,	-4;"c;"x;0
ENDS,	-5;"e;"n;"d;0
HOSTS,	-6;"h;"o;"s;"t;0
KBDS,	-5;"k;"b;"d;0
CRS,	-4;"c;"r;0
LFS,	-4;"l;"f;0
BRKS,	-5;"b;"r;"k;0
DTRS,	-5;"d;"t;"r;0
	>

	IFDEF SPANISH <
TYPES,	-6;"t;"y;"p;"e;0
TOS,	-4;"t;"o;0
GOS,	-4;"g;"o;0
WAITS,	-6;"w;"a;"i;"t;0
FORS,	-5;"f;"o;"r;0
SCRENS,	-10;"s;"c;"r;"e;"e;"n;0
NSCRNS,	-12;"n;"o;"s;"c;"r;"e;"e;"n;0
MENUS,	-6;"m;"e;"n;"u;0
DIALS,	-6;"d;"i;"a;"l;0
ABORTS,	-7;"a;"b;"o;"r;"t;0
CXS,	-4;"c;"x;0
ENDS,	-5;"e;"n;"d;0
HOSTS,	-6;"h;"o;"s;"t;0
KBDS,	-5;"k;"b;"d;0
CRS,	-4;"c;"r;0
LFS,	-4;"l;"f;0
BRKS,	-5;"b;"r;"k;0
DTRS,	-5;"d;"t;"r;0
	>

/
/	TEXT STRINGS
/

NULMSG,	TEXT	/ /
KEYMSG,	IFDEF	ENGLSH <TEXT	/^P!E^P&ENTER &NAME &SEARCH &KEY />
	IFDEF	ITALIAN <TEXT	/^P!E^P&INTRODURRE IL NOME DA RICERCARE />
	IFDEF   V30NOR <TEXT    '^P!E^P&ANGI S\XKEN\XKKEL FOR NAVN '>
	IFDEF	V30SWE <TEXT	'^P!E^P&SKRIV NAMNET OCH TRYCK P\E S\VK'>
	IFDEF	DUTCH <TEXT	/^P!E^P&ENTER &NAME &SEARCH &KEY />
	IFDEF	SPANISH <TEXT	/^P!E^P&ENTER &NAME &SEARCH &KEY />


	*.-1
	TEXT	/^P^S^A/
	*.-1
	IFDEF	ENGLSH <TEXT	/^P&OR ^S^P/>
	IFDEF	ITALIAN <TEXT	/^P&OPPURE ^S^P/>
	IFDEF 	V30NOR <TEXT '^P&EL ^S^P'>
	IFDEF	V30SWE <TEXT '^P^S^P'>
	IFDEF	DUTCH <TEXT	/^P&OR ^S^P/>
	IFDEF	SPANISH <TEXT	/^P&OR ^S^P/>



MENMSG,	IFDEF	ENGLSH <
	TEXT	/&PRESS &GOLD !&MENU TO &RETURN TO THE &MAIN &MENU/>
	IFDEF	ITALIAN <
	TEXT	/&PREMERE &ORO !&MENU PER TORNARE AL &MENU &PRINCIPALE/>
	IFDEF 	V30NOR <
	TEXT 	'&TRYKK P\E &GULL !&MENY FOR \E F\E &HOVEDMENYEN'>	/A027
	IFDEF	V30SWE <
	TEXT	'&TILLBAKA TILL HUVUDMENYN: ANV\DND GULD MENY'>
	IFDEF	DUTCH <
	TEXT	/&DRUK OOP &GOUD !&MENU VOOR HET &HOOFDMENU./>
	IFDEF	SPANISH <
	TEXT	/&PULSE &DORADA !&MENU PARA &VOLVER AL &MEN\Z &PRINCIPAL/>


	
NEXMSG,	IFDEF	ENGLSH <
	TEXT	/&OR &JUST &PRESS &RETURN TO GET THE &NEXT &ENTRY/>
	IFDEF	ITALIAN <
	TEXT	/&PREMERE &RITORNO PER CONTINUARE LA RICERCA/	/A015>
	IFDEF 	V30NOR <
	TEXT 	'&EL. TRYKK P\E !&RETUR FOR \E F\E NESTE OPPSLAG'>	/A027
	IFDEF 	V30SWE <
	TEXT	'&TILL N\DSTA POST: TRYCK P\E RETUR'>
	IFDEF	DUTCH <
	TEXT	/&OR &JUST &PRESS &RETURN TO GET THE &NEXT &ENTRY/>
	IFDEF	SPANISH <
	TEXT	/&OR &JUST &PRESS &RETURN TO GET THE &NEXT &ENTRY/>



OKYMSG,	IFDEF	ENGLSH <TEXT	/&OR &JUST &PRESS &RETURN TO USE />
	IFDEF	ITALIAN <TEXT	/&PREMERE &RITORNO PER USARE />
	IFDEF 	V30NOR <TEXT 	'EL. TRYKK P\E !&RETUR FOR \E BRUKE'>	/A027
	IFDEF	V30SWE <TEXT	'&TITTA P\E EN ANNAN POST: ANV\DND FRAM\ET,'>
 	IFDEF	DUTCH <TEXT	/&OR &JUST &PRESS &RETURN TO USE />
	IFDEF	SPANISH <TEXT	/&OR &JUST &PRESS &RETURN TO USE />

NAMMSG,	TEXT	/^P!E^P^A!L^P^A!L/

ADVMSG,
	IFNDEF	V30SWE <
	IFDEF	ENGLSH <TEXT	/!&ADVANCE OR -/>
	IFDEF	ITALIAN<TEXT	/!&AVANTI O -/>
	IFDEF	V30NOR <TEXT	'!&FREM EL. -'>				/A027
	IFDEF	DUTCH <TEXT	/!&ADVANCE OR -/>
	IFDEF	SPANISH <TEXT	/!&ADVANCE OR -/>
	*.-1
	7600
	>
	IFDEF	V30SWE <TEXT	'BAK\ET ELLER TRYCK BARA P\E RETUR'>

BCKMSG,
	IFNDEF	V30SWE <
	IFDEF	ENGLSH <TEXT	/!&BACKUP OR - />
	IFDEF	ITALIAN <TEXT	/!&INDIETRO O - />
	IFDEF 	V30NOR <TEXT	'!&TILBAKE EL.-'>
	IFDEF	DUTCH <TEXT	/!&BACKUP OR - />
	IFDEF	SPANISH <TEXT	/!&BACKUP OR - />
	*.-1
	7400
	>
	IFDEF	V30SWE <TEXT	''>

ENTMSG,	IFDEF	ENGLSH <TEXT	/ TO &SEE &ANOTHER &ENTRY/>
	IFDEF	ITALIAN <TEXT	/ PER VEDERE UN ALTRO ELEMENTO/>
	IFDEF 	V30NOR <TEXT	' FOR \E SE P\E NEST OPPSLAG'>
	IFDEF	V30SWE <TEXT	''>
	IFDEF	DUTCH <TEXT	/ TO &SEE &ANOTHER &ENTRY/>
	IFDEF	SPANISH <TEXT	/ TO &SEE &ANOTHER &ENTRY/>

OPTMSG,	IFDEF	ENGLSH<TEXT	/^P!E&PRESS !&ADVANCE OR - />
	IFDEF	ITALIAN <TEXT	/^P!E&PREMERE !&AVANTI O - />
	IFDEF 	V30NOR	<TEXT	'^P!E&TRYKK P\E !&FREM EL. - '>
	IFDEF	DUTCH	<TEXT	/^P!E&PRESS !&ADVANCE OR - />
	IFDEF	SPANISH	<TEXT	/^P!E&PRESS !&ADVANCE OR - />
	IFDEF	V30SWE	<
	TEXT	'^P!E&TITTA P\E N\DSTA POST: TRYCK P\E FRAM\ET ELLER - '>

	*.-1
	TEXT '> '

	*.-1
	IFDEF ENGLSH <TEXT	/TO &SEE THE &NEXT &ENTRY />	/M015
	IFDEF ITALIAN <TEXT	/PER VEDERE L'ELEMENTO SUCCESSIVO />
	IFDEF V30NOR < TEXT	'FOR \E SE P\E NEST OPPSLAG '>
	IFDEF V30SWE < TEXT	''>
	IFDEF DUTCH <TEXT	/TO &SEE THE &NEXT &ENTRY />	/M015
	IFDEF SPANISH <TEXT	/TO &SEE THE &NEXT &ENTRY />	/M015

	*.-1
	IFDEF	ENGLSH <TEXT  /^P&PRESS !&BACKUP  OR - />
	IFDEF	ITALIAN <TEXT /^P&PREMERE !&INDIETRO O - />
	IFDEF 	V30NOR  <TEXT '^P&TYRKK P\E !&TILBAKE EL. -'>
	IFDEF	V30SWE	<
	TEXT '^P&TITTA P\E F\VREG\EENDE POST: TRYCK P\E BAK\ET ELLER -'>
	IFDEF	DUTCH	 <TEXT  /^P&PRESS !&BACKUP  OR - />
	IFDEF	SPANISH <TEXT  /^P&PRESS !&BACKUP  OR - />

	*.-1
	TEXT '< '

	*.-1
	IFDEF ENGLSH <TEXT/TO &SEE THE &PREVIOUS &ENTRY /> /M015
	IFDEF ITALIAN <TEXT/PER VEDERE L'ELEMENTO PRECEDENTE />
	IFDEF V30NOR  <TEXT'FOR \E SE P\E FOREG\EENDE OPSLAG '>
	IFDEF V30SWE  <TEXT''>
	IFDEF DUTCH <TEXT/TO &SEE THE &PREVIOUS &ENTRY /> /M015
	IFDEF SPANISH <TEXT/TO &SEE THE &PREVIOUS &ENTRY /> /M015

	*.-1
	IFDEF	ENGLSH <
	TEXT	/^P&PRESS &GOLD !&SRCH OR !&FIND TO &ENTER />		/M015
	IFDEF	ITALIAN <
	TEXT	/^P&PREMERE &ORO !&CERCA O !&RICER PER SELEZIONARE />
	IFDEF	V30NOR <
	TEXT	'TRYKK &GULL !&FINN EL. !&FINN FOR \E &ANGI'>	
	IFDEF	V30SWE <
	TEXT	'&TRYCK P\E GULD S\VK F\VR ATT B\VRJA'>
	IFDEF	DUTCH <
	TEXT	/^P&PRESS &GOLD !&SRCH OR !&FIND TO &ENTER />		/M015
	IFDEF	SPANISH <
	TEXT	/^P&PRESS &GOLD !&SRCH OR !&FIND TO &ENTER />		/M015
	*.-1
	IFDEF 	ENGLSH <TEXT	/A &NEW &SEARCH &KEY />			/M015
	IFDEF ITALIAN <TEXT /UN NUOVO NOME />
	IFDEF 	V30NOR <TEXT    ' EN NY S\XKEN\XKKEL '>
	IFDEF	V30SWE <TEXT	'A &NEW &SEARCH &KEY '>
	IFDEF 	DUTCH <TEXT	/A &NEW &SEARCH &KEY />			/M015
	IFDEF 	SPANISH <TEXT	/A &NEW &SEARCH &KEY />			/M015

	*.-1
	TEXT	/^P^S/
XITMSG,	IFDEF	ENGLSH<TEXT	/^P&TYPE &C&X TO &DIAL AND &ENTER &C&X  />
	IFDEF	ITALIAN <
TEXT /^P&INTRODURRE !&ET PER COLLEGAMENTO AUTOMATICO TRAMITE MODEM IN !&ET />
	IFDEF V30NOR < TEXT 'LEGG INN !&CX FOR \E RINGE OPP OG G\E INN I !&CX'>
	IFDEF	V30SWE<TEXT	/^P&TYPE &C&X TO &DIAL AND &ENTER &C&X  />
	IFDEF	DUTCH<TEXT	/^P&TYPE &C&X TO &DIAL AND &ENTER &C&X  />
	IFDEF	SPANISH<TEXT	/^P&TYPE &C&X TO &DIAL AND &ENTER &C&X  />


	*.-1

	IFDEF	ENGLSH<TEXT	/^P&TYPE &L&G TO &DIAL AND &ENTER !&LOGON/>
	IFDEF ITALIAN <
TEXT /^PINTRODURRE !&CO PER COLLEGAMENTO AUTOMATICO TRAMITE MODEM IN !&CO/> 
	IFDEF V30NOR <
	TEXT '^P&SKRIV !&LG FOR \E RINGE OPP OG G\E INN I !&EASYCOM'>	
	IFDEF	V30SWE<TEXT	/^P&TYPE &L&G TO &DIAL AND &ENTER !&LOGON/>
	IFDEF	DUTCH<TEXT	/^P&TYPE &L&G TO &DIAL AND &ENTER !&LOGON/>
	IFDEF	SPANISH<TEXT	/^P&TYPE &L&G TO &DIAL AND &ENTER !&LOGON/>



WATMSG,	IFDEF ENGLSH<TEXT	/ !&WAIT!L/>
     	IFDEF ITALIAN<TEXT/ !&ATTESA!L/>
	IFDEF V30NOR<TEXT '!&VENTIL!L'>
	IFDEF V30SWE<TEXT	/ !&WAIT!L/>
	IFDEF DUTCH<TEXT	/ !&WAIT!L/>
	IFDEF SPANISH<TEXT	/ !&WAIT!L/>

BSYMSG,	IFDEF ENGLSH<TEXT	/!R!R!R!R!&BUSY/>
	IFDEF ITALIAN<TEXT /!R!R!R!R!&OCCUPATO/>
	IFDEF V30NOR<TEXT '!R!R!R!R!&OPPTATT'>
	IFDEF V30SWE<TEXT	/!R!R!R!R!&BUSY/>
	IFDEF DUTCH<TEXT	/!R!R!R!R!&BUSY/>
	IFDEF SPANISH<TEXT	/!R!R!R!R!&BUSY/>
	
ANSMSG,	IFDEF ENGLSH<TEXT	/!R!R!R!R!&ANSWERED/>
	IFDEF ITALIAN<TEXT /!R!R!R!R!&RISPONDE/>
	IFDEF V30NOR <TEXT '!R!R!R!R!&SVARTE'>
	IFDEF V30SWE<TEXT	/!R!R!R!R!&ANSWERED/>
	IFDEF DUTCH<TEXT	/!R!R!R!R!&ANSWERED/>
	IFDEF SPANISH<TEXT	/!R!R!R!R!&ANSWERED/>

NASMSG,	IFDEF ENGLSH<TEXT	/!R!R!R!R&NO &ANSWER/>			/A016
	IFDEF ITALIAN<TEXT /!R!R!R!RNON RISPONDE/>
	IFDEF V30NOR <TEXT '!R!R!R!R!&IKKE NOE SVAR'>
	IFDEF V30SWE<TEXT	/!R!R!R!R&NO &ANSWER/>			/A016
	IFDEF DUTCH<TEXT	/!R!R!R!R&NO &ANSWER/>			/A016
	IFDEF SPANISH<TEXT	/!R!R!R!R&NO &ANSWER/>			/A016


BADMSG,	IFDEF ENGLSH<TEXT /!R!R!R!R!&INVALID !&NUMBER/>
	IFDEF ITALIAN<TEXT /!R!R!R!R&NUMERO NON CORRETTO/>
	IFDEF V30NOR<TEXT '!R!R!R!R!&UGYLDIG !&NUMMER'>
	IFDEF V30SWE<TEXT /!R!R!R!R!&INVALID !&NUMBER/>
	IFDEF DUTCH<TEXT /!R!R!R!R!&INVALID !&NUMBER/>
	IFDEF SPANISH<TEXT /!R!R!R!R!&INVALID !&NUMBER/>

UNKMSG,	IFDEF ENGLSH<TEXT	/!R!R!R!R&UNKNOWN &RESPONSE &OR &NO &DIALER/>
	IFDEF ITALIAN<TEXT /!R!R!R!R&RISPOSTA NON CORRETTA/>
	IFDEF V30NOR<TEXT  '!R!R!R!R&UKJENT SVAR'>
	IFDEF V30SWE<TEXT	/!R!R!R!R&UNKNOWN &RESPONSE &OR &NO &DIALER/>
	IFDEF DUTCH<TEXT	/!R!R!R!R&UNKNOWN &RESPONSE &OR &NO &DIALER/>
	IFDEF SPANISH<TEXT	/!R!R!R!R&UNKNOWN &RESPONSE &OR &NO &DIALER/>
	
BEGMSG,	IFDEF ENGLSH<TEXT	/&BEGINNING/>
	IFDEF ITALIAN<TEXT /INIZIO/>
	IFDEF V30NOR<TEXT 'BEGYNNELSE'>
	IFDEF V30SWE<TEXT	/&BEGINNING/>
	IFDEF DUTCH<TEXT	/&BEGINNING/>
	IFDEF SPANISH<TEXT	/&BEGINNING/>
	
ENDMSG,	IFDEF ENGLSH<TEXT	/&END/>
	IFDEF ITALIAN<TEXT /&FINE/>
	IFDEF V30NOR<TEXT '&SLUTT'>
	IFDEF V30SWE<TEXT	/&END/>
	IFDEF DUTCH<TEXT	/&END/>
	IFDEF SPANISH<TEXT	/&END/>


EODMSG,	IFDEF ENGLSH<TEXT/^P^S OF &DIRECTORY!L^P!L^P!L^P&PRESS ^S^S!L^P^E/>
	IFDEF ITALIAN<TEXT/^P^S DELL'&ELENCO!L^P!L^P!L^P&PREMERE ^S^S!L^P^E/>
	IFDEF V30NOR <TEXT'^P^S P\E REGISTER!L^P!L^P!L^P&TRYKK P\E ^S^S!L^P^E'>
	IFDEF V30SWE<TEXT/^P^S OF &DIRECTORY!L^P!L^P!L^P&PRESS ^S^S!L^P^E/>
	IFDEF DUTCH<TEXT/^P^S OF &DIRECTORY!L^P!L^P!L^P&PRESS ^S^S!L^P^E/>
	IFDEF SPANISH<TEXT/^P^S OF &DIRECTORY!L^P!L^P!L^P&PRESS ^S^S!L^P^E/>

DIAMSG,	IFDEF ENGLSH<TEXT	/!&DIALING />
	IFDEF ITALIAN<TEXT /!&CHIAMATA !&AUTOMATICA/>
	IFDEF V30NOR<TEXT '!&RINGER OPP'>
	IFDEF V30SWE<TEXT	/!&DIALING />
	IFDEF DUTCH<TEXT	/!&DIALING />
	IFDEF SPANISH<TEXT	/!&DIALING />
	
ABRMSG,	IFDEF ENGLSH<TEXT	/^P!E^P&TERMINATING DUE TO />
	IFDEF ITALIAN<TEXT /^P!E^P&CHIAMATA INTERROTTA. />
	IFDEF V30NOR<TEXT  '^P!E^P&AVSLUTTER P.G.A.'>
	IFDEF V30SWE<TEXT	/^P!E^P&TERMINATING DUE TO />
	IFDEF DUTCH<TEXT	/^P!E^P&GESTOPT WEGENS />
	IFDEF SPANISH<TEXT	/^P!E^P&TERMINANDO DEBIDO A />
	
GHTMES,	IFDEF ENGLSH<TEXT	/&GOLD !&HALT/>
	IFDEF ITALIAN<TEXT /&ORO !&STOP/>
	IFDEF V30NOR<TEXT '&GULL !&STOPP'>
	IFDEF V30SWE<TEXT	/&GOLD !&HALT/>
	IFDEF DUTCH<TEXT	/&GOLD !&STOP/>
	IFDEF ENGLSH<TEXT	/&DORADA !&PARAR/>

ENDMES,	IFDEF ENGLSH	<TEXT /&MISSING !&END &STATEMENT/>
	IFDEF ITALIAN	<TEXT	/&MANCA COMANDO !&FINE/>
	IFDEF V30NOR 	<TEXT 'MANGLENDE !&END-KOMMANDO'>
	IFDEF V30SWE	<TEXT /&MISSING !&END &STATEMENT/>
	IFDEF DUTCH	<TEXT /&GEEN !&END />
	IFDEF SPANISH	<TEXT /&FALTA !&END &SENTENCIA &ABORTADA/>



ITLMES,	IFDEF ENGLSH	<TEXT	/&ITEM &TOO &LONG/>
	IFDEF ITALIAN	<TEXT /&VOCE TROPPO LUNGA/>
	IFDEF V30NOR	<TEXT 'FOR LANGT UTTRYKK'>
	IFDEF V30SWE	<TEXT	/&ITEM &TOO &LONG/>
	IFDEF DUTCH	<TEXT	/&ITEM &TOO &LONG/>
	IFDEF SPANISH	<TEXT	/&ELEMENTO &MUY &LARGO/>


IVCMES,	IFDEF ENGLSH	<TEXT	/&INVALID &COMMAND/>
	IFDEF ITALIAN	<TEXT /&COMANDO NON CORRETTO/>
	IFDEF V30NOR	<TEXT 'UGYLDIG KOMMANDO'>
	IFDEF V30SWE	<TEXT	/&INVALID &COMMAND/>
	IFDEF DUTCH	<TEXT	/&ONGELDIGE OPDRACHT/>
	IFDEF SPANISH	<TEXT	'&COMANDO &INV\ALIDO'>

ABRMES,	IFDEF ENGLSH	<TEXT	/!&ABORT &STATEMENT &EXECUTION/>
	IFDEF ITALIAN	<TEXT /&COMANDO !&INTERRUZIONE IN ESECUZIONE/>
	IFDEF V30NOR 	<TEXT '!&ABORT-!&KOMMANDO'>
	IFDEF V30SWE	<TEXT	/!&ABORT &STATEMENT &EXECUTION/>
	IFDEF DUTCH	<TEXT	/!&ABORT />
	IFDEF SPANISH 	<TEXT	'!&EJECUCI\SN DE &SDENTENCIA ABORTADA'>


TYPMES,	IFDEF ENGLSH	<TEXT	/&MISSING !&HOST, !&SCREEN OR !&KBD/>
	IFDEF ITALIAN	<TEXT /&MANCA !&OSPITE, !&VIDEO O !&TST/>
	IFDEF V30NOR	<TEXT 'MANGLENDE !&HOST, !&SCREEN EL. !&KBD'>
	IFDEF V30SWE	<TEXT	/&MISSING !&HOST, !&SCREEN OR !&KBD/>
	IFDEF DUTCH	<TEXT	/&GEEN  !&HOST, !&SCREEN OF !&KBD/>
	IFDEF SPANISH	<TEXT	/&NO HAY !&HOST, !&SCREEN O !&KBD/>

TXTMES,	IFDEF ENGLSH	<TEXT	/&INVALID &TEXT &ELEMENT/>
	IFDEF ITALIAN	<TEXT /&TEST NON VALIDO/>
	IFDEF V30NOR 	<TEXT 'UGYLDIG TEKST'>
	IFDEF V30SWE	<TEXT	/&INVALID &TEXT &ELEMENT/>
	IFDEF DUTCH	<TEXT	/&ONGELDIGE TEKST/>
	IFDEF SPANISH	<TEXT	/&ELEMENTO DE &TEXTO &INV\ALIDO/>

TIMMES,	IFDEF ENGLSH	<TEXT	/&INVALID &TIME &SPECIFICATION/>
	IFDEF ITALIAN	<TEXT /&TEMPO NON VALIDO/>
	IFDEF V30NOR	<TEXT 'UGYLDIG TIDSANGIVELSE'>
	IFDEF V30SWE	<TEXT	/&INVALID &TIME &SPECIFICATION/>
	IFDEF DUTCH	<TEXT	/&ONJUISTE TIJDSOPGAVE/>
	IFDEF ENGLSH	<TEXT	/&ESPECIFICACI\SN DE &TIEMPO &INVALIDA/>

WAIMES,	IFDEF ENGLSH	<TEXT	/&TOO &MANY &WAIT &STRINGS/>
	IFDEF ITALIAN	<TEXT /&TROPPE STRINGE DOPO IL COMANDO !&ATTENDERE/>
	IFDEF V30NOR	< TEXT 'FOR MANGE VARIABLER (MAKS. 5)'>
	IFDEF V30SWE	<TEXT	/&TOO &MANY &WAIT &STRINGS/>
	IFDEF DUTCH	<TEXT	/&TE VEEL &WAIT-INSTRUCTIES/>
	IFDEF SPANISH	<TEXT	/&MUCHAS ESPERES/>

DNCMSG,	IFDEF ENGLSH	<TEXT	/&DIALING &NOT &COMPLETED/>
	IFDEF ITALIAN	<TEXT /&CHIAMATA &AUTOMATICA NON COMPLETA/>
	IFDEF V30NOR	<TEXT 'OPPRINGING IKKE FULLF\XRT'>
	IFDEF V30SWE	<TEXT	/&DIALING &NOT &COMPLETED/>
	IFDEF DUTCH	<TEXT	/&DIALING &NOT &COMPLETED/>
	IFDEF SPANISH	<TEXT	/&DIALING &NOT &COMPLETED/>


	
GOWMES,	IFDEF ENGLSH	<TEXT	/&MISSING &G&O OR !&WAIT &LABEL "^A"/>
	IFDEF ITALIAN	<TEXT /&MANCA !&ANDARE O !&ATTESA &ETICHETTA "^A"/>
	IFDEF V30NOR	<TEXT '&MANGLENDE !&GO- EL. !&WAIT-LINJE "^A"'>
	IFDEF V30SWE	<TEXT	/&MISSING &G&O OR !&WAIT &LABEL "^A"/>
	IFDEF DUTCH	<TEXT  /&GEEN &G&O OF !&WAIT LABEL "^A"/>
	IFDEF SPANISH 	<TEXT  /&FALTA &R\STULO !&GO O !&WAIT "^A"/>

DSPMSG,	IFDEF ENGLSH	<TEXT	/^P&AT OR ABOUT LINE !D.^P/>
	IFDEF ITALIAN	<TEXT /^P&APPROSSIMATIVAMENTE ALLA RIGA !D.^P/>
	IFDEF V30NOR 	<TEXT '^PI EL. OMKRING LINJE !D.^P'>
	IFDEF V30SWE	<TEXT	/^P&AT OR ABOUT LINE !D.^P/>
	IFDEF DUTCH	<TEXT   /^P&NABIJ REGEL !D.^P/>
	IFDEF SPANISH	<TEXT	/^P&EN O ACERCA  DE L\MNEA !D.^P/>


FINMSG,	TEXT	/^P^S  /
	*.-1
	IFDEF ENGLSH 	<TEXT /^P&OR &PRESS !&RETURN TO CONTINUE IN &C&X/>
	IFDEF ITALIAN	<TEXT /^P&PREMERE !&RITORNO PER CONTINUARE IN !&ET/>
	IFDEF V30NOR 	<TEXT '^P&EL. TRYKK P\E !&RETUR FOR \E FORTSETTE I !CX'>
	IFDEF V30SWE	<TEXT /^P&OR &PRESS !&RETURN TO CONTINUE IN &C&X/>
	IFDEF DUTCH	<TEXT /^P&DRUK OP !&RETURN OM VERDER TE GAAN IN &C&X./>
	IFDEF SPANISH	<TEXT /^P&O &PULSE !&RETORNO PARA CONTINUAR EN &T&C/>

/D022LINBUF,	ZBLOCK	200 / Buffer for TYPE SCREEN text so that we can IOA it.


/	AREAS TO BE INITIALIZED BY THE PROGRAM TO SAVE FLOPPY SPACE
X=.
/
/
/	ASCIIZ STRING WORK SPACES TO BE INITIALIZED BY
/	CALLS TO INISTR.
/
ATOM=X;X=X+ATMSIZ+2	/CURRENT ATOM (LANGUAGE ELEMENT)
TSTRNG=X;X=X+TXTSIZ+2	/USER REPLY TO ~ PROMPT
NAME=TSTRNG
WTTIME=X;X=X+7	/SECONDS TO WAIT
GOTRGT=X;X=X+LABSIZ+2	/TARGET FOR "GO" AND "WAIT"
/
WTGO=X;X=X+LABSIZ+2	/TARGET FOR WAIT TIME
/
WTKBS=X;X=X+WTTSIZ	/KEYSTROKES DURING "WAIT KBD"
/
/	WAIT TARGET STRINGS
WTG1=X;X=X+LABSIZ+2
WTG2=X;X=X+LABSIZ+2
WTG3=X;X=X+LABSIZ+2
WTG4=X;X=X+LABSIZ+2
WTG5=X;X=X+LABSIZ+2
/
/	WAIT TEXT STRINGS
WTS1=X;X=X+WTTSIZ+2
WTS2=X;X=X+WTTSIZ+2
WTS3=X;X=X+WTTSIZ+2
WTS4=X;X=X+WTTSIZ+2
WTS5=X;X=X+WTTSIZ+2
WTS6=X;X=X+PHNSIZ+2							/A024
/
KEY=WTS1
NUMBR=WTS6								/A024
/D024NUMBR=WTS2
/
/	BUFFER BLOCKS
WTXLST=X;X=X+5	/WORK POINTERS FOR EACH WAIT STRING
DATTIM=X;X=X+27	/HOLDS DATE & TIME
BUFBEG=X;X=X+100	/HOLD LAST 100 STATEMENT CHARACTERS FOR ABORT
BUFEND=X-1		/LAST LOCATION
	IFZERO BUFEND&4000	<OUT OF SPACE>


