	.TITLE XVM/DOS V1A NON-RESIDENT MONITOR
								/EAG:101
								/EAG:101
								/EAG:101
								/EAG:101
/								/EAG:101
/ COPYRIGHT (C) 1975						/EAG:101
/ DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.			/EAG:101
/								/EAG:101
/ THIS SOFTWARE IS FURNISHED UNDER A LICENSE FOR USE ONLY	/EAG:101
/ ON A SINGLE COMPUTER SYSTEM AND MAY BE COPIED ONLY WITH	/EAG:101
/ THE INCLUSION OF THE ABOVE COPYRIGHT NOTICE.  THIS		/EAG:101
/ SOFTWARE, OR ANY OTHER COPIES THEREOF, MAY NOT BE PRO-	/EAG:101
/ VIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON		/EAG:101
/ EXCEPT FOR USE ON SUCH SYSTEM AND TO ONE WHO AGREES TO	/EAG:101
/ THESE LICENSE TERMS.  TITLE TO AND OWNERSHIP OF THE		/EAG:101
/ SOFTWARE SHALL AT ALL TIMES REMAIN IN DEC.			/EAG:101
/								/EAG:101
/ THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE		/EAG:101
/ WITHOUT NOTICE AND SHOULD NOT BE CONSTRUED AS A COM-		/EAG:101
/ MITMENT BY DIGITAL EQUIPMENT CORPORATION.			/EAG:101
/								/EAG:101
/ DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY	/EAG:101
/ OF ITS SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.	/EAG:101
/								/EAG:101
								/EAG:101
	.EJECT							/EAG:101
/
/
/COPYRIGHT 1971,72,73 DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
/
/
/EDIT  #063	SK	2-JUL-73
/	064	SK	28-AUG-73	UC15 F LPA/LPS/CDA/CDS
/	065	SK	20-SEP-73	UC15 F XYA/XYS
/	066	SK	16-OCT-73	E. 065 BUG FIX
/	067	SK	7-NOV-73	$INSTRUCT TEXT DELETION +
/	068	SK	12-NOV-73	E. 067 BUG FIX
/	069	SK	13-NOV-73	GENERAL CLEAN UP
/					CREATION OF INSTRC PROG
/	070	SK+JMW	27-JUN-74	LOGIN & LOGOUT BUG FIX
/	071	BR	1-JULY-74	REMOVED FLUSH CMD FIXED X4K IN SCOM CMD
/	 072	EK	14-JULY-74	CHANGE SIGNON VERSION NUMBER
/	073	BR	15-JULY-74	FIXED MAC11 API PROBLEM
/	074	EAG	1-AUG-74	FIXED HANDLEING OF "ALL POS. .DAT SLOTS"
/					.DAT SLOT PRINTOUT FOR SYSTEM PROGRAMS
/					IN REQUEST COMMAND
/	075	SK	22-NOV-74	$POLLR ON/OFF COMMAND
/	076	SK	6-DEC-74	CHANGE TO: V3B000,POLLER ON/OFF
/	077	BR	22-DEC-74	AUTOMATE SPLOAD API OFF ACTION
/	078	EAG	2-JAN-75	CHANGE LOGIN/LOGOUT SO THAT CTRL-X
/					WILL BE LEFT ON (IF POSSIBLE)
/	079	EAG	17-JAN-75	MODIFY REQUEST COMMAND SO THAT IT
/					WILL KNOW ABOUT THE EDITORS USE
/					OF .DAT SLOT -12 AND DESCRIBE IT'S
/					AS "LISTING".
/	080	BLR	26-MAY-75	UPGRADE TO XVM COMMAND SET
/	081	BLR	2-JUN-75	CONTINUE XVM UPGRADE
/	082	BLR	17-JUN-75	ADD MODE ROUTINES
/	083	BLR	20-JUN-75	ADD MEMSIZ ROUTINES
/	084	BLR	23-JUN-75	SHORTEN MEMSIZ ROUTINE
/	085	BLR	24-JUN-75	DEBUG NRM : MODE,MEMSIZ,BANK/PAGE
/	086	BLR	25-JUN-75	CLEANUP SCOM MSG
/	087	BLR	08-JUL-75	CAUSE MODE MSG TO APPEAR AT
/					RESTART OF NRM AFTER MODE CHNG.
/	088	BLR	08-JUL-75	CHECK ILLEGAL PROTECTS,
/					MAKE CR ILLEGAL IN MEMSIZ
/	089	BLR	17-JUL-75	REMOVE MAC11/SPLOAD API KLUDGE,
/					REMOVE MODE CODE FROM DATE,
/					ADD MCLOAD TO REQUEST,
/					FIX SCOM LOOP AND BUG,
/					CHANGE REQUEST TO USE LESS TRANSFER,
/					VECTORS
/	090	BLR	19-JUL-75	CAUSE MODE TO OCCUR AFTER DATE HELLO
/	091	BLR	22-JUL-75	ADD .DAT -13 TO EDIT REQUEST
/	092	BLR	23-JUL-75	ADD UIC MSG TO MODE
/	093	BLR	1-AUG-75	SPEED UP MODE MSG
/	094	BLR	6-AUG-75	GET/PUT FIXUP,DELETE RCOM TABLE
/	095	GAR	15-AUG-75	ADD ABILITY TO BATCH FROM  SY,
/					DP,RK,DK,DT, OR MT.
/	096	MJH	20-AUG-75	DISCLAIMER
/	097	BLR	20-AUG-75	ELIMINATE NEED FOR UC15 VERSION
/	098	GAR	29-AUG-75	ADD 'SY' DEVICE MAPPING TO ASSIGN COMMAND.
/	099	GAR	11-SEP-75	FIX BUG IN BOSS WHICH CAUSED AN IOPS0
/					ON SECOND 'BOSS' COMMAND WHEN BOSS NOT
/					IN COMBLK.
/	100	GAR	18-SEP-75	CHANGE HELLO TO 'V1A000'.
/								/EAG:101
/ 101	29-SEP-75	EAG	DELETE UNICHANNEL VARIATION OF	/EAG:101
/				HELLO MESSAGE.  REVISE GET/PUT	/EAG:101
/				COMMANDS IN ACCORDANCE WITH	/EAG:101
/				XVM/DOS RESIDENT MONITOR.	/EAG:101
/				DO THE SAME WITH VT ON/OFF.	/EAG:101
/				FIX A FEW SUBTLETIES RELATED	/EAG:101
/				TO NON-BOSS BATCH.  DELETE	/EAG:101
/				LOGIC TO DETERMINE RIGHT # OF	/EAG:101
/				BUFFERS FOR ALL PROGRAMS, AS	/EAG:101
/				THIS IS DONE BY RESMON.  LEAVE	/EAG:101
/				BUFFS COMMAND, OF COURSE, AND	/EAG:101
/				HAVE IT ADD AN EXTRA BUFFER IF	/EAG:101
/				BOSS OR BATCH IS ACTIVE.	/EAG:101
/				MODIFY REQUEST SO .DAT SLOT -2	/EAG:101
/				WILL PRINT OUT ASSIGNED TO CMD	/EAG:101
/				DEVICE, RATHER THAN TTA.	/EAG:101
/				DELETE EXCESSIVE MODE MESSAGES	/EAG:101
/				BY NOP'ING JMS'S TO SETMD.	/EAG:101
/								/EAG:101
/ 102	03-OCT-75	RKB	FIX A PROBLEM WHICH WAS CAUSING	/RKB-102
/				THE '$' PROMPT TO BE PRINTED ON	/RKB-102
/				BOSS LISTINGS.			/RKB-102
								/RKB-102
/ 103	09-OCT-75	EAG	CHANGE SET UP CODE SO THAT	/EAG:103
/				.UFDT -7 WILL ALWAYS BE SET TO	/EAG:103
/				SYS.  THIS FIXES PROBLEM OF	/EAG:103
/				THE REQUEST COMMAND LISTING	/EAG:103
/				IOS AS THE UIC FOR SLOT -7.	/EAG:103
/								/EAG:103
/ 104	10-OCT-75	GAR	FIX FOR BOSS $ PROMPT PROBLEM
/
/ 105	16-OCT-75	RKB	MAKE MORE COMMANDS LEGAL IN BATCH
/				MODE, AND PASS $JOBS BACK TO 
/				THE NON-RES MONITOR.
/
/ 106	10-NOV-75	RKB	CHANGE $BATCH COMMAND TO ACCEPT 
/				DEVICES OF ANY FLAVOR.  ALSO,
/				FIX $TIME TO ACCEPT TIME OF '0000'.
/				ALSO, CHANGE $TIMEST TO HAVE A
/				DEFAULT TIME LIMIT OF 1 MIN, NOT
/				1 SECOND.
/
/ 107	11-NOV-75	RKB	PUT IN TOMORROWS DATE CALENDER.
/
/ 108	17-NOV-75	RKB	PUT IN CHANGE TO $BATCH COMMAND
/				DECODER TO ALLOW TRAILING BLANKS
/				AFTER FILENAME.
/				ALSO, PUT IN A CHECK OF THE SIZE
/				OF NON-RES MONITOR TO CAUSE AND
/				ASSEMBLY ERROR IF WE ATTEMPT TO
/				SLOP ABOVE LOCATION 16077 OF THE
/				BANK WE'RE RUNNING IN.  THIS WOULD
/				CAUSE US TO CLOBBER SGNBLK, ETC.
/				WHO LIVE IN CORE STARTING AT
/				LOCATION 16100.
/
/ 109	30-NOV-75	GAR	MODIFY REQUEST COMMAND SO THAT IT
/				KNOWS ABOUT EDITVT AND EDITVP'S
/				USE OF .DAT -13 FOR SECONDARY OUTPUT.
/
/
/ DEFINE****NOMODE****FOR NO AUTOMATIC MODE TYPEOUTS****(MODE COMMAND STILL 
/			WILL FUNCTION)
/
/	MACRO TO PRODUCE OFFSETS INTO REQUEST MESSAGE TABLE
/
	.DEFIN	MSG,NR
	MS@NR-MSGTAB		/OFFSET INTO MSGTAB TABLE
	.ENDM
/
SC.TDT=.SCOM+71			/(RKB-107) TOMORROWS DATE WORD
SC.DAY=.SCOM+47			/(RKB-107) TODAYS DATE WORD
/
/
/	MESSAGE NUMBERS MUST BE OF THE FORM MS#
/
/
/	MACRO TO PRODUCE DUMMY HEADERS FOR ASCII MESSAGES
/
	.DEFIN	HDR
	377002
	000000
	.ENDM
/
/
	.TITLE XVM/DOS NRM	KEYBOARD LISTENER
/KEYBOARD LISTENER
ARG=0
SHAL=660000
	JMS	.		/BANK BIT INITIALIZATION
	LAC	.-1
	AND	(60000
	DAC	BANKBT
	LAC	(SYSBLK
	TAD	BANKBT
	DAC	.SYSBL
	LAC	(SGNBLK
	TAD	BANKBT
	DAC	.SGNBL
	TAD	SGNBLK
	DAC	LSGNBL
	LAC	(COMBLK
	TAD	BANKBT
	DAC	.COMBL
	LAC*	(.SCOM+24		/ -(# OF POS .DAT SLOTS)
	TCA			/TWOCMA (BR-080)
	DAC	.DATAD
	LAW	17766		/SAVE CONTENTS OF .DAT -12 AND LP HANDLER
	TAD*	(.SCOM+23		/ADDRESS (IF ANY) IN CASE A LINE PRINTER
	DAC	DATM12		/EXISTS AND LP ON WAS TYPED.THEN SOME OUTPUT
	LAC*	DATM12		/WILL GO TO THE LINE PRINTER.
	DAC	LPADDR
	LAC*	(.SCOM+7
	DAC*	DATM12
	DAC	PRTMP
	LAC*	(.SCOM+4		/RESTORE ALL ENTRIES IN UFD
	AND	(100		/TABLE THAT HAVE EITHER 'BNK'
	SNA!CLA			/OR 'PAG' TO 'SYS'.
	LAC	(156274
	TAD	(021613
	DAC	LDRUIC
	LAC*	(.SCOM+41
	SAD	LDRUIC
	LAC	(233123
	DAC*	(.SCOM+41
	LAW	-16
	TAD*	(.SCOM+25
	DAC	P1
	AAC 16-7		/ POINT CT1 TO .UFDT -7		/EAG:103
	DAC CT1							/EAG:103
	LAC (233123)		/ AND SET .UFDT -7 TO SYS	/EAG:103
	DAC* CT1						/EAG:103
	LAW	-15
	TAD	.DATAD
	DAC	CT1
SYSRES	ISZ P1			/ BUMP POINTER TO NEXT SLOT	/EAG:103
	LAC* P1			/ PICK UP .UFDT SLOT CONTENTS	/EAG:103
	SAD LDRUIC		/ IS IT BNK/PAG?		/EAG:103
	LAC (233123)		/ YES -- SUBSTITUTE SYS		/EAG:103
	DAC* P1			/ AND PUT BACK INTO SLOT	/EAG:103
	ISZ CT1							/EAG:103
	JMP SYSRES						/EAG:103
	LAC*	(.SCOM+23	/COMPUT ADDRESS OF:
	AAC	-2
	DAC	DATM2		/ .DAT -2
	AAC	3
	DAC	DAT1		/ .DAT +1
	AAC	4
	DAC	DAT5		/ .DAT +5
	IAC	
	DAC	DAT6		/ .DAT +6
	LAC	NOPAR		/ COMPUTE ADDRESS OF BEGINNING
	TAD	NODAT		/ OF I/O DEVICE TABLE IN SGNBLK
	TAD	NOSKP
	IAC	
	TAD	.SGNBL
	DAC	SGNTAB
	LAC*	(.SCOM+42		/ RETURN FROM NRM EXIT? (BR-094)
	AND	(200000
	SZA			/ NO
	JMP	NOSETP		/ YES
	LAC*	(.SCOM+42		/'KEEP' ON?
	AND	(2
	SZA				/NO
	JMP	NOSETP			/YES
	JMS	UFDUPD			/SET UP UFD TABLE
	JMS	DATSTP			/ SET UP .DAT TABLE
NOSETP	LAC	COMBLK			/ TOP OF COMBLK
	TAD	.SYSBL
	DAC	COMBLK
	1776				/ .INIT -2,1,NRMEXI
	1
	200000+CTRLC
	0
	LAC*	(.SCOM+52
	SPA
	XOR	(20000
	DAC*	(.SCOM+52
	.INIT	-3,1,CTRLP
	LAC*	(.SCOM+42
	AND	(200000
	SZA
	JMP	CLEXIT
	LAC*	(.SCOM+52		/SKIP IF IN BOSS XVM MODE
	SPA
	JMP	CLEXIT
	JMS TYPE		/ TYPE MONITOR HELLO		/EAG:101
	  KLBUF2-2		/ MESSAGE			/EAG:101
	LAC*	(.SCOM+47	/GET DATE FROM .SCOM (BR-097)
	SZA
	JMP	CLEXIT
REQDAT=.
	JMS	TYPE
	KLBUF8-2
	.READ	-2,2,KLBUFF,80
	LAC	(KLBUFF+2
	DAC	KLGETP
	LAW	-1
	DAC	KLGET5
	DZM	SYSRES
	.WAIT	-2
	JMP	KLDATE
CLEXIT	LAC*	(.SCOM+42	/GET BIT SWITCH SCOM WORD (BR-087)
	AND	(577777 	/CLEAR  RETURN TO NRM BIT (BR-087)
	DAC*	(.SCOM+42
	LAC*	(SC.DAY)	/(RKB-107) GET TODAY'S DATE
	SNA			/(RKB-107) IS IT VALID?
	JMP	TDT.2		/(RKB-107) NO, SKIP THIS
	DAC	NR.DAY
	AAC	100		/(RKB-107) ADD ONE TO DAY OF MONTH
	DAC	NR.DAY		/(RKB-107) THAT IS USUALLY ALL WE NEED
	CLL!RTR			/(RKB-107) IS THIS A LEAP YEAR?
	SPA			/(RKB-107) SKIP IF YES
	STL			/(RKB-107) NO, SET THE LINK
	AND	(770000/4)	/(RKB-107) STRIP OFF THE MONTH
	SAD	(40000/4)	/(RKB-107) CHECK FOR 30-DAY MONTHS, APRIL
	LAW	-3		/(RKB-107)
	SAD	(60000/4)	/(RKB-107) JUNE, 30-DAY
	LAW	-3		/(RKB-107)
	SAD	(110000/4)	/(RKB-107) SEPTEMBER, 30-DAY
	LAW	-3		/(RKB-107)
	SAD	(130000/4)	/(RKB-107) NOVEMBER, 30-DAY
	LAW	-3		/(RKB-107)
	SAD	(20000/4)	/(RKB-107) WHEN SHORT FEBRUARY'S DONE...
	SKP			/(RKB-107)
	JMP	.+3		/(RKB-107) NOT FEB.
	CLC; RAL		/(RKB-107) FEBRUARY
	SMA			/(RKB-107) SPECIAL MONTH?, YES SKIP
	LAW	-4		/(RKB-107) ALL THE REST HAVE 31.
	AAC	-34		/(RKB-107)
	TCA			/(RKB-107) BUILD MASK FOR LAST DAY
	ALSS	6		/(RKB-107) ...
	XOR	NR.DAY		/(RKB-107) ARE WE THERE?
	AND	(7700)		/(RKB-107)
	SZA			/(RKB-107) SKIP IF YES, NEED TO DO MONTH
	JMP	TDT.1		/(RKB-107) NO, SAME MONTH
	LAW	770077		/(RKB-107) SAVE MONTH AND YEAR
	AND	NR.DAY		/(RKB-107) BUT DAY 0
	TAD	(10000+100)	/(RKB-107) NEXT MONTH, DAY ONE
	DAC	NR.DAY		/(RKB-107) OK.
	AND	(770000)	/(RKB-107) NOW DID THAT MAKE 13TH MONTH?
	SAD	(150000)	/(RKB-107) ...
	SKP			/(RKB-107)
	JMP	TDT.1		/(RKB-107) NO, ALL DONE
	LAC	(-140000+1)	/(RKB-107) YEAR + 1, MONTH ONE (DAY ALREADY
	TAD	NR.DAY		/(RKB-107)  SET TO ONE)
	DAC	NR.DAY		/(RKB-107)
TDT.1	LAC	NR.DAY		/(RKB-107) NOW MOVE IT TO SCOM
	DAC*	(SC.TDT)	/(RKB-107) 
TDT.2=.				/(RKB-107)
	LAC*	(.SCOM+52		/SKIP IF IN BOSS XVM MODE
	SMA			/SKIP IF BOSS (BR-090)
	JMP	KLOK		/NOT BOSS-SEE IF MODE TYPEOUT IS NEEDED (BR-090)
	AND	(000001		/BOSS JOB ABORT ? (BR-090)
	SZA			/SKIP IF NOT (BR-090)
	JMP	BOSS15		/YES - GO ABORT (BR-090)
	JMP	KLOKRD		/ EVEN IF ITS NOT AN ABORT,	/RKB-102
				/ DON'T PROMPT WITH BOSS.	/RKB-102
KLOK1	LAC* (.SCOM+52)	/(GAR-104) IF BOSS IS RUNNING DON'T PROMPT.
	SPA			/(GAR-104) IS BOSS RUNNING?
	JMP KLOKRD		/(GAR-104) YES.
	JMS TYPE		/(GAR-104) TYPE $ PROMPT CHARACTER
	KLBUF3-2
KLOKRD	.READ	-2,2,KLBUFF,80		/READ TTI
	LAC	(KLBUFF+2		/SET UP GET ROUTINE
	DAC	KLGETP			/KLGET POINTER
	LAW -1
	DAC KLGET5
	.WAIT	-2
	JMP .MCD
FLUSH=.
	LAC	SYSRES
	SNA
	JMP	REQDAT
	LAC	STOPER
	SMA
	JMP	KLOK			/NON-BATCH PROCESS
	JMP	NRM.2		/(RKB-106) RIGGED SO THAT AN ERROR ON A $BATCH COMMAND
				/(RKB-106) WILL CAUSE US TO LEAVE BATCH MODE,
				/(RKB-106) EXPECIALLY NICE IN CASE OF 'CHAINED' $BATCH'ES
/
CTRLP=.
	LAC	LOGWF
	SNA
	LAC*	(.SCOM+52
	SMA
       JMP .+3                                                                  
       LAC     WTIME1          /RESTORE RUN TIME TO ITS                         
       DAC*    (134            /VALUE BEFORE LOGW.                              
	LAC	WTIME
	DAC*	(.SCOM+56
	LAC	PRTMP			/RESTORE .DAT -12
	DAC*	DATM12
KLOK=.
KLOKLF=.
	LAC*	DATM12			/IN CASE .DAT -12 WAS CHANGED
	DAC	PRTMP			/SAVE ITS NEW VALUE.
	LAC*	(.SCOM+52		/BOSS XVM MODE?
	SPA				/NO.
	JMP	KLOKRD			/YES. DO NOT TYPE $
	JMS	TYPE			/ TYPE LINE FEED
	KLBUF6-2
	.IFUND	NOMODE
	LAC*	(.SCOM+42	/GET DO MODE TYPEOUT BIT (BR-090)
	AND	(004000		/TEST DO MODE BIT (BR-090)
	SNA			/SKIP IF DO MODE (BR-091)
	JMP	KLOK1		/DON'T DO MODE - READ LINE (BR-091)
	JMS	DOMODE		/TYPE MODE INFO OUT (BR-090)
	LAC*	(.SCOM+42	/GET MODE WORD (BR-090)
	AND	(773777		/CLEAR OUT DOMODE BIT - IF SET (BR-090)
	DAC*	(.SCOM+42	/SAVE WORD (BR-090)
	JMS	TYPE		/TYPE OUT ANOTHER LINE FEED (BR-090)
	KLBUF6-2
	.ENDC
	JMP	KLOK1		/GO READ LINE (BR-090)
	.TITLE XVM/DOS NRM	ERROR ROUTINES
/ERROR ROUTINES
KLWHAT=.
	JMS	PRERR		/WRITE WHAT 
	ARG	KLBUF1-2
	JMP FLUSH		/NEXT MESSAGE
/ILLEGAL DEVICE
KLILLD	JMS	PRERR
	ARG	KLBUF4-2
	JMP FLUSH
/ILLEGAL UNIT NO.
KLBADU	JMS	PRERR
	ARG	KLBUFA-2
	JMP FLUSH
ILLCOD=.
	JMS	PRERR
	ARG	CODERR-2
	JMP	FLUSH
ILLONF=.
	JMS	PRERR
	ARG	ONFERR-2
	JMP	FLUSH
/ILLEGAL .DAT SLOT
KLBDAT	JMS	PRERR
	ARG	KLBUF5-2
	JMP FLUSH
/ILLEGAL MODIFICATIONS
KLNMOD	JMS	PRERR
	ARG	KLBUF7-2
	JMP FLUSH
/BAD COMMAND IN BATCH MODE
KLBBCM	JMS	PRERR
	ARG	KLBUFH-2
	JMP FLUSH
/BAD UIC CONSTRUCTION
/
FETUER	JMS	PRERR
	ARG	FETER-2
	JMP	FLUSH
BADGET=.
	JMS	PRERR
	ARG	GETERR-2
	JMP	FLUSH
BADINS=.
	JMS	PRERR
	ARG	INSER-2
	JMP	FLUSH
BADIGT=.
	JMS	PRERR
	ARG	DIGERR-2
	JMP	FLUSH
BADATE=.
	JMS	PRERR
	ARG	DATERR-2
	JMP	FLUSH
BADTIM=.
	JMS	PRERR
	ARG	TIMERR-2
	JMP	FLUSH
BADLIM=.
	JMS	PRERR
	ARG	LIMERR-2
	JMP	FLUSH
BADCHN=.
	JMS	PRERR
	ARG	CHNERR-2
	JMP	FLUSH
BADHNO=.
	JMS	PRERR
	ARG	HNOERR-2
	JMP	FLUSH
BADBOS=.
	JMS	BOSTTY
	JMS	PRERR
	ARG	BOSERR-2
	DZM*	(152
	JMP	NRMEXI
BADUNT=.
	JMS	PRERR
	ARG	UNTERR-2
	JMP	FLUSH
MSZBAD=.
	JMS	PRERR	/PRINT ERROR MEMSIZ ILLEGAL (BR-082)
	ARG	BADMSZ-2	/"
	JMP	FLUSH	/TRY AGAIN (BR-082)
	.TITLE XVM/DOS NRM	'TYPE'
/TYPE SUBROUTINE
/CALLING SEQUENCE:
/	JMS TYPE
/	BUFFER ADDRESS
/	(RETURN)
/
NR.DAY=.			/(RKB-107) TEMPORARY
/
TYPE	0
	LAC*	(152
	DAC	BOSOUT
	LAC* TYPE		/GET BUFFER ADDRESS
	DAC .+3
	CAL+2775
	11
	XX
	-60
	LAC	BOSOUT
	DAC*	(152
	CAL+775
	12
	ISZ TYPE		/TO RETURN
	JMP* TYPE
BOSOUT	0
PRERR	0
	LAC*	PRERR		/BANK BIT INIT BUFFER
	AND	(17777		/ADDRESS
	TAD	BANKBT
	DAC	.+2
	JMS	TYPE
	0
	ISZ	PRERR
	JMP*	PRERR
	.TITLE XVM/DOS NRM	'PRINT'
/
/PRINT SUBROUTINE
/CALLING SEQUENCE:
/	JMS PRINT
/	BUFFER ADDRESS
/	(RETURN)
/ROUTINE 'PRINT' PRINTS A .ASCII LINE TO THE LINE
/PRINTER, OR WHATEVER IS ASSIGNED TO .DAT -12
PRNFST	0
	LAC*	(152	/BOSS15 MODE?
	SMA			/YES, SKIP AND TYPE FORM FEED TO .DAT -3
	JMP	PRNF.1
	.WRITE	-3,2,FORMFD-2,4
PRNF.1=.
	LAC	(1766
	DAC	PRINIT
	LAC	PRNFST
	DAC	PRINT
	SKP
PRINT=.
	0
	LAC*	(152
	SMA
	JMP	.+4
	LAC	PRINT
	DAC	TYPE
	JMP	TYPE+1
	LAC*	PRINT
	IAC	
	DAC*	(16
	LAC	(PRNTBF+1
	DAC*	(17
	LAC	(-56
	DAC	PRTMP1
	LAC*	16
	DAC*	17
	ISZ	PRTMP1
	JMP	.-3
	LAC*	DATM12		/SET UP .DAT -12
	DAC	PRTMP
	LAC	LPADDR
	DAC*	DATM12
PRINIT	.INIT	-12,1,CTRLP	/
	LAC	(JMP PRWRIT
	DAC	PRINIT
PRWRIT=.
	.WRITE	-12,2,PRNTBF,48
	.WAIT	-12
	LAC	PRTMP		/RESTORE .DAT -12
	DAC*	DATM12
	ISZ	PRINT
	JMP*	PRINT
PRTMP	0
PRTMP1	0
PRNTBF	022002
	.BLOCK	57
	.TITLE XVM/DOS NRM	COMMAND DECODER
/
/COMMAND DECODER
/
.MCD=.
	LAC	(740000		/RESET 'SKIP IF BOSS15' FLAG
	DAC	SKPBOS
	LAC	(12		/DUMMY LINEFEED
	DAC	KLCHAR		/WILL CAUSE LEADING LF+BLNKS TO BE IGNORED
	JMS	KLPGSH		/GET COMMAND IN KLCOM.
	LAC	KLCOM		/WAS THERE A COMMAND?
	SNA			/YES, CONTINUE.
	JMP	KLOK		/NO, READ NEXT COMMAND.
	JMS	KLTABL		/IS COMMAND LEGAL?
	FULCMD
	CMDISP
	JMP	LOADSY		/NO, CHECK FOR SYS FILE LOADING COMMAND.
	LAC	KLCOMP		/YES.
	DAC	TVCNT
	LAC*	KLCOMP		/GET PROCESSING ROUTINE ADDRESS
	DAC	KLCOMP
	LAC	STOPER		/BATCH ON?
	SPA			/NO.
	JMP	.+2		/YES.
	JMP*	KLCOMP
	LAC	KLCOMP		/ TEST FOR LEGAL COMMAND.
	RAL
	SPA
	JMP KLBBCM
	JMP*	KLCOMP
	.EJECT
/
/TABLE SEARCH SUBROUTINE
/	JMS KLTABL
/	TAB1		/ADDRESS OF TABLE OF COMMANDS
/	TAB2		/ADDRESS OF DISPATCH ADDRESS (&SIZE)
/	(RETURN)		/BAD COMMAND
/	(RETURN)		/GOOD COMMAND
/
KLTABL	0
	LAC* KLTABL	/GET COMMAND ADDRESS
	ISZ KLTABL	/BUMP TO NEXT ARG
	DAC KLDIRF	/SAVE IN SIXBT UNPACK
	LAC* KLTABL	/GET DISPATCH ADDRESS
	ISZ KLTABL	/BUMP TO RETURN
	DAC KLCOMP	/SAVE
	LAC* KLCOMP	/GET TABLE SIZE
	ISZ KLCOMP
	DAC KLCNTT	/SAVE SIZE FOR # OF ENTRIES
	DAC SINGOK		/ACCEPT SINGLE LETTER COMMANDS
	DZM KLPOS		/CLEAR POSITION INDICATOR
NEXTCM	LAC (KLCOM2		/INITIALIZE PACK
	DAC KLPUTP
	DZM KL57
	DZM SIXROS		/DON'T MAKE RO INTO SPACE
	DZM KLCOM2		/CLEAR SECONDARY COMMAND STORAGE
	DZM KLCOM2+1
	DZM KLCOM2+2
	DZM KLCOM2+3
	LAW -1		/INITIALIZE UNPACK
	DAC KLCNT
NXTCHR	JMS KLFSIX	/GET CHARACTER
	SNA
	JMP PCKDON	/ALL DONE PACKING
	JMS KLPUT		/PACK INTO KLCOM2
	JMP NXTCHR
PCKDON	LAC KLCOM
	SAD KLCOM2	/TEST WD 1
	SKP
	JMP NSAME
	LAC KLCOM+1
	SAD KLCOM2+1	/TEST WD2
	SKP
	JMP NSAME
	LAC KLCOM+2
	SAD KLCOM2+2	/TEST WD3
	SKP
	JMP NSAME
	LAC KLCOM+3
	SAD KLCOM2+3	/TEST WD4
	JMP SAME			/GOOD MATCH
NSAME	LAC SINGOK
	SNA
	JMP NXNSAM		/NO SINGLE LETTER COMMANDS
	LAC KLCOM2
	AND (774000	/GET 1ST CHAR
	SNA
	DZM SINGOK		/SET FOR FULL WORD COMMANDS
	SAD KLCOM
	JMP SAME		/GOOD MATCH
NXNSAM	ISZ KLPOS
	ISZ KLCNTT		/SKIP IF NO MORE COMMANDS
	JMP NEXTCM	/TRY NEXT COMMAND
	JMP* KLTABL	/EXIT-BAD
SAME	LAC KLCOMP
	TAD KLPOS
	DAC KLCOMP
	ISZ KLTABL	/BUMP TO GOOD EXIT
	LAC* KLCOMP	/DISPATCH ADR IN AC
	JMP* KLTABL	/EXIT-GOOD
	.TITLE XVM/DOS NRM	COMMAND TABLE
/COMMAND TABLE
/NOTE: EACH COMMAND TERMINATED BY NULL
FULCMD	.SIXBT	/LOG@/			/ KLLOG
	.SIXBT	/LOGW@/			/ KLLOGW
	.SIXBT	/SCOM@/			/ KLSCOM
	.SIXBT	/INSTRUCT@/
	.SIXBT	/REQUEST@/
	.SIXBT	/ASSIGN@/
	.SIXBT	/PROTECT@/		/ KLPRO
	.SIXBT	/KEEP@/			/ KLKEEP
	.SIXBT	/DATE@/			/ KLDATE
	.SIXBT	/TIME@/			/ KLTIME
	.SIXBT	/QDUMP@/
	.SIXBT	/HALT@/
	.SIXBT	/GET@/			/ KLCGET
	.SIXBT	/LOGIN@/		/ KLNLIN
	.SIXBT	/GETP@/			/ KLCGTP
	.SIXBT	/GETT@/			/ KLGETT
	.SIXBT	/GETS@/			/ KLGETS
	.SIXBT	/PUT@/			/ KLGPUT
	.SIXBT	/LOGOUT@/		/ KLNLOT
	.SIXBT	/M@/		/ KLWHAT
	.SIXBT	/MICLOG@/		/ KLNMIC
	.SIXBT	/HALF@/			/ KLHALF
	.SIXBT	/DOS15@/
LQFILE	.SIXBT	/QFILE@/
	.SIXBT	/V@/
	.SIXBT	/VT@/
	.SIXBT	/3@/
	.SIXBT	/TAB@/		/KL33TY (BR-080)
	.SIXBT	/FILL@/		/KLLA30 (BR-080)
	.SIXBT	/LP@/			/ KLLP
	.SIXBT	/API@/
	.SIXBT	/BATCH@/
	.SIXBT /POLLER@/
LBOSS	.SIXBT	/BOSS@/
	.SIXBT	/BANK@/			/ KLBANK
	.SIXBT	/PAGE@/			/ KLPAGE
	.SIXBT	/BUFFS@/		/ KLNBUF
	.SIXBT	/CHANNEL@/
	.SIXBT	/TIMEST@/
EXECUT	.SIXBT	/EXECUTE@/		/ KLEXEC
	.SIXBT	/@/			/ KLOK
LOAD	.SIXBT	/LOAD@/			/ KLLOA
GLOAD	.SIXBT	/GLOAD@/		/ KLGLO
DDT	.SIXBT	/DDT@/			/ KLDDT
	.SIXBT	/DDTNS@/		/ KLDDTN
	.SIXBT	/XVM@/		/KLXVM (BR-080)
	.SIXBT	/UC15@/		/KLUC15 (BR-080)
	.SIXBT	/MEMSIZ@/	/KLMSIZ (BR-080)
	.SIXBT	/MODE@/		/KLMODE (BR-082)
	.SIXBT	/$JOB@/		/(RKB-105)  (IGNORED)
	.EJECT
/DISPATCH TABLE FOR NORMAL COMMANDS
/	+200000 MEANS ILLEGAL IN BATCH MODE
/	+400000 MEANS $JOB
/
CMDISP	CMDISE-CMDISP\777777+2
	KLLOG
	KLLOGW
	KLSCOM
	KLINS
	KLREQ
	KLASI
	KLPRO
	KLKEEP
	KLDATE
	KLTIME
	KLTDU+200000
	KLHALT+200000
	KLCGET+200000
	KLNLIN
	KLCGTP+200000
	KLGETT+200000
	KLGETS+200000
	KLGPUT+200000
	KLNLOT
	KLWHAT
	KLNMIC
	KLHALF
	KLWHAT
	KLWHAT
	KLWHAT
	KLVT
	KLWHAT
	KL33TY
	KLLA30
	KLLP
	KLAPI			/(RKB-105) REMOVED 'ILL IN BATCH' BIT
	KLBAT			/(RKB-105) //
	KLPLR			/(RKB-105) //
	BOSS15
	KLBANK
	KLPAGE
	KLNBUF
	KL7OR9
	TIMLIM
PLOADC	KLEXEC
	KLOK
	KLLOA+200000
	KLGLO
	KLDDT+200000
	KLDDTN+200000
	KLXVM		/XVM ON/OFF (BR-080)
	KLUC15		/UC15 ON/OFF (BR-080)
	KLMSIZ		/MEMSIZ NNN (BR-080)
	KLMODE		/MODE (BR-082)
	KLOK1+400000		/(RKB-105) $JOB
CMDISE=.
	.TITLE XVM/DOS NRM	MONITOR PRINT-OUT BUFFERS
/MONITOR PRINTOUT BUFFERS
	HDR
KLBUF1	.ASCII	' ILLEGAL COMMAND '<15>
	HDR							/EAG:101
KLBUF2	.ASCII 'XVM/DOS V1A000'<15>				/EAG:101
	HDR
KLBUF3	.ASCII	'$'<175>
	HDR
KLBUF4	.ASCII	' BAD DEV'<15>
	HDR
KLBUF5	.ASCII	' BAD .DAT SLOT'<15>
	HDR
KLBUF6	.ASCII	<12><15>
	HDR
KLBUF7	.ASCII	' PERM .DAT SLOT'<15>
	HDR
KLBUF8	.ASCII	' ENTER DATE (MM/DD/YY) - '<175>
	HDR
KLBUFA	.ASCII	' BAD UNIT - IGNORED FROM ERR'<15>
	HDR
KLBUFD	.ASCII	'     '<175>
	HDR
KLBUFG	.ASCII	 ' BAD BATCH DEV'<15>
	HDR
KLBUFH	.ASCII	' BAD COMMAND IN BATCH MODE'<15>
	HDR
FETER	.ASCII	' BAD UIC'<15>
	HDR
GETERR	.ASCII	' FILE NAME MISSING'<15>	/(BR-094)
	HDR
CODERR	.ASCII	'ILLEGAL PROTECTION CODE'<15>
	HDR
ONFERR	.ASCII	'"ON" OR "OFF" NOT TYPED'<15>
	HDR
INSER	.ASCII	'ILLEGAL $INSTRUCT COMMAND'<15>
	HDR
DIGERR	.ASCII	'NON-NUMERIC CHARACTER IN ARGUMENT'<15>
	HDR
DATERR	.ASCII	'BAD DATE - IGNORED'<15>
	HDR
TIMERR	.ASCII	'BAD TIME - IGNORED'<15>
	HDR
LIMERR	.ASCII	'ILLEGAL TIME LIMIT SPECIFIED - 1 MIN. ASSUMED'<15>
	HDR
FORMFD	.ASCII	<14><15>
	HDR
CHNERR	.ASCII	'ILLEGAL CHANNEL SPECIFICATION'<15>
	HDR
HNOERR	.ASCII	'NON-EXISTANT HANDLER NUMBER'<15>
	HDR
BOSERR	.ASCII	'SYSTEM NOT CONFIGURED FOR BOSS XVM MODE'<15>
	HDR
UNTERR	.ASCII	'ILLEGAL UNIT NUMBER'<15>
	HDR
BADMSZ	.ASCII	'BAD MEMORY SIZE - IGNORED'<15>
	.TITLE XVM/DOS NRM	5/7 ASCII UNPACKING ROUTINE
/IOPS 5/7 ASCII UNPACKING ROUTINE
/INITIALIZE:
/	KLGET5 TO LAW -1
/	KLGETP TO BUFFER ADDRESS+2
/
KLGET	0
	ISZ KLGET5
	JMP KL5GET	/WORD PAIR STARTED
	LAC* KLGETP	/NEED NEXT PAIR
	ISZ KLGETP
	DAC KLWD1		/FIRST PART
	LAC* KLGETP
	ISZ KLGETP
	DAC KLWD2		/LAST PART
	LAW 17773		/RESET CHAR COUNT
	DAC KLGET5
KL5GET	LAW 17770		/SHIFT LOOP 7+1/2 TIMES
	DAC KLWD3
KL6GET	LAC KLWD2
	RAL
	ISZ KLWD3
	JMP .+3
	AND (177		/GOT CHARACTER
	JMP* KLGET	/EXIT
	DAC KLWD2
	LAC KLWD1
	RAL
	DAC KLWD1
	JMP KL6GET	/BACK TO LOOP
	.TITLE XVM/DOS NRM	5/7 ASCII PACKING ROUTINE
/IOPS 5/7 ASCII PACKING ROUTINE
/INITIALIZE:
/	KL57 TO ZERO
/	KLPUTP TO BUFFER ADDRESS+2
/
KLPUT	0
	AND (177
	DAC KLCHR2
	CLL
	LAC KL57		/CHAR POSITION
	TAD (JMP* KLJ57
	DAC .+2
	LAC KLCHR2
	XX		/MODIFIED JMP
KLJ57	KL571		/CHAR1
	KL572		/CHAR2
	KL573		/CHAR3
	KL574		/CHAR4
	KL575		/CHAR5
KL571	RTR		/8 RIGHT
	JMS	RSHFT6
KL571A	DZM*	KLPUTP		/CLEAR DATA WORD
	JMP	KLND57
KL572	RTL		/4 LEFT
	RTL
	JMP KLND57
KL573	RTR		/3 RIGHT-1ST HALF
	RAR
	AND (17
	XOR* KLPUTP
	DAC* KLPUTP
	ISZ KLPUTP	/LAST WORD OF PAIR
	LAC KLCHR2	/2ND HALF
	RTR		/4 RIGHT
	RTR
	AND (700000
	JMP KL571A
KL574	RTL		/8 LEFT
	JMS	LSHFT6
	JMP	KLND57
KL575	RAL		/1 LEFT
	DZM KL57		/RESET 5/7 COUNTER
	SKP
KLND57	ISZ KL57
	XOR* KLPUTP
	DAC* KLPUTP
	LAC KL57
	SNA
	ISZ KLPUTP	/2ND WORD COMPLETE
	LAC KLCHR2
	JMP* KLPUT	/EXIT
	.TITLE	XVM/DOS NRM	5/7 ASCII PACK INTO BUFFER ROUTINE
/
/	THIS ROUTINE TAKE 5/7 ASCII AND PACKS IT INTO A BUFFER
/	IN 5/7 ASCII
/
/	SET UP BEFORE FIRST CALL : DZM KL57
/				   LAC (BUFFER+2
/				   DAC KLPUTP
/	FORMAT OF EACH CALL	JMS	STUFF
/				TEXTPOINTER
/
/	NOTE: ALL TEXT STRINGS SHOULD END IN <0>
/
/
/	THIS ROUTINE USES KLPUT AND KLGET !
/
STUFF	0			/ENTRY TO MOVE 5/7 ASCII MESSAGES INTO ONE
				/BUFFER ROUTINE (BR-093)
	LAW	-1		/SET UP KLGET 5/7 UNPACK ROUTINE (BR-093)
	DAC	KLGET5		/""""" (BR-093)
	LAC*	STUFF		/POINTER TO 5/7 TEXT (BR-093)
	DAC	KLGETP		/SET UP KLGET (BR-093)
	ISZ	STUFF		/POINT TO EXIT (BR-093)
STUFF1	JMS	KLGET		/GET A CHAR (BR-093)
	SNA			/SKIP IF NOT A NULL (BR-093)
	JMP*	STUFF		/A NULL - QUIT (BR-093)
	JMS	KLPUT		/STUFF IT IN BUFFER (BR-093)
	JMP	STUFF1		/GET NEXT CHAR (BR-093)
	.TITLE XVM/DOS NRM	.SIXBT UNPACKING ROUTINE
KLFSIX	0		/FROM SIXBIT
	ISZ	KLCNT
	JMP	KLFSXT
	LAC*	KLDIRF
	ISZ	KLDIRF
	DAC	TVCNT
	LAW	-3
	DAC	KLCNT	/SETUP 3 CHAR CT.
KLFSXT	LAC	TVCNT
	JMS	LSHFT6
	DAC	TVCNT
	RAL
	AND	(77
	SZA
	JMP	SIXOK
	LAC	SIXROS
	SZA!CLA
	LAC	(40
SIXOK	DAC	KLCNTB	/SAVE
	AND	(40
	SNA!CLL!CML
	CLL
	LAC	KLCNTB
	SNL!SZA		/NO BIT 7
	XOR	(100
	JMP*	KLFSIX	/EXIT
	.TITLE XVM/DOS NRM	$LOG, $LOGW
/$LOG COMMAND ROUTINE
/	IN LOG MODE UNTIL
/	ALT MODE ENCOUNTERED IN
/	COMMAND STRING
KLLOG=.
	DZM	LOGWF		/CLEAR LOG-WAIT FLAG
	JMP	LOG1
LOGEND=.
	LAC	LOGWF		/ WAS COMMAND LOG AND WAIT?
	SNA			/YES, TYPE BELLS TP WAKE UP OPERATOR.
	JMP	KLOK		/NO.
	JMS	BOSTTY
	JMS	TYPE
	BELLS-2
	JMS	BOSTTY
	JMS	TYPE
	UPAROP-2
	JMP	.
	JMP	KLOK
BELLS	.ASCII	<3><12><7><7><7><7><15>
	.LOC	.-1
UPAROP	.ASCII	<3><12>'^P'<15>
LOG1=.
/IF IN BOSS XVM MODE ECHO LINE ON TTY
	LAC*	(152	/BOSS XVM?
	SMA			/YES
	JMP	LOG2		/NO
	JMS	BOSTTY
	JMS	TYPE
	KLBUFF
	JMP	LOGEND
LOG2=.
	JMS KLGET		/GET CHAR
	SAD (175
	JMP	LOGEND		/ALT MODE
	SAD (15
	JMP KLCRR		/CARRIAGE RETURN
	JMP	LOG2		/NEXT CHAR
KLCRR=.
	JMS TYPE		/OUTPUT 5 SPACES
	KLBUFD-2
	CAL+2776		/GET NEXT PART OF COMMAND
	10
	KLBUFF
	-120
	CAL+776			/WAIT
	12
	LAC	(KLBUFF+2	/SET UP TO SEARCH BUFFER
	DAC KLGETP
	LAW -1
	DAC KLGET5
	JMP LOG1
LOGWF	0
WTIME	0
WTIME1 0                                                                        
KLLOGW=.
	ISZ	LOGWF
	LAC*	(156
	DZM*	(156
	DAC	WTIME
	LAC*	(152
	SMA
	JMP	.+3
       LAC*    (134            /SAVE RUN TIME SO IT CAN                         
       DAC     WTIME1          /BE SUSPENDED DURING WAIT                        
	JMP	LOG1
	.TITLE XVM/DOS NRM	$QDUMP, $HALT
/$QDUMP COMMAND ROUTINE
KLTDU	LAC*	(142		/SET TO ECHO ^Q
	AND	(747777
	XOR	(020000
	DAC*	(142
	LAC*	(152
	SMA
	JMP	KLOK
	AND	(773777
	XOR	(4000
	DAC*	(152
	JMP	KLOK
	JMP	KLOK
/
/$HALT COMMAND ROUTINE
KLHALT=.
	LAC*	(152
	SPA
	JMP	KLOK
	LAC*	(142
	AND	(747777
	XOR	(010000
	DAC*	(142
	JMP	KLOK
	.TITLE XVM/DOS NRM	$REQUEST
/
/$REQUEST COMMAND PROCESSOR
/
KLREQ=.
	JMS	KLPGSH		/WHAT KIND OF REQUEST?
	LAC	KLCOM
	SNA
	JMP	RQALL		/REQUEST ALL .DAT SLOTS
	SAD	USER
	SKP
	JMP	RQPRG		/REQUEST CUSP'S .DAT SLOTS
	LAC	KLCOM+1
	SAD	USER+1
	JMP	RQUSER		/REQUEST POSITIVE .DAT SLOTS
	JMP	RQPRG		/REQUEST CUSP'S .DAT SLOTS
/
RQALL=.
	JMS	PRNFST		/ TYPE OUT HEADER
	RQHDR-2
	LAC	(RQD2BG		/INITIALIZE TABLE POINTER
	DAC	RQD2
	LAC*	(123	/FIND .DAT -15
	AND	(77777
	AAC	-15
	DAC	RQDM15
	LAC*	(125	/FIND UIC FOR .DAT -15
	AND	(77777
	AAC	-15
	DAC	RQUM15
/ TYPE OUT NEGATIVE .DAT SLOT ASSIGNMENTS
RQALL1=.
	DZM	KL57		/INITIALIZE 5/7 PACKING
	LAC	(RQLIN		/ROUTINE
	DAC	KLPUTP
	LAC*	RQD2		/PACK .DAT SLOT
	JMS	RQPAK6
	ISZ	RQD2
	LAC	RQD2		/ARE WE DONE?
	SAD	(RQD2AL
	SKP
	JMP	RQALL2
	LAC	(RQD2BG
	DAC	RQD2
RQALL2=.
	JMS	RQTAB		/PACK HT
/PACK DEVICE NAME
	LAC	RQD2		/HANDLE .DAT SLOTS -7,-3,-2 AS
	SAD	(RQD2M7		/SPECIAL CASES.
	JMP	RQM7		/.DAT -7
	SAD	(RQD2M3
	JMP	RQM3		/.DAT -3
	SAD	(RQD2M2
	JMP	RQM2		/.DAT -2
	SAD	(RQD2AL
	SKP
	JMP	.+4
	LAC*	(152
	SPA
	JMP	RQM7
	LAC*	RQDM15		/GET HANDLER NAME
	AND	(77777
	JMS	FIONM
	JMS	RQPAK6
	LAC*	RQDM15		/UNIT NUMBER
	RTL
	RTL
	AND	(7
	SNA			/DO NOT TYPE UNIT 0,TYPE
	LAC	(760		/A SPACE INSTEAD.
RQALL3=.
	AAC	60
	JMS	KLPUT
	ISZ	RQDM15
	JMP	RQALL4
RQM7	LAC	SDEV1		/.SIXBT 'DKL'
	XOR	(14
	SKP
RQM3	LAC	(242401		/.SIXBT 'TTA'
	SKP							/EAG:101
RQM2	LAC (031504)		/ .SIXBT "CMD"			/EAG:101
	JMS	RQPAK6
	LAC	(760		/UNIT 0, LEAVE BLANK.
	JMP	RQALL3
/ALL DONE FOR DEVICE
/BEGIN UIC
RQALL4=.
	JMS	RQTAB		/PACK HT
/PACK UIC
	LAC*	RQUM15
	JMS	RQPAK6
	LAC	(15		/PACK CARRIAGE RETURN
	JMS	KLPUT
	ISZ	RQUM15
	JMS	PRINT
	RQLIN-2
/ARE WE DONE?
	LAC	RQD2
	SAD	(RQD2BG
	JMP	RQUSR0		/YES
	JMP	RQALL1		/NO
	.EJECT
RQUSER=.
	JMS	PRNFST		/TYPE HEADER
	RQHDR-2
RQUSR0	LAW -1			/SET UP LOC. 10 AND SWI SO THAT AFTER
	TAD SWI			/  TYPING OUT POS. .DAT SLOTS WE CAN
	DAC* (10		/  JMP TO CODE TO TYPE OUT SYSTEM PROGRAM
/				/  .DAT SLOTS AND IMMEDIATELY EXIT TO
/				/  KLOK (KEYBOARD LISTENER)
/				/SEE THE THREE KLUDGES BELOW
RQKLDG	LAC	DAT1		/FIND .DAT +1
	DAC	RQDM15
	LAC*	(125	/FIND UIC FOR .DAT +1
	AND	(77777
	IAC	
	DAC	RQUM15
	LAC	.DATAD		/GET -(#POS. .DAT SLOTS)
	DAC	RQPOS
	LAC	(536160
	DAC*	(RQD3AL
	LAC	(RQD3BG
	DAC	RQD3
/TYPE .DAT SLOT
RQUSR1=.
	DZM	KL57		/INITIALIZE 5/7 PACKING
	LAC	(RQLIN		/ROUTINE.
	DAC	KLPUTP
	LAC*	RQD3		/PACK .DAT SLOT
	JMS	RQPAK6
	LAC	RQD3		/.DAT +1 TO .DAT +7?
	SAD	(RQD3AL
	SKP			/NO
	JMP	RQUSR2		/YES
	ISZ*	RQD3		/UPDATE .DAT SLOT
	LAC*	RQD3
	AND	(77
	SAD	(70
	SKP
	JMP	RQUSR4
	LAC*	RQD3
	AND	(777760
	AAC	100
	DAC*	RQD3
	JMP	RQUSR4
RQUSR2=.
	ISZ	RQD3		/UPDATE POINTER
	JMP	RQUSR4
	ISZ*	RQD3
RQUSR4=.
	ISZ	RQPOS		/ARE WE DONE?
	JMP	RQUSR5		/NO
	LAC	(RQD3BG		/YES
	DAC	RQD3
RQUSR5=.
	JMS	RQTAB		/PACK HT
/PACK DEVICE NAME
	LAC*	(152		/BOSS15 MODE?
	SMA				/YES, SKIP
	JMP	RQUSR6			/NO, NO SPECIAL CODE
	LAC*	RQD3			/POS. .DAT SLOTS 5 OR 6?
	SAD	RQD3BG+5
	JMP	RQUSR7			/YES, +5
	SAD	RQD3BG+6
	SKP				/YES, +6
	JMP	RQUSR6			/NEITHER
	LAC	(142040			/+6 IS ALWAYS LP IN BOSS MODE
	JMS	RQPAK6
	JMP	RQUSR8
RQUSR7	LAC	(032240			/+5 IS ALWAYS CR IN BOSS MODE
	JMS	RQPAK6
	JMP	RQUSR8
RQUSR6=.
	LAC*	RQDM15		/GET HANDLER NAME
	AND	(77777
	JMS	FIONM
	JMS	RQPAK6
	LAC*	RQDM15		/UNIT NUMBER
	RTL
	RTL
	AND	(7
	SNA
	LAC	(760
	AAC	60
	JMS	KLPUT
RQUSR8	ISZ	RQDM15
/BEGIN UIC
	JMS	RQTAB		/PACK HT
/PACK UIC
	LAC*	RQUM15
	JMS	RQPAK6
	LAC	(15
	JMS	KLPUT
	ISZ	RQUM15
	JMS	PRINT
	RQLIN-2
/ARE WE DONE?
	LAC	RQD3
	SAD (RQD3BG		/IF WE ARE DONE TYPING OUT THE POS. .DAT
	JMP RQPRG3		/  SLOTS, JMP INTO THE LOOP WHICH TYPES OUT
/				/  OUT THE .DAT SLOTS USED BY SYSTEM PROGRAMS.
/				/  IF WE WERE JUST TYPING OUT THE POS. .DAT 
/				/  BECAUSE OF AN R USER OR R ALL REQUEST, THE
/				/  PREVIOUS KLUDGE HAS SET THINGS UP SO THAT
/				/  THE LOOP WILL IMMEDIATELY EXIT TO KLOK (THE
/				/  KEYBOARD LISTENER).  IF INSTEAD WE GOT HERE
/				/  BECAUSE SOME SYSTEM PROGRAM (SUCH AS PIP)
/				/  USES ALL POS. .DAT SLOTS, THE LOOP WILL
/				/  CONTINUE AND TYPE OUT ANY OTHER .DAT SLOTS
/				/  USED BY THAT SYSTEM PROGRAM.
/				/SEE THE PREVIOUS AND THE TWO FOLLOWING KLUDGES.
	JMP RQUSR1		/NO--LOOP TO PRINT OUT MORE POSITIVE .DAT SLOTS
	.EJECT
/REQUEST DAT SLOTS FOR A SYSTEM PROGRAM
RQPRG=.
	LAC	(KLCOM		/CHANGE NAME TO .SIXBT
	JMS	CHNSIX
	LAC	KLCOM
	SAD	FOCAL
	JMP	RQFOCL
	SAD	DDT		/TREAT DDT,DDTNS,LOAD,GLOAD AND
	JMP	RQDDT		/EXECUTE AS SPECIAL CASES SINCE ENTRIES
	SAD	EXECUT		/FOR THESE PROGRAMS DO NOT EXIST IN COMBLK.
	JMP	RQEXEC
	SAD	LOAD
	JMP	RQLOAD
	SAD	GLOAD
	SKP
	JMP	RQPRG1
RQLOAD=.
RQDDT=.
	LAC	(ENDLOD
	DAC	SWI
	LAC	(DATLOD-1
RQSPRG	DAC*	(10
	JMP	RQPRG3-1
RQEXEC=.
	LAC	(ENDEXC
	DAC	SWI
	LAC	(DATEXC-1
	JMP	RQSPRG
RQFOCL=.
	LAC	(ENDFCL
	DAC	SWI
	LAC	(DATFCL-1
	JMP	RQSPRG
RQPRG1=.
	LAC	(KLCOM		/IS NAME IN COMBLK?
	JMS	FCOMK
	LAC*	P2		/COMPUTE ADDRESS OF LAST .DAT
	TAD	P2		/ENTRY FOR THIS PROGRAM.
	DAC	SWI		/SAVE IT IN 'SWI'.
RQPRG2=.
	LAC*	10		/YES, SPACE DOWN TO .DAT INFORMATION.
	AND	(770000
	SNA
	JMP	.+3
	LAC*	10
	JMP	RQPRG2
/AT THIS POINT AIR 10 POINTS TO THE FIRST DAT SLOT
	JMS	RQPUSE		/TYPE HEADER
RQPRG3=.			/THIS LOCATION GETS JUMPED TO FROM THE
/				/  END OF THE LOOP TO PRINT OUT ALL POSITIVE
/				/  .DAT SLOTS, IN ADDITION TO BEING JUMPED TO
/				/  FROM BELOW AT THE END OF THIS LOOP.
/				/SEE THE FOLLOWING AND THE TWO PREVIOUS KLUDGES.
	DZM	KL57		/INITIALIZE 5/7 PACKING ROUTINE
	LAC	(RQLIN
	DAC	KLPUTP
	LAC*	10
	DAC	RQDM15		/GET DAT SLOT
	DAC	RQPDAT
	LAC*	(10		/FINISHED?
	SAD	SWI
	JMP	KLOK		/YES,LOOK AT NEXT COMMAND.
	LAC	RQDM15
	SAD (-1			/IF THIS SYSTEM PROGRAM USES ALL POS. .DAT
	JMP RQKLDG		/  SLOTS, JMP TO THE ROUTINE WHICH PROCESSES
/				/  THE R USER REQUEST.  THAT ROUTINE WILL TYPE
/				/  OUT THE POSITIVE .DAT SLOTS AND THEN JMP TO
/				/  RQPRG3 ABOVE, WHICH WILL LOOK FOR ANY OTHER
/				/  .DAT SLOTS USED BY THIS SYSTEM PROGRAM.
/				/SEE THE THREE PREVIOUS KLUDGES.
/PACK DAT SLOT IN OUTPUT BUFFER
	AAC	15
	AND	(77
	TAD	(RQD2BG
	DAC	RQD2
	LAC*	RQD2
	JMS	RQPAK6
/PACK HT IN OUTPUT BUFFER
	JMS	RQTAB
/PACK DEVICE IN OUTPUT BUFFER
	LAC	RQDM15
	AND	(700
	SZA
	JMP	.+3
	LAC	RQDM15
	JMP	.+3
	LAC	RQDM15
	XOR	(777000
	DAC	RQDM15
	LAC*	(123
	AND	(77777
	TAD	RQDM15
	DAC	RQD2
	LAC*	RQD2
	AND	(77777
	JMS	FIONM		/GET HANDLER NAME
	JMS	RQPAK6
	LAC*	RQD2		/PACK UNIT NUMBER
	RTL
	RTL
	AND	(7
	SNA			/DO NOT PRINT UNIT 0
	LAC	(760
	AAC	60
	JMS	KLPUT
/PACK HT IN OUTPUT BUFFER
	JMS	RQTAB
/PACK UIC IN OUTPUT BUFFER
	LAC*	(125
	AND	(77777
	TAD	RQDM15
	DAC	RQD2
	LAC*	RQD2
	JMS	RQPAK6
	JMS	RQPCLS
	JMP	RQPRG3
/
RQPUSE	0			/TYPE HEADER FOR 'REQUEST PROGRAM'
	LAC	(RQPTBL		/INITIALIZE TABLE LOOK-UP
	DAC	RQPNT		/RQPNT = TABLE POINTER
RQPLP1=.
	LAC*	RQPNT
	ISZ	RQPNT
	SAD	KLCOM
	JMP	RQPSND		/FIRST WORD MATCHES, LOOK AT SECOND
RQPLP2=.
	ISZ	RQPNT
	LAC*	RQPNT
	TAD	RQPNT
	DAC	RQPNT
	ISZ	RQPNT
	LAC*	RQPNT		/HAVE WE EXAUSTED THE TABLE?
	SZA		/YES, SKIP
	JMP	RQPLP1		/NO , LOOK AT NEXT ENTRY
	JMP	RQPEND		/NO 'USE' MESSAGE FOR THIS PROGRAM
RQPSND=.
	LAC*	RQPNT
	SAD	KLCOM+1
	SKP			/FOUND A MATCH!
	JMP	RQPLP2		/NO MATCH, CONTINUE LOOK-UP
	ISZ	RQPNT
	LAC*	RQPNT
	DAC	RQPFLG
	LAC	RQPNT
	DAC	RQP1
	JMS	PRNFST
	RQHDR1-2
	JMP*	RQPUSE
RQPEND=.
	DZM	RQPFLG
	JMS	PRNFST
	RQHDR-2
	JMP*	RQPUSE
RQPNT	0
RQPFLG	0
RQHDR1	.ASCII	'.DAT'<11>'DEVICE'<11>'UIC'<11>'USE'<15>
/
RQPCLS=.
	0
	LAC	RQP1
	DAC	RQPNT
	LAC	RQPFLG
	SZA
	JMP	RQPMSG
	LAC	(15
	JMS	KLPUT
	JMS	PRINT
	RQLIN-2
	JMP*	RQPCLS
RQPMSG=.
	LAC	(11
	JMS	KLPUT
	AAC	-1
	DAC	RQPFLG
	LAC*	RQPNT
	CLL!RAR
	TCA			/TWOCMA (BR-080)
	DAC	RQPUSE
	ISZ	RQPNT
RQPMS1=.
	LAC*	RQPNT
	SAD	RQPDAT
	JMP	RQPMS2
	ISZ	RQPNT
	ISZ	RQPNT
	ISZ	RQPUSE
	JMP	RQPMS1
	LAC	(15
	JMS	KLPUT
RQPMS4	JMS	PRINT
	RQLIN-2
	JMP*	RQPCLS
RQPMS2=.
	ISZ	RQPNT
	LAC*	RQPNT
	TAD	(MTABLE		/GET ADR OF OFFSET TABLE (BR-089)
	DAC	TEMP		/SAVE POINTER TO OFFSET (BR-089)
	LAC*	TEMP		/GET OFFSET TO MSG TABLE (BR-089)
	TAD	(MSGTAB		/COMPUTE MESSAGE POINTER (BR-089)
	DAC	KLGETP
	LAW	-1
	DAC	KLGET5
RQPMS3	JMS	KLGET
	JMS	KLPUT
	SAD	(15
	JMP	RQPMS4
	JMP	RQPMS3
RQPDAT	0
RQP1	0
/
RQPTBL=.
	.SIXBT	'MACRO'
	14
	-14&777
	2
	-13&777
	3
	-12&777
	4
	-11&777
	2
	-10&777
	6
	-1&777
	23
	.SIXBT	'EDIT'
	12
	-15&777
	5
	-14&777
	7
	-13&777
	24		/(GAR-109)
	-12&777
	4
	-10&777
	6
	.SIXBT	'UPDATE'
	10
	-15&777
	3
	-14&777
	2
	-12&777
	4
	-10&777
	6
	.SIXBT	'PATCH'
	4
	-14&777
	10
	-10&777
	6
	.SIXBT	'SRCCOM'
	6
	-15&777
	11
	-14&777
	12
	-12&777
	13
	.SIXBT	'F4@@'
	6
	-13&777
	3
	-12&777
	4
	-11&777
	2
	.SIXBT	'LOAD'
	6
	-5&777
	14
	-4&777
	15
	-1&777
	16
	.SIXBT	'CHAIN'
	12
	-12&777
	4
	-6&777
	3
	-5&777
	14
	-4&777
	15
	-1&777
	16
	.SIXBT	'EXECUT'
	2
	-4&777
	2
	.SIXBT	'GLOAD'
	6
	-5&777
	14
	-4&777
	15
	-1&777
	16
	.SIXBT	'ALGOL'
	10
	-15&777
	22
	-13&777
	3
	-12&777
	4
	-11&777
	2
	.SIXBT	'DDT@'
	6
	-5&777
	14
	-4&777
	15
	-1&777
	16
	.SIXBT	'DDTNS'
	6
	-5&777
	14
	-4&777
	15
	-1&777
	16
	.SIXBT	'DUMP'
	4
	-14&777
	2
	-12&777
	4
	.SIXBT	'8TRAN'
	4
	-15&777
	2
	-14&777
	3
	.SIXBT	'SGEN'
	2
	-14&777
	10
	.SIXBT	'EDITVT'
	12		/(GAR-109)
	-15&777
	5
	-14&777
	7
	-13&777		/(GAR-109)
	24		/(GAR-109)
	-12&777
	4
	-10&777
	6
	.SIXBT	'EDITVP'
	14		/(GAR-109)
	-15&777
	5
	-14&777
	7
	-13&777		/(GAR-109)
	24		/(GAR-109)
	-12&777
	4
	-10&777
	6
	10&777
	21
	.SIXBT	'MTDUMP'
	4
	1&777
	7
	3&777
	3
	.SIXBT	'QFILE'
	2
	-14&777
	7
	.SIXBT	'BOSS'
	10
	6&777
	4
	-14&777
	2
	-15&777
	3
	5&777
	2
	.SIXBT	'FOCAL'
	12
	-1&777
	16
	3
	2
	5
	3
	7
	2
	10
	3
	.SIXBT	'MAC11'
	4
	-12&777
	4
	-11&777
	2
	.SIXBT	'MCLOAD'
	2
	-14&777
	10
	.SIXBT	'SPOOL'
	2
	-14&777
	10
	.SIXBT	'SPLGEN'
	2
	-14&777
	10
	.SIXBT	'SPLOAD'
	2
	-14&777
	10
	0
MSGTAB=.				/START OF MSG TABLE (BR-089)
MS2	.ASCII	'INPUT'<15>
MS3	.ASCII	'OUTPUT'<15>
MS4	.ASCII	'LISTING'<15>
MS6	.ASCII	'SECONDARY INPUT'<15>
MS5	.ASCII	'OUTPUT/SCRATCH'<15>
MS7	.ASCII	'I/O'<15>
MS8	.ASCII	'I/O - SYS DEV'<15>
MS9	.ASCII	'NEW FILE INPUT'<15>
MS10	.ASCII	'ORG FILE INPUT'<15>
MS11	.ASCII	'ERROR MSG'<15>
MS12	.ASCII	'USER LIBR'<15>
MS13	.ASCII	'USER PROG(S)'<15>
MS14	.ASCII	'SYS LIBR'<15>
MS17	.ASCII	'VIDEO OUTPUT'<15>
MS18	.ASCII	'SCRATCH'<15>
MS19	.ASCII	'SYSTEM MACRO FILE'<15>
MS20	.ASCII	'SECONDARY OUTPUT'<15>	/(BR-091)
MTABLE	0			/NO MS0 (BR-089)
	0			/NO MS1 (BR-089)
	MSG	2
	MSG	3
	MSG	4
	MSG	5
	MSG	6
	MSG	7
	MSG	8
	MSG	9
	MSG	10
	MSG	11
	MSG	12
	MSG	13
	MSG	14
	0			/NO MSG15 (BR-089)
	0			/NO MSG16 (BR-089)
	MSG	17
	MSG	18
	MSG	19
	MSG	20		/(BR-091)
/
/SUBROUTINE RQTAB
/
/PACKS HT IN OUTPUT BUFFER
/
RQTAB	0
	LAC	(11
	JMS	KLPUT
	JMP*	RQTAB
/
/ROUTINE RQPAK6
/
/PACKS 3 .SIXBT CHARACTERS FOUND IN AC
/IN OUTPUT BUFFER IN 5/7 ASCII
/
RQPAK6	0
	DAC	RQTMP		/SAVE .SIXBT CHARACTERS
	JMS	LSHFT6
	RAL
	JMS	RQPAK
	LAC	RQTMP		/SECOND CHARACTER
	JMS	RSHFT6
	JMS	RQPAK
	LAC	RQTMP		/THIRD CHARACTER
	JMS	RQPAK
	JMP*	RQPAK6		/RETURN
RQPAK	0
	AND	(77
	XOR	(40
	AAC	240
	SAD	(300
	CLA
	JMS	KLPUT
	JMP*	RQPAK
/
/DATA STORAGE FOR REQUEST COMMAND CODE
/
RQHDR	.ASCII	'.DAT'<11>'DEVICE'<11>'UIC'<15>
RQLIN	.ASCII	'DDD'<11>'DDD'<11>'UIC'<15>
	.BLOCK	20
RQDM15	0			/ADDRESS OF .DAT -15
RQUM15	0			/   "     " UIC   "
RQD2	.+1
RQD2BG=.
	556165
	556164
	556163
	556162
	556161
	556160
	556740
RQD2M7=.
	556640
	556540
	556440
	556340
RQD2M3=.
	556240
RQD2M2=.

	556140

RQD2AL=.

RQD3	.+1

RQD3BG=.

	536140

	536240

	536340

	536440

	536540

	536640

	536740

RQD3AL=.

	536160

RQTMP	0

USER	.ASCII	'USER'

DATEXC	000774

ENDEXC	0

PIP	.SIXBT	'PIP'

RQPOS	0

DATLOD	000773

	000774

	000777

ENDLOD	0

FOCAL	.SIXBT	'FOCAL'

DATFCL	000777

	000003

	000005

	000007

	000010

ENDFCL	0

	.TITLE XVM/DOS NRM	$INSTRUCT

/

/$INSTRUCT COMMAND PROCESSOR

/

/ THE TEXT FOR THIS MESSAGE IS NOW (V3A) A SEPARATE SOURCE FILE

/ 'INSALL SRC' & 'INSERR SRC' UNDER BNK & PAG UIC. THE TEXT IS TYPED

/ BY 'INSTRC BIN' PRESENT UNDER BNK & PAG UIC, WHICH IS LOADED BY

/ .SYSLD.

/

KLINS=.

/ONLY '$INSTRUCT' AND '$INSTRUCT ERRORS' ARE LEGAL

	JMS	KLPGSH		/LOOK AT LINE

	LAC	KLCOM

	SNA

	JMP	INS		/NOTHING TYPED IN

	SAD	ERRORS		/SOMETHING TYPED IN,CHECK IF 'ERRORS'

	SKP

	JMP	BADINS		/ 'ERRORS' NOT TYPED

	LAC	KLCOM+1

	SAD	ERRORS+1

	SKP

	JMP	BADINS		/'ERRORS' NOT TYPED

/'ERROR' WAS TYPED, ASSUME 'ERRORS'

	LAC	INSERR		/SET UP FOR ERROR MESSAGE PRINT OUT

	DAC	KLCOM

	LAC	INSERR+1

	DAC	KLCOM+1

	JMP	SYSLDR						/EAG:101

								/EAG:101

INS=.

	LAC	INSALL		/SET UP FOR ALL

	DAC	KLCOM

	LAC	INSALL+1

	DAC	KLCOM+1

	JMP	SYSLDR						/EAG:101

								/EAG:101

ERRORS	.ASCII	'ERROR'

INSALL	.SIXBT	'INSALL'

INSERR	.SIXBT	'INSERR'

	.TITLE XVM/DOS NRM	$SCOM

/

/$SCOM COMMAND PROCESSOR

/

KLSCOM=.

	DZM	KL57		/TYPE HEADER WITH CURRENT

	LAC	(SCMHDR+12	/DATE.

	DAC	KLPUTP

	JMS	DTPRNT

	LAC	(12

	JMS	KLPUT

	LAC	(15

	JMS	KLPUT

	LAC	BANKBT		/TYPE BOOTSTRAP RESTART

	CLL!RAR			/ADDRESS.

	TAD	(304000

	DAC	SCTEMP

	LAC	SCMBRA

	AND	(3777

	XOR	SCTEMP

	DAC	SCMBRA

	LAC	BANKBT		/TYPE FIRST FREE CELL BELOW

	CLL!RAR			/BOOTSTRAP.

	TAD	(304000

	DAC	SCTEMP

	LAC	SCMFCB

	AND	(3777

	XOR	SCTEMP

	DAC	SCMFCB

	DZM	KL57		/TYPE ADDRESS OF .DAT.

	LAC	(SCMDAT

	DAC	KLPUTP

	LAC*	(123

	JMS	RSHFT6

	RTR

	RAR

	AND	(7

	AAC	60

	JMS	KLPUT

	LAC*	(123

	JMS	RSHFT6

	AND	(7

	AAC	60

	JMS	KLPUT

	LAC*	(123

	RTR

	RAR

	AND	(7

	AAC	60

	JMS	KLPUT

	LAC*	(123

	AND	(7

	AAC	60

	JMS	KLPUT

	DZM	KL57		/TYPE ADDRESS OF .UFD

	LAC	(SCMUFD

	DAC	KLPUTP

	LAC*	(125

	JMS	RSHFT6

	RTR

	RAR

	AND	(7

	AAC	60

	JMS	KLPUT

	LAC*	(125

	JMS	RSHFT6

	AND	(7

	AAC	60

	JMS	KLPUT

	LAC*	(125

	RTR

	RAR

	AND	(7

	AAC	60

	JMS	KLPUT

	LAC*	(125

	AND	(7

	AAC	60

	JMS	KLPUT

	DZM	KL57		/TYPE # OF POSITIVE

	LAC	(SCMPOS		/DAT SLOTS.

	DAC	KLPUTP

	LAC*	(124

	RTR

	RAR

	AND	(7

	AAC	60

	JMS	KLPUT

	LAC*	(124

	AND	(7

	AAC	60

	JMS	KLPUT

	LAC	(777777		/TYPE :

	DAC	STAPI		/API AVAILABLE

	DAC	STXVM		/XVM NOT AVAILABLE (BR-086)

	LAC*	(.SCOM+4

	SMA

	JMP	.+4

	LAC	(SCMAPI

	DAC	STAPI

	LAC*	(.SCOM+4

	AND	(000001		/IS XVM ENABLED (BR-086)

	SNA			/SKIP IF YES (BR-086)

	JMP	STST1		/NO-TRY BANK/PAGE (BR-086)

	LAC	(SCMXVM		/GET XVM MSG ADR (BR-086)

	DAC	STXVM		/PUT IN OUTPUT TABLE (BR-086)

STST1	LAC*	(.SCOM+4

	AND	(100		/TYPE PAGE/BANK MODE OPERATION

	SNA

	JMP	.+6

	LAC	SCBANK

	DAC	SCMODE

	LAC	SCBANK+1

	DAC	SCMODE+1

	JMP	.+5

	LAC	SCPAGE

	DAC	SCMODE

	LAC	SCPAGE+1

	DAC	SCMODE+1

	LAC*	(104		/TYPE 7 OR 9 CHANNEL

	AND	(4000			/MAGTAPE OPERATION

	SNA

	JMP	.+4

	LAC	SCNINE

	DAC	SCMCHN

	JMP	.+3

	LAC	SCSEVN

	DAC	SCMCHN

	LAC	(777777		/TYPE LINE PRINTER LINE SIZE

	DAC	STLP

	LAC*	(.SCOM+4

	AND	(60

	SNA

	JMP	SCM1+2

	SAD	(20

	SKP

	JMP	.+6

	LAC	SCLP80

	DAC	SCMLPS

	LAC	SCLP80+1

	DAC	SCMLPS+1

	JMP	SCM1

	SAD	(40

	SKP

	JMP	.+6

	LAC	SCL120

	DAC	SCMLPS

	LAC	SCL120+1

	DAC	SCMLPS+1

	JMP	SCM1

	LAC	SCL132

	DAC	SCMLPS

	LAC	SCL132+1

	DAC	SCMLPS+1

SCM1=.

	LAC	(SCMLPS

	DAC	STLP

	LAC	PROTCT		/TYPE DEFAULT PROTECTION CODE

	AND	(7

	AAC	60

	CLL

	JMS	RSHFT6

	RTR

	DAC	SCTEMP

	LAC	SCMPRO

	AND	(3777

	XOR	SCTEMP

	DAC	SCMPRO

	LAC*	(.SCOM+54	/TYPE CURRENT PROTECTION CODE. (BR-089)

	AND (7

	AAC	60

	CLL

	JMS RSHFT6

	RTR

	DAC SCTEMP

	LAC CURPRO

	AND (3777

	XOR SCTEMP

	DAC CURPRO
	DZM	KL57		/TYPE DEFAULT BUFFS SETTING

	LAC	(SCMBUF

	DAC	KLPUTP

	LAC	FILES

	JMS	DTRCON

	AAC	40

	JMS	RQPAK6

	DZM	KL57		/TYPE MANUAL ^Q RSTRT ADDR

	LAC	(SCMCQR

	DAC	KLPUTP

	LAC	MANSAV

	AND	(7777

	DAC	SCTEMP

	JMS	RSHFT6

	RTR

	RAR

	AND	(7

	AAC	60

	JMS	KLPUT

	LAC	SCTEMP

	JMS	RSHFT6

	AND	(7

	AAC	60

	JMS	KLPUT

	LAC	SCTEMP

	RTR

	RAR

	AND	(7

	AAC	60

	JMS	KLPUT

	LAC	SCTEMP

	AND	(7

	AAC	60

	JMS	KLPUT

/NOW DO ACTUAL TYPING OF SCOM

	LAC	(SCMTBL

	DAC	RQPNT

	LAC	(JMS PRNFST

	DAC	SCMLP1

SCMLOP=.

	LAC*	RQPNT

	SNA

	JMP	SCMHAN

	SAD	(777777

	JMP	SCMINC

	AAC	-2

	DAC	.+2

SCMLP1	JMS	PRINT

	XX

	LAC	(JMS PRINT

	DAC	SCMLP1

SCMINC=.

	ISZ	RQPNT

	JMP	SCMLOP

SCMHAN=.

	LAC	(1		/COMPUTE POINTERS TO

	TAD	NOPAR		/SKIP TABLE AND

	TAD	NODAT		/DEVICE TABLE IN

	TAD	.SGNBL		/SGNBLK (SGNSKP=SKIP

	DAC	SGNSKP		/TABLE, SGNDEV=DEVICE

	TAD	NOSKP		/TABLE).

	DAC	SGNDEV

SCMH.0	ISZ	RQPNT		/SPACE DOWN TO NEXT MSG

	LAC*	RQPNT		/ARE WE DONE WITH

	SNA			/HANDLERS?

	JMP	SCMSKI		/YES, TYPE SKIP CHAIN

	DAC	SCTEMP		/NO, SEARCH DEVICE TABLE

	LAC*	SCTEMP		/FOR THIS HANDLER

	DAC	SCTEMP

	LAC	SGNDEV		/INITIALIZE DYNAMIC POINTER

	DAC	SGNDVP		/TO DEVICE TABLE

SCMH.1	LAC*	SGNDVP		/MATCH?

	AND	(770000		/HANDLERLESS DEVICE (BR-089)

	SNA			/SKIP IF NOT (BR-089)

	JMP	SCMH.3		/YES - SKIP OVER SKIPS (BR-089)

	LAC*	SGNDVP		/TEST FOR MATCH (BR-089)

	SAD	SCTEMP

	JMP	SCMH.2		/YES,PRINT MESSAGE

	ISZ	SGNDVP		/NO, LOOK FOR NEXT ENTRY

	LAC*	SGNDVP		/IS THERE ANOTHER VERSION

	AND	(770000		/OF SAME HANDLER?

	SZA

	JMP	SCMH.1		/YES

SCMH.3	LAC*	SGNDVP		/NO, MOVE DOWN TO NEXT (BR-089)

	TAD*	SGNDVP		/HANDLER.

	TAD*	SGNDVP

	IAC	

	TAD	SGNDVP

	DAC	SGNDVP

	SAD	LSGNBL		/ARE WE AT END OF ATBEL?

	JMP	SCMH.0		/YES, DO NOT PRINT

	JMP	SCMH.1		/NO, CHECK.

SCMH.2	LAC*	RQPNT

	DAC	.+2

	JMS	MPRINT

	XX

	JMP	SCMH.0

SCMSKI=.

	JMS	PRINT

	SCM26-2

	LAC	NOSKP

	TCA			/TWOCMA (BR-080)

	DAC	SKPCNT

	LAC	(1

	TAD	NOPAR

	TAD	NODAT

	TAD	NOSKP

	TCA			/TWOCMA (BR-080)

	TAD	SGNBLK

	DAC	DEVCNT

	LAC*	SGNSKP

	JMS	SCMLUP

	ISZ	SGNSKP

	ISZ	SKPCNT

	JMP	.-4

	JMP	KLOK

SCMLUP	0

	DAC	SCTEMP

	LAC	SGNDEV

	DAC	SGNDVP

	LAC	DEVCNT

	TCA			/TWOCMA (BR-080)

	DAC	DEVCTP

SCMLP2=.

	LAC*	SGNDVP

	SAD	SCTEMP

	JMP	SCMLP3

	ISZ	SGNDVP

	ISZ	DEVCTP

	JMP	SCMLP2

	JMP*	SCMLUP

SCMLP3=.

	LAC	SGNDVP

	AAC	-2

	DAC	SGNDVP

	DZM	KL57

	LAC	(SCMSKP

	DAC	KLPUTP

	LAC	(11

	JMS	KLPUT

	LAC*	SGNDVP

	JMS	RQPAK6

	ISZ	SGNDVP

	LAC*	SGNDVP

	JMS	RQPAK6

	LAC	(15

	JMS	KLPUT

	JMS	PRINT

	SCMSKP-2

	JMP*	SCMLUP

SCMTBL=.

	SCMHDR

	SCMBRA

	SCMFCB

	SCMDAT

	SCMUFD

	SCMPOS

STAPI	SCMAPI

STXVM	SCMXVM		/XVM ENABLED MSG (BR-086)

	SCMODE

	SCMCHN

STLP	SCMLPS

	SCMPRO

	CURPRO

	SCMBUF

	SCMCQR

	SCM01

	0

	SCM2

	SCM3

	SCM4

	SCM5

	SCM6

	SCM7

	SCM8

	SCM9

	SCM10

	SCM11

	SCM12

	SCM13

	SCM14

	SCM15

	SCM16

	SCM17

	SCM18

	SCM19

	SCM19A

	SCM19B

	SCM19C

	SCM20

	SCM21

	SCM22

	SCM23

	SCM24

	SCM25

	SCM27

	SCM27A

	SCM28

	0

SCPAGE	.ASCII	'PAGE '

SCBANK	.ASCII	'BANK '

SCTEMP	0

SGNSKP	0

SGNDEV	0

SKPCNT	0

DEVCNT	0

SGNDVP	0

DEVCTP	0

SCLP80	.ASCII	' 80-C'

SCL120	.ASCII	'120-C'

SCL132	.ASCII	'132-C'

SCNINE	.ASCII	'9 C'

	.LOC	.-1

SCSEVN	.ASCII	'7 C'

	.LOC	.-1

	.TITLE XVM/DOS NRM	$DATE

/

/$DATE COMMAND PROCESSOR

/

KLDATE=.

	LAC	KLCHAR		/WAS A DATE TYPED IN?

	SAD	(15		/MAYBE

	JMP	DTECHO		/NO. ECHO DATE IN .SCOM+47.

	SAD	(175

	JMP	DTECHO

	JMS	KLGET		/SKIP OVER BLANKS

	SAD	(40

	JMP	.-2

	SAD	(15		/WAS A DATE TYPED IN?

	JMP	DTECHO		/NO. ECHO DATE.

	SAD	(175

	JMP	DTECHO

	DZM	SCOM47		/YES. PROCESS MONTH.

	AAC	-60		/FIRST DIGIT

	DAC	DTTMP1

	JMS	KLGET

	SAD	(57		/IS THERE A SECOND?

	JMP	DTMON2		/NO

	AAC	-60		/YES

	DAC	DTTMP2

DTMON1=.

	JMS	DTCONV		/CONVERT DECIMAL TO OCTAL (2 DIGITS)

	JMS	PLIMCN

	14

	JMP	BADATE

	JMS	RSHFT6

	RAR

	DAC	SCOM47

	JMP	DTDAY

DTMON2=.

	LAC	DTTMP1		/MOVE 0 IN FIRST DIGIT

	DAC	DTTMP2

	DZM	DTTMP1

	JMP	DTMON1

DTDAY=.

	JMS	KLGET

	SAD	(57

	JMS	KLGET		/PROCESS DAY.

	AAC	-60		/FIRST DIGIT

	DAC	DTTMP1

	JMS	KLGET

	SAD	(57		/IS THERE A SECOND?

	JMP	DTDAY2		/NO

	AAC	-60		/YES

	DAC	DTTMP2

DTDAY1=.

	JMS	DTCONV		/CONVERT DECIMAL TO OCTAL (2 DIGIT)

	JMS	PLIMCN

	37

	JMP	BADATE

	JMS	LSHFT6

	XOR	SCOM47

	DAC	SCOM47

	JMP	DTYEAR

DTDAY2=.

	LAC	DTTMP1

	DAC	DTTMP2

	DZM	DTTMP1

	JMP	DTDAY1

DTYEAR=.

	JMS	KLGET

	SAD	(57

	JMS	KLGET		/PROCESS YEAR MODULO 1970 (DEC).

	AAC	-60		/FIRST DIGIT

	DAC	DTTMP1

	JMS	KLGET

	SAD	(15		/IS THERE A SECOND?

	JMP	DTYR2		/NO.

	SAD	(175

	JMP	DTYR2		/NO.

	AAC	-60		/YES

	DAC	DTTMP2	

DTYR1=.

	JMS	DTCONV		/CONVERT DECIMAL TO OCTAL (2 DIGITS)

	AAC	-106		/ADJUST MODULO 70

	JMS	PLIMCN

	35

	JMP	BADATE

	XOR	SCOM47

	DAC*	(147

	ISZ	SYSRES

	JMP	KLOK		/ALL DONE! (BR-089)

DTYR2=.

	LAC	DTTMP1

	DAC	DTTMP2

	DZM	DTTMP1

	JMP	DTYR1

DTECHO=.			/ECHO DATE

	DZM	KL57		/INITIALIZE 5/7 PACKING ROUTINE

	LAC	(DTLIN+2

	DAC	KLPUTP

	JMS	DTPRNT

	LAC	(15

	JMS	KLPUT

	JMS	BOSTTY

	JMS	TYPE

	DTLIN-2

	JMP	KLOK		/ALL DONE! (BR-089)

/

DTPRNT	0

/ECHO MONTH

	LAC*	(147

	JMS	LSHFT6

	RAL

	JMS	DTRCON

	AAC	57

	JMS	RQPAK6

/ECHO DAY

	LAC*	(147

	JMS	RSHFT6

	JMS	DTRCON

	AAC	57

	JMS	RQPAK6

/ECHO YEAR

	LAC*	(147

	JMS	DTRCON

	TAD	(070040

	JMS	RQPAK6

	JMP*	DTPRNT

/

/DATA REGISTERS FOR $DATE

DTLIN	.ASCII	'DATE         '<15>

DTTMP1	0

DTTMP2	0

SCOM47	0

MODESW	0			/ONCE ONLY SWITCH FOR DATE - MODE TYPOUT(BR-082)

/

/UTILITY ROUTINES FOR $DATE

/

/SUBROUTINE DTCONV

/

/CONVERTS TWO DIGITS, IN DTTMP1 AND DTTMP2, FROM DECIMAL

/TO A 2-DIGIT OCTAL VALUE LEFT IN AC

DTCONV	0

	LAC	DTTMP2

	JMS	DGITCK		/CHECK FOR VALID DIGIT

	LAC	DTTMP1

	JMS	DGITCK		/CHECK FOR VALID DIGIT

	LAC	DTTMP1

	CLL

	RTL

	RAL

	TAD	DTTMP1

	TAD	DTTMP1

	TAD	DTTMP2

	JMP*	DTCONV

/

/SUBROUTINE DTRCON

/

/CONVERTS A TWO DIGIT OCTAL VALUE FOUND IN AC TO

/A .SIXBT DECIMAL NOTATION. THE RESULT IS LEFT IN AC LEFT

/ADJUSTED.

/

DTRCON	0

	AND	(77

	DZM	DTTMP1

DTRLP=.

	DAC	DTTMP2

	AAC	-12

	SPA

	JMP	DTRDON

	ISZ	DTTMP1

	JMP	DTRLP

DTRDON=.

	CLL

	LAC	DTTMP1

	AAC	60

	JMS	LSHFT6

	TAD	DTTMP2

	AAC	60

	JMS	LSHFT6

	JMP*	DTRCON

	.TITLE XVM/DOS NRM	$TIME

/

/$TIME COMMAND RPOCESSOR

/
KLTIME=.

	LAC	KLCHAR		/WAS TIME TYPED IN?

	SAD	(15		/MAYBE.

	JMP	TMECHO		/NO.ECHO TIME IN .SCOM+50.

	SAD	(175

	JMP	TMECHO

	JMS	KLGET		/SKIP OVER BLANKS

	SAD	(40

	JMP	.-2

	SAD	(15		/WAS TIME TYPED IN?

	JMP	TMECHO		/NO. ECHO TIME.

	SAD	(175

	JMP	TMECHO

	DZM	SCOM50		/YES. PROCESS HOURS.

	AAC	-60

	DAC	DTTMP1		/FIRST DIGIT

	JMS	KLGET

	AAC	-60

	DAC	DTTMP2		/SECOND DIGIT
	JMS	DTCONV		/CONVERT HOURS TO OCTAL
/
/(RKB-106) FOLLOWING TWO LINES DELETED TO 
/(RKB-106) ENABLE TIME OF '0000' TO BE OK
/
/	SNA
/	JMP	BADTIM
	JMS	PLIMCN

	30

	JMP	BADTIM

	JMS	RSHFT6

	RAR

	DAC	SCOM50		/PACK HOURS IN .SCOM+50

	JMS	KLGET		/PROCESS MINUTES.

	AAC	-60

	DAC	DTTMP1		/FIRST DIGIT

	JMS	KLGET

	AAC	-60

	DAC	DTTMP2		/SECOND DIGIT

	JMS	DTCONV		/CONVERT MINUTEST TO OCTAL.

	JMS	PLIMCN

	73

	JMP	BADTIM

	JMS	LSHFT6

	XOR	SCOM50

	DAC*	(.SCOM+50

	JMP	KLOK		/ALL DONE!

TMECHO=.			/ECHO TIME.

	DZM	KL57		/INITIALIZE 5/7 PACKING ROUTINE

	LAC	(TMLIN+2

	DAC	KLPUTP

/CONVERT HOURS TO .SIXBT

	LAC*	(.SCOM+50

	DAC	SCOM50

	JMS	LSHFT6

	RAL

	JMS	DTRCON

	DAC	TMTMP1

/CONVERT MINUTEST TO .SIXBT

	LAC	SCOM50

	JMS	RSHFT6

	JMS	DTRCON

/PACK HOURS AND MINUTES IN 5/7 .ASCII IN OUTPUT BUFFER

	DAC	BOSTTY

	JMS	LSHFT6

	RAL

	AND	(77

	XOR	TMTMP1

	JMS	RQPAK6

	LAC	SCOM50

	JMS	DTRCON

	JMS	RSHFT6

	AND	(007777

	DAC	TMTMP1

	LAC	BOSTTY

	JMS	LSHFT6

	AND	(770000

	XOR	TMTMP1

	JMS	RQPAK6

	LAC	(15

	JMS	KLPUT

	JMS	BOSTTY

	JMS	TYPE

	TMLIN-2

	JMP	KLOK

/

/DATA REGISTERS FOR $TIME

/

TMLIN	.ASCII	'TIME     '<15>

TMTMP1	0

SCOM50	0

BOSTTY	0

	LAC*	(152

	SMA

	JMP*	BOSTTY

	XOR	(20000

	DAC*	(152

	JMP*	BOSTTY

	.TITLE XVM/DOS NRM	SET TIME LIMIT

/

/$TIMEST COMMAND PROCESSOR

/

TIMLIM=.

	DZM	DTTMP2

	DZM	TMTMP1

	JMS	KLGET		/GET CHARACTER

	SAD	(40		/IF BLANK IGNORE IT

	JMP	TIMLIM+2

	SAD	(15		/IF CR FINISH

	JMP	TIML.2

	SAD	(72		/IF COLON, CONVERT MINS TO SECS

	JMP	TIML.1

	AAC	-60		/CONVERT TO OCTAL

	JMS	PLIMCN		/MAKE SURE IT'S A DIGIT

	11

	JMP	LIMBAD		/IT ISN'T

	DAC	DTTMP1		/IT'S GOOD, ADD IT TO TOTAL IN TMTMP1

	LAC	TMTMP1

	MUL!SHAL

	12

	LACQ

	TAD	DTTMP1

	DAC	TMTMP1

	JMP	TIMLIM+2		/FETCH NEXT CHARACTER

TIML.1	LAC	TMTMP1		/MULTIPLY TOTAL IN TMTMP1

	MUL!SHAL			/BY 60(DEC)

	74

	LACQ

	DAC	DTTMP2

	DZM	TMTMP1

	JMP	TIMLIM+2	/FETCH NEXT CHARACTER

TIML.2	LAC	TMTMP1		/ANY TIME?

	TAD	DTTMP2

	SZA			/NO, SKIP

	TCA			/TWO'S COMPLEMENT OF  (BR-081)

	DAC*	(.SCOM+56	/TIME IN .SCOM+56

	JMP	KLOK
LIMBAD	LAW	-74		/(RKB-106) SET DEFAULT TO 1 MIN. FOR BOSS
	DAC*	(.SCOM+56

	JMP	BADLIM

	.TITLE XVM/DOS NRM	$KEEP

/

/$KEEP ON/OFF COMMAND PROCESSOR

/

KLKEEP=.

	JMS	ONOFF		/'ON' OR 'OFF'?

	JMP	KEEPON		/'ON'

	LAW	17775

	AND*	(142

	DAC*	(142

	JMS	UFDUPD

	JMS	DATSTP

	JMP	KLOK

KEEPON=.

	LAW	17775		/LAC (777775

	AND*	(142

	XOR	(2

	DAC*	(142

	JMP	KLOK

	.TITLE XVM/DOS NRM	$PROTECT

/

/$PROTECT COMMAND PROCESSOR

/

KLPRO=.

	LAC	KLCHAR		/WAS CODE TYPED?

PRCHK=.

	SAD	(15

	JMP	KLOK		/NO.

	SAD	(175

	JMP	KLOK		/NO.

	SAD	(40

	JMP	PRCHK1		/MAYBE, KEEP CHECKING

	AAC	-60		/MAKE SURE LEGAL CODE

	DAC	DTTMP1

	SAD	(1		/TEST FOR LEGAL VALUE (1) (BR-088)

	JMP	KLPR1		/LEGAL - CONTINUE (BR-088)

	SAD	(2		/TEST FOR LEGAL 2 (BR-088)

	JMP	KLPR1		/LEGAL - CONTINUE (BR-088)

	SAD	(3		/TEST FOR LEGAL VALUE (BR-088)

	JMP	KLPR1		/LEGAL - CONTINUE (BR-088)

	JMP	ILLCOD		/NOT LEGAL - ERROR (BR-088)

KLPR1	LAC	DTTMP1

	DAC*	(.SCOM+54

	JMP	KLOK

PRCHK1=.

	JMS	KLGET		/TRY NEXT CHARACTER

	JMP	PRCHK

	.TITLE XVM/DOS NRM	'ONOFF'

/

/ONOFF ROUTINE

/USED BY DEVICES THAT ACCEPT 'ON' OR 'OFF'

/AS PARAMETERS.

/CALLING SEQUENCE

/	JMS	ONOFF

/	(RETURN IF 'ON')

/	(RETURN IF 'OFF')

/IF NEITHER : JMP ILLONF

ONOFF=.

	0

	JMS	KLPGSH		/'ON' OR 'OFF'?

	LAC	KLCOM

	SAD	ON

	JMP*	ONOFF		/'ON'

	ISZ	ONOFF

	SAD	OFF

	JMP*	ONOFF		/'OFF'

	JMP	ILLONF

	.TITLE XVM/DOS NRM	$TAB

/

/$TAB ON/OFF PROCESSOR

/

KL33TY=.

	JMS	ONOFF		/'ON' OR 'OFF'?

	JMP	TTYON

	LAC*	(.SCOM+4

	AND	(677777

	XOR	(100000

	DAC*	(.SCOM+4

	JMP	NRMEXI

TTYON=.

	LAC*	(.SCOM+4

	AND	(677777

	DAC*	(.SCOM+4

	JMP	NRMEXI

	.TITLE XVM/DOS NRM	$FILL

/

/ FILL ON/OFF PROCESSOR

KLLA30=.

	JMS	ONOFF		/ON OR OFF?

	JMP	LTTYON

	LAC*	(.SCOM+4	/OFF. RESET BIT 10  (BR-080)

	AND	(777577		/CLEAR BIT 10 (BR-080)

	DAC*	(.SCOM+4	/SAVE (BR-080)

	JMP	NRMEXI

LTTYON=.

	LAC*	(.SCOM+4	/GET BIT 10 SCOM+4 (BR-080)

	AND	(777577		/CLEAR BIT 10 (BR-080)

	AAC	200		/RESET BIT 10 (BR-080)

	DAC*	(.SCOM+4	/SAVE (BR-080)

	JMP	NRMEXI

	.TITLE XVM/DOS NRM	$API

/

/$API ON/OFF PROCESSOR

/

KLAPI=.

/	JMS	SETMD		/SET MODE TYPEOUT ENABLE (BR-087)

	JMS ONOFF	/GET ON/OFF

	JMP APION		/PROCESS ON

	JMP APIOFF	/PROCESS OFF

APION=.

	CLA!CLL!CML

	JMP	.+2

APIOFF=.

	CLA!CLL			/LINK 0 IS OFF

	CLA!RAR

	XOR*	(.SCOM+4

	AND	(400000

	XOR*	(.SCOM+4

	DAC*	(.SCOM+4

	JMP	NRMEXI

	.TITLE XVM/DOS NRM	$VT ON/OFF

								/EAG:101

								/EAG:101

								/EAG:101

								/EAG:101

/								/EAG:101

/ VT ON/OFF PROCESSOR						/EAG:101

/								/EAG:101

								/EAG:101

KLVT	JMS ONOFF		/ CHECK WHETHER 'TIS VT ON OR	/EAG:101

	  CLA!CMA!SKP		/ OFF.  -1 TO AC IF VT ON,	/EAG:101

	CLA			/ 0 TO AC IF VT OFF.		/EAG:101

	XOR* (.SCOM+33)		/ MERGE BIT INTO .SCOM+33	/EAG:101

	AND (100000)						/EAG:101

	XOR* (.SCOM+33)						/EAG:101

	DAC* (.SCOM+33)						/EAG:101

	JMP NRMEXI		/ AND EXIT			/EAG:101

	.TITLE	XVM/DOS	NRM	$XVM

/

/$XVM ON/OFF PROCESSOR

/

KLXVM=.

/	JMS	SETMD		/SET MODE TYPEOUT ENABLE (BR-087)

	JMS	ONOFF		/GET ON/OFF SWITCH (BR-081)

	JMP	XVMON		/SWITCH WAS ON (BR-081)

	LAC*	(.SCOM+4	/SWITCH OFF-GET SCOM SETTING (BR-081)

	AND	(777776		/CLEAR ENABLE BIT (BR-081)

	DAC*	(.SCOM+4	/SAVE SCOM SETTING (BR-081)

	JMP	NRMEXI		/RETURN (BR-081)

XVMON	LAC*	(.SCOM+4	/GET SCOM BIT SETTING (BR-081)

	AND	(777776		/CLEAR ENABLE BIT IF ON (BR-081)

	XOR	(000001		/SET BIT (BR-081)

	DAC*	(.SCOM+4	/SAVE SCOM SETTING (BR-081)

	JMP	NRMEXI		/RETURN (BR-081)

	.TITLE	XVM/DOS	NRM	$UC15

/

/$UC15 ON/OFF PROCESSOR

/

KLUC15=.

/	JMS	SETMD		/SET MODE TYPEOUT ENABLE (BR-087)

	JMS	ONOFF		/GET ON/OFF SWITCH (BR-081)

	JMP	UC15ON		/SWITCH WAS ON (BR-081)

	LAC*	(.SCOM+4	/SWITCH OFF-GET SCOM SETTING (BR-081)

	AND	(777775		/CLEAR ENABLE BIT (BR-081)

	DAC*	(.SCOM+4	/SAVE SCOM BIT SETTING (BR-081)

	JMP	NRMEXI		/RETURN (BR-081)

UC15ON	LAC*	(.SCOM+4	/GET SCOM BIT SETTING (BR-081)

	AND	(777775		/CLEAR ENABLE BIT IF ON	(BR-081)

	XOR	(000002		/SET BIT (BR-081)

	DAC*	(.SCOM+4	/SAVE SCOM BIT SETTING (BR-081)

	JMP	NRMEXI		/RETURN (BR-081)

	.TITLE	XVM/DOS	NRM	$MEMSIZ

/

/$MEMSIZ NNN PROCESSOR

/

KLMSIZ=.

/	JMS	SETMD		/SET MODE TYPEOUT ENABLE (BR-087)

	DZM	OLDTOT		/ZERO OLD TOTAL (BR-083)

MEM1	JMS	KLGET		/GET CHAR (BR-083)

	SAD	(40		/SKIP IF NOT BLANK (BR-083)

	JMP	MEM1		/TRY AGAIN IF BLANK (BR-083)

	AAC	-60		/TEST FOR NON NUMERIC (BR-083)

	DAC	NEWVAL		/SAVE NUMBER (BR-083)

	SPA			/SKIP IF POSSIBLE NR (BR-083)

	JMP	MEM2		/JUMP IF NOT NR (BR-083)

	AAC	-13		/TEST AGAIN (BR-083)

	SMA			/SKIP IF NR (BR-083)

	JMP	MEM2		/JUMP IF NOT NR (BR-083)

	LAC	OLDTOT		/GET PREVIOUS VALUE (BR-083)

	MUL			/MULT BY 10 (BR-083)

	12			/TEN (BR-083)

	LACQ			/GET RESULT (BR-083)

	TAD	NEWVAL		/ADD IN CURRENT DIGIT (BR-083)

	DAC	OLDTOT		/SAVE (BR-083)

	AAC	-201		/TEST FOR EXCEEDING 128K (BR-084)

	SMA			/SKIP IF LESS THAN OR EQUAL TO 128K (BR-084)

	JMP	MSZBAD		/GTR THAN 128K-GIVE ERROR (BR-084)

	JMP	MEM1		/GET NEXT CHAR (BR-083)

MEM2	LAC	NEWVAL		/GET CHAR-60 (BR-083)

	SAD	(33		/SKIP IF NOT K (BR-083)

	JMP	MEM3		/K IS OK (BR-083)

	JMP	MSZBAD		/GIVE ERROR-JUNK IN INPUT (BR-083)

MEM3	LAC	OLDTOT		/GET NUMBER (BR-084)

	CLL			/CLEAR LINK FOR IDIV (BR-085)

	IDIV			/CHECK FOR DIV BY 8 (BR-085)

	10			/EIGHT (BR-083)

	SZA			/SKIP IF DIV BY 8 (BR-083)

	JMP	MSZBAD		/NR NOT MULT. OF 8-ERROR (BR-083)

	LAW	-30		/LOAD AC WITH -24(10) (BR-083)

	TAD	OLDTOT		/IS NR LESS THAN 24K (BR-083)

	SPA			/SKIP IF GEQ THAN 24K (BR-083)

	JMP	MSZBAD		/ERROR-LESS THAN 24K (BR-083)

	LAC	OLDTOT		/GET NR AGAIN (BR-083)

	CLL			/SET UP FOR SHIFT (BR-083)

	ALS	12		/MULT BY 1024 (BR-083)

	AAC	-1		/MAKE TOP OF MEM ADR. (BR-083)

	DAC*	(.SCOM+20	/SAVE IN MEMSIZ .SCOM (BR-083)

	JMP	NRMEXI		/EXIT (BR-083)

OLDTOT	0			/RUNNING TOTAL (BR-083)

NEWVAL	0			/LAST DIGIT (BR-083)

	.TITLE XVM/DOS NRM	$POLLR

/

/$POLLR ON/OFF PROCESSOR

/

KLPLR=.

/	JMS	SETMD		/SET MODE TYPEOUT ENABLE (BR-087)

	JMS	ONOFF

	SKP

	JMP	PLROFF

/$POLLR ON

	LAC*	(.SCOM+4	/GET POLLER BIT WORD (BR-080)

	AND	(777773		/CLEAR POLLER BIT (BR-080)

	XOR	(000004		/SET POLLER BIT (BR-080)

	DAC*	(.SCOM+4	/SAVE NEW SETTING (BR-080)

	JMP	NRMEXI		/EXIT (BR-080)

/POLLER OFF

PLROFF	LAC*	(.SCOM+4	/GET POLLER BIT WORD (BR-080)

	AND	(777773		/CLEAR POLLER BIT (BR-080)

	DAC*	(.SCOM+4	/SAVE NEW SETTING (BR-080)

	JMP	NRMEXI		/EXIT (BR-080)

/

	.TITLE	XVM/DOS	NRM	$MODE

/

/$MODE PROCESSOR

/

KLMODE=.

	JMS	DOMODE		/PRINT OUT THE MODE (BR-082)

	JMP	KLOK		/RETURN TO KBD SCANNER (BR-082)

/

/

/

DOMODE	0			/SUBROUTINE TO TYPE MODE SETTINGS (BR-082)

	DZM	KL57		/SET UP PACKING AND STUFFING ROUTINE (BR-0939

	LAC	(MODBUF+2		/GET BUFFER POINTER (BR-093)

	DAC	KLPUTP		/SET UP STUFF ADDRESS (BR-093)

	LAC*	(.SCOM+42	/GET HARDWARE PRESENT WORD

	PAX			/SAVE IT

	LAC*	(.SCOM+4	/GET HARDWARE ENABLE WORD

	PAL			/SAVE IT

	AND	(000100		/IS IT BANK OR PAGE (BR-085)

	SZA			/SKIP IF PAGE

	JMP	MP1		/BANK-JUMP

	JMS	STUFF		/STUFF PAGE MODE

	PPAG			/" (BR-085)

	JMP	MP2		/CONTINUE

MP1	JMS	STUFF		/STUFF BANK MODE

	PBNK			/" (BR-085)

MP2	JMS	KPRNT		/PRINT MEMSIZ (BR-083)

MP3	PXA			/GET PRESENT WORD

	AND	(000200		/IS API AVAILABLE

	SNA			/SKIP IF AVAILABLE

	JMP	MP5		/NO-CONTINUE

	PLA			/GET ENABLE WORD

	SMA			/SKIP IF API ENABLE

	JMP	MP4		/JUMP TO API OFF

	JMS	STUFF		/STUFF API ON

	PAPI			/"

	JMP	MP5		/CONTINUE

MP4	JMS	STUFF		/STUFF API OFF

	PNAPI			/"

MP5	PXA			/GET PRESENT WORD

	AND	(000040		/IS XVM HARDWARE PRESENT

	SNA			/SKIP IF PRESENT

	JMP	MP7		/NO-CONTINUE

	PLA			/GET ENABLE WORD

	AND	(000001		/IS XVM ENABLED

	SNA			/SKIP IF ENABLED

	JMP	MP6		/JUMP TO XVM OFF

	JMS	STUFF		/STUFF XVM ON

	PXVM			/"

	JMP	MP7		/CONTINUE

MP6	JMS	STUFF		/STUFF XVM OFF

	PNXVM			/"

MP7	PXA			/GET PRESENT WORD

	AND	(000100		/IS UC15 HARDWARE PRESENT

	SNA			/SKIP IF PRESENT

	JMP	MP11		/NO-CONTINUE

	PLA			/GET ENABLE WORD

	AND	(000002		/IS UC15 ENABLED

	SNA			/SKIP IF ENABLED

	JMP	MP8		/JUMP TO UC15 OFF

	JMS	STUFF		/STUFF UC15 ON

	PUC15			/"

	JMP	MP9		/CONTINUE

MP8	JMS	STUFF		/STUFF UC15 OFF

	PNUC15		/"

MP9	PLA			/GET ENABLE WORD

	AND	(000004		/IS POLLER ENABLED

	SNA			/SKIP IF ENABLED

	JMP	MP10		/JUMP TO POLLER OFF

	JMS	STUFF		/STUFF POLLER ON

	PPLR			/"

	JMP	MP11		/CONTINUE

MP10	JMS	STUFF		/STUFF POLLER OFF

	PNPLR			/"

MP11	LAC	(40		/GET A SPACE (BR-092)

	JMS	KLPUT		/PACK IT (BR-092)

	LAC*	(.SCOM+41	/GET CURRENT UIC (BR-092)

	CLL			/SET UP SHIFT (BR-092)

	LRS	14		/GET FIRST CHAR (BR-092)

	XOR	(40		/MAKE 7-BIT (BR-092)

	AAC	40		/"""" (BR-093)

	JMS	KLPUT		/PACK IT (BR-092)

	LAC*	(.SCOM+41	/GET UIC AGAIN (BR-092)

	LRS	6		/GET SECOND CHAR (BR-092)

	AND	(000077		/AND NOTHING ELSE (BR-092)

	XOR	(40		/MAKE 7-BIT (BR-092)

	AAC	40		/"""" (BR-093)

	JMS	KLPUT		/AND PACK IT (BR-092)

	LAC*	(.SCOM+41	/GET UIC AGAIN (BR-092)

	AND	(000077		/GET THIRD CHAR (BR-092)

	XOR	(40		/MAKE IT 7-BIT (BR-092)

	AAC	40		/"""" (BR-093)

	JMS	KLPUT		/AND PACK IT (BR-092)

MP12	JMS	STUFF		/STUFF CR/LF

	PCR			/"

	JMS	TYPE		/PRINT OUT BUFFER (BR-093)

	MODBUF			/POINTER TO MODE BUFFER (BR-093)

	JMP*	DOMODE		/RETURN TO CALLER

MODBUF	017002			/DUMMY BUFFER HEADER PAIR

	0			/"

	.BLOCK	34		/BUFFER FOR MODE TYPEOUT (BR-093)

PBNK	.ASCII	<21>/BANK MODE /<0>

PPAG	.ASCII	<21>/PAGE MODE /<0>

PAPI	.ASCII	/ API ON /<0>

PNAPI	.ASCII	/ API OFF /<0>

PXVM	.ASCII	/ XVM ON /<0>

PNXVM	.ASCII	/ XVM OFF /<0>

PUC15	.ASCII	/ UC15 ON /<0>

PNUC15	.ASCII	/ UC15 OFF /<0>

PPLR	.ASCII	/ POLLER ON /<0>

PNPLR	.ASCII	/ POLLER OFF /<0>

PCR	.ASCII	<15><12><0>

/

/	THIS SUBROUTINE PRINTS THE MEMORY SIZE (+1) FOUND IN .SCOM+20

/	AS A NUMBER IN THE FORM NNNK,NO LF OR CR ARE PERFORMED

/

KPRNT	0			/ENTRY TO PRINT NNNK ROUTINE (BR-083)

	PLA			/GET LIMIT REG (BR-085)

	DAC	KPTMP		/SAVE IN TEMP (BR-085)

	LAC	(40		/PUT LEADING BLANK IN (BR-083)

	JMS	KLPUT		/PUT IN BUF (BR-083)

	LAC*	(.SCOM+20	/GET MEMSIZ-1 (BR-083)

	IAC!CLL			/MAKE IT MEMSIZ (BR-083)

	LRS	12		/DIVIDE BY 1K (BR-083)

	IDIV			/DIVIDE BY 100 (BR-085)

	144			/100 (BR-083)

	PAL			/SAVE REMAINDER (BR-083)

	LACQ			/GET RESULT (BR-083)

	SNA			/SKIP IF NON-ZERO (BR-083)

	LAW	-20		/IF ZERO MAKE CHAR A BLANK (BR-083)

	AAC	60		/MAKE A CHAR (BR-083)

	JMS	KLPUT		/PACK IT (BR-083)

	PLA			/GET REMAINDER (BR-083)

	CLL			/SET UP IDIV (BR-085)

	IDIV			/DIVIDE BY 10 (BR-085)

	12			/TEN (BR-083)

	PAL			/SAVE REMAINDER (BR-083)

	LACQ			/GET RESULT (BR-083)

	AAC	60		/MAKE A CHAR (EVEN IF ZERO) (BR-083)

	JMS	KLPUT		/PUT IF BUF (BR-083)

	PLA			/GET ONES (BR-083)

	AAC	60		/MAKE A CHAR (BR-083)

	JMS	KLPUT		/PUT IN BUF (BR-083)

	LAC	(113		/PUT K IN BUF (BR-083)

	JMS	KLPUT		/PUT IN BUF (BR-083)

	LAC	(40		/PUT TRAILING BLANK IN BUF (BR-083)

	JMS	KLPUT		/PUT IN BUF (BR-083)

	LAC	KPTMP		/RESTORE LIMIT REG (BR-085)

	PAL			/" (BR-085)

	JMP*	KPRNT		/RETURN TO CALLER (BR-083)

KPTMP	0			/TEMP STORAGE FOR LIMIT REG. (BR-085)

	.TITLE XVM/DOS NRM	$HALF ON/OFF

								/EAG:101

								/EAG:101

								/EAG:101

								/EAG:101

/								/EAG:101

/ HALF ON/OFF PROCESSOR						/EAG:101

/								/EAG:101

								/EAG:101

KLHALF	JMS ONOFF		/ CHECK WHETHER 'TIS HALF ON OR	/EAG:101

	  CLA!CMA!SKP		/ OFF.  -1 TO AC IF HALF ON,	/EAG:101

	CLA			/ 0 TO AC IF HALF OFF.		/EAG:101

	XOR* (.SCOM+33)		/ MERGE BIT INTO .SCOM+33	/EAG:101

	AND (400000)						/EAG:101

	XOR* (.SCOM+33)						/EAG:101

	DAC* (.SCOM+33)						/EAG:101

	JMP NRMEXI		/ AND EXIT			/EAG:101

	.TITLE XVM/DOS NRM	$LP

/

/$LP ON/OFF PROCESSOR

/

KLLP=.

	JMS	ONOFF		/'ON' OR 'OFF'?

	JMP	LPON		/'ON'

	JMP	LPOFF		/'OFF'

LPON	LAC*	(142		/TURN BIT 3 ON OF .SCOM+42

	AND	(737777

	XOR	(40000

	DAC*	(142

	JMP	NRMEXI

LPOFF	LAC*	(142

	AND	(737777

	DAC*	(142

	JMP	NRMEXI

	.TITLE XVM/DOS NRM	$PAGE, $BANK

/

/$PAGE ON/OFF CPMMAND PROCESSOR

/

KLPAGE=.

/	JMS	SETMD		/SET MODE TYPEOUT ENABLE (BR-087)

	JMS	ONOFF		/'ON' OR 'OFF'?

	JMP	KL.PGE		/'ON'

	JMP	KL.BNK		/'OFF'

/

/$BANK ON/OFF COMMAND PROCESSOR

/

KLBANK=.

/	JMS	SETMD		/SET MODE TYPEOUT ENABLE (BR-087)

	JMS	ONOFF		/'ON' OR 'OFF'?

	JMP	KL.BNK		/'ON'

	JMP	KL.PGE		/'OFF'

/

KL.PGE=.

	LAW	17677		/SET PAGE MODE

	AND*	(.SCOM+4

	DAC*	(.SCOM+4

	JMP	KLOK		/EXIT WITH MODE TYPEOUT (BR-085)

/

KL.BNK=.

	LAW	17677		/SET BANK MODE

	AND*	(.SCOM+4

	XOR	(100

	DAC*	(.SCOM+4

	JMP	KLOK		/EXIT WITH MODE TYPEOUT (BR-085)

	.TITLE XVM/DOS NRM	$BATCH

/

/	BATCH DV COMMAND

/

SC.UIC=.SCOM+41			/(GAR:095) CURRENT UIC

SC.NMF=.SCOM+42			/(GAR:095) MONITOR FLAGS WORD.

SC.BOS=.SCOM+52			/(GAR:095)

SC.SDV=.SCOM+57			/(GAR:095) SYSTEM DEVICE'S HANDLER NUMBER.

SC.RTF=.SCOM+75			/(GAR:095) NO. OF LINES READ INTO BATCH FILE.
SC.BFN=.SCOM+106		/(GAR:095) BATCH FILENAME. 
				/(GAR:095) (ZERO IF NON-FILE ORIENTED ...
				/(GAR:095) BATCH DEVICE.)
SC.BFXT=.SCOM+110		/(RKB-106) BATCH FILENAME'S EXTENSION.
				/(RKB-106) DEFAULT IS 'BAT'.
				/(RKB-106) EXTENSION OTHER THAN DEFAULT
				/(RKB-106) IS NOT CURRENTLY SUPPORTED.
				/(RKB-106) CHANGE 'BEXTSW' TO A 'NOP'
				/(RKB-106) TO ENABLE OPTIONAL EXTENSION
				/(RKB-106) FOLLOWING FILENAME ON $BATCH
				/(RKB-106) COMMAND TYPEIN.
SC.BUIC=.SCOM+111		/(RKB-106) BATCH UIC.
SC.BDEV=.SCOM+112		/(RKB-106) BATCH DEVICE MNEMONIC IN .SIXBT.
SC.BUNT=.SCOM+113		/(RKB-106) BATCH DEVICE UNIT NUMBER
				/(RKB-106) IN BITS 0-2.  REST RESERVED.
KLBAT	LAC*	(SC.BOS)	/(GAR:095) ARE WE IN BOSS XVM MODE?
	SPA			/(GAR:095) IF SO, THE BATCH COMMAND IS ILLEGAL!
	JMP	KLWHAT		/(RKB-106) YES - DON'T START BATCH MODE.
	LAW	777776		/(RKB-106) RESET MASTER BATCH MODE BIT
	AND*	(SC.NMF)	/(RKB-106) IN CASE AN ERROR IS DETECTED
	DAC*	(SC.NMF)	/(RKB-106) ON A 'CHAINED' $BATCH WE
				/(RKB-106) WILL LEAVE BATCH MODE VIA 'FLUSH'
	DZM*	(SC.BDEV)	/(GAR:095) ASSUME UNIT #0 FOR THE BATCH DEVICE.
	DZM*	(SC.RTF)	/(GAR:095) INTIALIZE THE BATCH FILE LINE COUNTER.
	DZM*	(SC.BFN)	/(RKB-106) CLEAR OUT FILE NAME
	DZM*	(SC.BFN+1)	/(RKB-106)
	LAC	(020124)	/(RKB-106) DEFAULT EXTENSION, .SIXBT 'BAT'
	DAC*	(SC.BFXT)	/(RKB-106)
	DZM*	(SC.BUNT)	/(RKB-106) ASSUME UNIT NUMBER ZERO
	LAC*	(SC.UIC)	/(RKB-106) DEFAULT UIC IS CURRENT LOGGED IN ONE
	DAC*	(SC.BUIC)	/(RKB-106)
/
/(RKB-106) .SCOMS ARE NOW INITIALIZED, START DECODING COMMAND.
/(RKB-106) SYNTAX IS:  'B[ATCH] DV[V][U] [[<UIC>] FILNAM [EXT]]
/
	JMS	KLPGSH		/(RKB-106) GET FIELD ROUTINE
	LAC	(BTMP)		/(RKB-106) ARG TO 'CHNSIX'
	JMS	CHNSIX		/(RKB-106) CHANGE DEVICE [UNIT] TO .SIXBT
	LAC	BTMP		/(RKB-106) DECIDE EXACT FORM OF DEVIC TYPEIN
				/(RKB-106) LEGAL ONES ARE: DV, DVU, DVV, DVVU
				/(RKB-106) WHERE THE SECOND 'V' IS THE HANDLER
				/(RKB-106) VERSION OR 'FLAVOR' LETTER.
	AND	(70)		/(RKB-106) CHECK FOR 'DVU' FIRST
	SAD	(60)		/(RKB-106) BY CHECKING 3RD CHAR FOR NUMBER
	SKP			/(RKB-106) YES, THATS IT
	JMP	KLBAT1		/(RKB-106) NO, TRY OTHERS
	LAC	BTMP		/(RKB-106) TYPE 'DVU', RECALL WHOLE THING
	AND	(7)		/(RKB-106) EXTRACT UNIT NUMBER
	ALSS	17		/(RKB-106) MOVE TO BITS 0-2
	DAC*	(SC.BUNT)	/(RKB-106 PUT IT AWAY
	LAW	777700		/(RKB-106) DONE WITH UNIT, SO DESTROY IT
	AND	BTMP		/(RKB-106) NOW TREAT 'DVU' AS 'DV'
	DAC	BTMP		/(RKB-106)
	JMP	KLBAT2		/(RKB-106)
KLBAT1	LAC	BTMP+1		/(RKB-106) COULD BE 'DV', 'DVV' OR 'DVVU'
	SNA			/(RKB-106) CHECK FOR 'DVVU'
	JMP	KLBAT2		/(RKB-106) NOPE, ITS 'DV' OR 'DVV'
	AND	(707777)	/(RKB-106) CHECK FOR NUMBER AND NO EXTRA CRUFT.
	SAD	(600000)	/(RKB-106)
	SKP			/(RKB-106) OK
	JMP	BCHER		/(RKB-106) TYPED 5 OR 6 CHARS OR 3 + NON-NUMERIC FOURTH.
	LAC	BTMP+1		/(RKB-106) OK, GET BACK UNIT NUMBER
	AND	(070000)	/(RKB-106) STRIP OFF JUNK
	ALSS	3		/(RKB-106) MOVE TO RIGHT PLACE FOR .SYSLD
	DAC*	(SC.BUNT)	/(RKB-106) PUT IT AWAY
				/(RKB-106) NOW TREAT 'DVVU' AS 'DVV'
KLBAT2	LAC	BTMP		/(RKB-106) ONLY CASES LEFT ARE 'DV' OR 'DVV'
	AND	(77)		/(RKB-106) THIS GIVES ME THE ANSWER
	SNA!CLA			/(RKB-106) SKIP IF 'DVV' CASE, AND ZERO AC
	IAC			/(RKB-106) FOR 'DV' SET AC TO .SIXBT '@@A'
	XOR	BTMP		/(RKB-106) ONLY ONE CASE NOW, 'DVV'
				/(RKB-106) SINCE I JUST TURNED 'DV' INTO 'DVA'
	SAD	(030401)	/(RKB-106) BUT IF IT WAS 'CD', USE 'CDB'
	IAC			/(RKB-106) BY ADDING ONE
	DAC*	(SC.BDEV)	/(RKB-106)  ALL DONE
/
/(RKB-106) NOW WE WANT TO DECIDE IF A FILE-ORIENTED
/(RKB-106) NON-FILE ORIENTED DEVICE WAS SPECIFIED.
/(RKB-106) WE DO THIS SIMPLY BY CALLING EVERYTHING
/(RKB-106) BUT 'PR' (PLUS FLAVORS) OR 'CDB' FILE-
/(RKB-106) ORIENTED.  NOTE THAT USERS WITH SPECIAL
/(RKB-106) NON-FILE ORIENTED DEVICES FROM WHICH
/(RKB-106) THEY WISH TO BATCH MUST CHANGE THIS ASSUMPTION.
/
	AND	(777700)	/(RKB-106) STRIP FLAVOR CHAR
	SAD	(202200)	/(RKB-106) IS IT 'PR'
	STL!SKP			/(RKB-106) YES, SET LINK
	SAD	(030400)	/(RKB-106)  IS IT 'CD'
	STL			/(RKB-106) YES, SET LINK
	CLA!RAR			/(RKB-106) AC = 0 IF FILE-ORIENTED
	DAC	BTMP		/(RKB-106) SAVE FOR LATER
	LAC*	(SC.BDEV)	/(RKB-106) NOW WE CHECK TO SEE IF DEVICE EXISTS
	JMS	FIONO		/(RKB-106) ON THIS SYSTEM
	JMP	KLILLD		/(RKB-106) NO SUCH THING
/
/(RKB-106) DONE WITH DEVICE, NOW DO  [[[<UIC>] FILNAM [EXT]] PART,
/(RKB-106) CHECKING FOR ILLEGAL DELIMITERS, EXTRANEOUS CHARATCERS
/(RKB-106) AND WHETHER A FILE NAME STUFF IS EVEN LEGAL FOR THIS DEVICE.
/
KLBAT3	LAC	KLCHAR		/(RKB-106) DELIMITER FOLLOWING DEVICE
	JMS	BTERM		/(RKB-106) IS IT CR OR ALT?
	JMP	KLBAT6		/(RKB-106) YES, IS THAT LEGAL HERE?
	SAD	(40)		/(RKB-106) IS T SPACE?
	SKP			/(RKB-106) GOOD, MEANS MORE FOLLOWS
	JMP	KLWHAT		/(RKB-106) NO, ILLEGAL DELIMITER
/
/(RKB-106) NOW GO LOOKING FOR THE OPTIONAL <UIC>
/
KLBAT4	JMS	KLGET		/(RKB-106) GET NEXT CHARACTER
	DAC	KLCHAR		/(RKB-106) SAVE SAS 'LAST CHAR'
	SAD	(40)		/(RKB-106) SPACE?
	JMP	KLBAT4		/(RKB-106) YES, WE EAT THESE FOR BREAKFAST
	JMS	BTERM		/(RKB-106) A TERMINATOR, MEANING TRAILING SPACES AFTER DV?
	JMP	KLBAT6		/(RKB-106) YES, NOT EXACTLY GOOD FORM, BUT OK
	SAD	(74)		/(RKB-106) '<', UIC INDICATOR?
	JMP	KLBAT7		/(RKB-106) YES, GO DO IT
KLBAT5	JMS	KLPGSH		/(RKB-106) NOT UIC, GET FIELD AS FILE NAME
	LAC	KLCOM		/(RKB-106) ANYTHING THERE?
	SNA			/(RKB-106)
	JMP	KLWHAT		/(RKB-106) NO, ILLEGAL DELIMITER
	LAC	(SC.BFN)	/(RKB-106) ARG TO 'CHNSIX'
	JMS	CHNSIX		/(RKB-106) CONVERT FILE NAME TO .SIXBT
	LAC	KLCHAR		/(RKB-106) DELIMITER FOLLOWING FILE NAME
KLBT5A	JMS	BTERM		/(RKB-108) CR OR ALT?
	JMP	KLBAT8		/(RKB-106) YES, GO MAKE SURE FILE NAME IS OK
	SAD	(40)		/(RKB-106) WAS FILE NAME FOLLOWED BY SPACE?
	SKP			/(RKB-106) MAKE WE WANT TO DO OPTIONAL EXTENSION
	JMP	KLWHAT		/(RKB-106) ILLEGAL DELIMITER
	JMS	KLGET		/(RKB-108) MOVE TO NEXT NON-BLANK
	DAC	KLCHAR		/(RKB-108)
BEXTSW	JMP	KLBT5A		/(RKB-108) NOT ALLOWING [EXT], EXTRANEOUS CHARACTERS
				/(RKB-106) REMOVE ABOVE INSTRUCTIONOR PATCH IT TO 'NOP'
				/(RKB-106) TO ALLOW OPTION EXTENSION (NOT SUPPORTED).
	JMS	KLPGSH		/(RKB-106) GET EXTENSION
	LAC	KLCOM		/(RKB-108) WAS THERE AN EXT, OR JUST BLANKS?
	SNA			/(RKB-108) WE WANT TO IGNORE TRAILING BLANKS
	JMP	KLBAT8		/(RKB-108) EVEN IF EXTENSIONS ARE ENABLED.
	LAC	(BTMP+1)	/(RKB-106) ARG TO 'CHNSIX'
	JMS	CHNSIX		/(RKB-106) MAKE IT SIXBIT
	LAC	BTMP+2		/(RKB-106) ONLY WANT 3 CHARACTERS
	SZA			/(RKB-106) OK?
	JMP	KLWHAT		/(RKB-106) ILLEGAL EXTENSION
	LAC	BTMP+1		/(RKB-106) MOVE EXTENSION TO RIGHT PLACE
	DAC*	(SC.BFXT)	/(RKB-106)
	LAC	KLCHAR		/(RKB-106) WHAT FOLLOWED EXTENSION?
	JMS	BTERM		/(RKB-106) CHECK FOR CR OR ALT
	JMP	KLBAT8		/(RKB-106) RIGHT, VALIDATE FILE NAME
	JMP	KLWHAT		/(RKB-106) ILLEGAL DELIMITER
/
/(RKB-106) DONE DECODING COMMAND, NOW VERIFY THAT A FILE
/(RKB-106) NAME WAS NOT TYPED AFTER 'PR' OR 'CD'
/
KLBAT6	LAC	BTMP		/(RKB-106) NO FILE NAME TYPED
	SNA			/(RKB-106) WAS DEVICE FILE-ORIENTED?
	JMP	BADGET		/(RKB-106) UNFORTUNATELY, YES.
BCHOK	LAW	777776		/(RKB-106) EVERYTHING IS OK, ENTER BATCH MODE
	AND*	(SC.NMF)	/(RKB-106)
	IAC			/(RKB-106) AND RESMON WILL DO THE REST
	DAC*	(SC.NMF)	/(RKB-106)
	.EXIT			/(RKB-106) REBUILD RESMON WITH BATCH IN IT.
/
/(RKB-106) PROCESS THE UIC SPECIFICATION
/
KLBAT7	LAC	BTMP		/(RKB-106) UIC TYPED IN IS THIS LEGAL?
	SZA			/(RKB-106)
	JMP	KLWHAT		/(RKB-106) NOT FOR 'PR' OR 'CD'
	JMS	FETUIC		/(RKB-106) GET REST OF UIC
	DAC*	(SC.BUIC)	/(RKB-106) AND PUT IT AWAY
	JMS	KLGET		/(RKB-106) GET NEXT CHAR
	SAD	(76)		/(RKB-106) IS IT A '>'
	SKP			/(RKB-106) HOPE SO
	JMP	FETUER		/(RKB-106) ERROR
	JMS	KLGET		/(RKB-106) GET NEXT
	DAC	KLCHAR		/(RKB-106) SAVE IT
	JMS	BTERM		/(RKB-106) CR OR ALT?
	JMP	BADGET		/(RKB-106) YES, THIS IS BAD NEWS
	SAD	(40)		/(RKB-106) SPACE?
	JMP	KLBAT5		/(RKB-106) THAT'S GOOD, BECAUSE A FILENAME IS REQUIRED
	JMP	KLWHAT		/(RKB-106) ILLEGAL DELIMITER
/
/(RKB-106) A FILE ANME WAS FOUND, MAKE SURE DEVICE
/(RKB-106) IS FILE ORIENTED.
/
KLBAT8	LAC	BTMP		/(RKB-106) GET FLAG
	SZA			/(RKB-106) 
	JMP	KLWHAT		/(RKB-106) FILE NAME ON 'CD' OR 'PR' IS NOT GOOD
	JMP	BCHOK		/(RKB-106) OK, ENTER BATCH MODE
/
/(RKB-106) ROUTINE TO TEST AC FOR CR OR ALT
/(RKB-106) CALLING SEQUENCE:
/(RKB-106)	  (CHAR IS IN AC, BITS 11-17)
/(RKB-106)	JMS	BTERM
/(RKB-106)	  (RETURN IF IS 15 OR 175)
/(RKB-106)	  (RETURN OTHERWISE)
/
BTERM	XX			/(RKB-106)
	SAD	(15)		/(RKB-106)	CR?
	JMP*	BTERM		/(RKB-106) YES
	SAD	(175)		/(RKB-106) 	ALT MODE?
	JMP*	BTERM		/(RKB-106) YES
	ISZ	BTERM		/(RKB-106) NEITHER, TAKE SECOND RETURN
	JMP*	BTERM		/(RKB-106)
/

/	AN UNRECOGNIZED BATCH DEVICE WAS SPECIFIED.

/

BCHER	JMS	PRERR		/(GAR:095)

	ARG	KLBUFG-2	/(GAR:095) ERROR: BAD BATCH DEVICE.
	JMP	FLUSH		/(GAR:095)(RKB-106)
BTMP	.BLOCK	3		/(RKB-106)
	.TITLE XVM/DOS NRM	$CHANNEL

/

/$CHANNEL 7/9 PROCESSOR

/

KL7OR9	JMS KLPGSH	/GET 7/9

	LAC KLCOM

	SAD MT7		/7 CHANNEL

	JMP KL7C

	SAD MT9		/9 CHANNEL
	JMP KL9C

	JMP BADCHN	/ILLEGAL COMMAND

KL7C	SKP!CLA		/CLEAR FOR 7

KL9C	LAC (4000		/SET FOR 9

	DAC SWI

	LAW 13777

	AND*	(104

	XOR	SWI

	DAC*	(104

	JMP	KLOK

	.TITLE XVM/DOS NRM	PROGRAM NAME SEARCH ROUTINE

/

/

/ PROGRAM NAME SEARCH ROUTINE

/

KLPGSH	0

	DZM KLCOM		/CLEAR PROG NAME

	DZM KLCOM+1

	DZM KLCOM+2

	DZM KLCOM+3

	LAC (KLCOM		/SETUP POINTERS

	DAC KLPUTP

	DZM KL57

	LAC KLCHAR		/LAST CHAR

KLP1	SAD (40

	SKP			/IGNORE

	SAD (12

	SKP			/IGNORE

	JMP KLRXT

	JMS KLGET		/GET NEXT CHARACTER

	JMP KLP1

KLRXT	SAD (40

	JMP KLPGOT		/PROCESS

	SAD (15

	JMP KLPGOT		/PROCESS

	SAD (175

	JMP KLPGOT-3		/RETURN & PROCESS

	JMS KLPUT

	JMS KLGET

	JMP KLRXT

	CAL+775

	6

	LAC (175

KLPGOT	DAC KLCHAR

	JMP* KLPGSH		/RETURN

	.TITLE XVM/DOS NRM	$GET, $GETP, $GETT, $GETS

/

/$GET, $GETP, $GETT, $GETS COMMAND PROCESSOR

/

KLCGET=.

	LAC (2004)		/ SET RETURN CODE AND NO FILE	/EAG:101

	JMP	GETPTS

KLCGTP=.

	LAC (2001)		/ SET RETURN CODE AND NO FILE	/EAG:101

	JMP	GETPTS

KLGETT=.

	LAC (2002)		/ SET RETURN CODE AND NO FILE	/EAG:101

	JMP	GETPTS

KLGETS=.

	LAC (2003)		/ SET RETURN CODE AND NO FILE	/EAG:101

GETPTS=.

	DAC	GET		/SAVE FOR LATER USE (BR-094)

	LAC	KLCHAR

	SAD	(15

	JMP	GET

	SAD	(175

	JMP	GET

	JMS	KLPGSH		/GET FILE NAME

	LAC	KLCOM		/WAS ONE TYPED IN?

	SNA

	JMP	GET		/NO

	LAC	(.SCOM+7)	/YES

	JMS	CHNSIX

	LAC	KLCHAR		/WAS EXTENSION TYPED?

	SAD	(15

	JMP	BADGET		/NO

	SAD	(175

	JMP	BADGET		/NO

	JMS	KLPGSH		/YES, GET IT

	LAC	KLCOM

	SNA

	JMP	BADGET

	LAC	(GETC

	JMS	CHNSIX

	LAC	GETC

	DAC*	(.SCOM+11

	LAW 775777		/ CLEAR NO FILENAME BIT		/EAG:101

	AND GET							/EAG:101

	DAC GET							/EAG:101

GET	.GET 0,.SCOM+7						/EAG:101

								/EAG:101

								/EAG:101

GETC	0			/EXTENSION STORAGE (BR-094)

	.TITLE XVM/DOS NRM	$PUT

/

/$PUT COMMAND PROCESSOR

/

KLGPUT=.

	LAC	KLCHAR		/WAS FILE NAME TYPED?

	SAD	(15

	JMP	BADGET		/NO

	SAD	(175

	JMP	BADGET		/NO

	JMS	KLPGSH		/MAYBE, TRY TO GET IT

	LAC	KLCOM		/WAS IT REALLY TYPED IN?

	SNA

	JMP	BADGET		/NO

	LAC	(.SCOM+7

	JMS	CHNSIX

	LAC	KLCHAR		/WAS EXTENSION TYPED?

	SAD	(15

	JMP	BADGET		/NO

	SAD	(175

	JMP	BADGET		/NO

	JMS	KLPGSH		/MAYBE

	LAC	KLCOM

	SNA

	JMP	BADGET		/NO

	LAC	(GETC

	JMS	CHNSIX

	LAC	GETC

	DAC*	(.SCOM+11		/YES

	.GET 1400,.SCOM+7					/EAG:101

	.TITLE XVM/DOS NRM 	$ASSIGN

/$ASSIGN COMMAND ROUTINE WHICH SETS

/	UP.DAT SLOTS WITH DEVICE HANDLER

/	NUMBERS ACCORDING TO THE CALLING

/	SEQUENCE: DEV <N> O,-P,Q /(OR CR)

KLASI	DZM KLCOM		/CLEAR OUT COMMAND AREA

LEADSP	LAW	-3

	DAC	KL57

	LAC	(SKP		/ASSUME .DAT SLOT MODIFICATION

	DAC	SKPDAT

	LAC	(NOP		/ASSUME NO .UFD MODIFICATION

	DAC	SKPUIC

ASGNXT	JMS	KLGET

	ISZ	KL57

	SKP!CLL

	STL

	SAD	(40

	JMP	ASTS40

	SAD	(15

	JMP	KLOK

	SAD	(175

	JMP	KLOKLF

	SAD	(74		/<

	JMP	ASTU1		/ONLY MODIFY UIC

	AND	(77

	DAC	KLCHAR

	AND	(70

	SAD	(60

	JMP	ASPRUN	/DELIMITED BY UNIT #

	LAC	KLCHAR

	XOR	KLCOM	/MERGE INTO .SIXBT

	SZL

	JMP	FULWD	/3 CHAR. ARE ENOUGH TO DELIMIT HANDLER

	JMS	LSHFT6		/MOVE OVER FOR NEXT CHAR

	DAC	KLCOM

	JMP	ASGNXT

ASTS40	LAC	KLCOM	/DELIMITED BY SPACE?

	SNA

	JMP	LEADSP	/IGNORE LEADING SPACES

ASTD41	DZM	KLCHAR	/UNIT # DEFAULT 0

	JMP	ASGUNT

FULWD	DAC	KLCOM

	SAD	KLNONE	/NON?

	JMP	FULWD1	/YES; IGNORE POSSIBLE TRAILING "E"

	JMS	KLGET

	DAC	KLCHAR

	JMS	STUIC2	/(

	SAD	(40

	JMP	ASTD41

	AND	(170	/UNIT #?

	SAD	(60

	JMP	ASPRUN	/YES

	JMP	KLILLD	/NO; ILLEGAL CONSTRUCTION

FULWD1	JMS	KLGET

	DZM	KLCHAR

	JMS	STUIC2	/(

	SAD	(40

	SKP

ASPRUN	JMS	KLGET

	JMS	STUIC2	/(

	SAD	(40

	SKP

	JMP	KLBADU

ASGUNT	LAC	KLCOM	/A HANDLER BY DEFAULT

	AND	(77

	SNA

	ISZ	KLCOM

	LAC	KLCOM		/(GAR:098) FIND NUMBER OF DEVICE HANDLER.

	JMS	FIONO

	JMP KLILLD	/ILLEGAL DEVICE

	SNA

	JMP PRNXDT-1	/NO DEVICE

ASGUT1	LAC KLCHAR		/(GAR:098)

	RTR

	RTR

	AND (700000	/UNIT NO. OR ZERO

	XOR HANNO

	DAC KLDEVC	/UNIT + DEV CODE

PRNXDT	DZM KLSIGN

	DZM KLDATD

KLNASI	JMS KLGET

	DAC KLCHAR

	JMS	STUIC2	/(

	SAD (40

	JMP KLNASI	/IGNORE SPACE

	SAD (57

	JMP PRDAT		/SLASH

	SAD (15

	JMP PRDAT		/CARRIAGE RETURN

	SAD (175

	JMP PRDAT	/ALT MODE

	SAD (53

	JMP KLNASI	/PLUS SIGN-IGNORED

	SAD (54

	JMP PRDAT	/COMMA

	SAD (55

	JMP KLMIN		/MINUS SIGN

	LAC KLCHAR

	AND (170

	SAD (60		/TEST FOR LEGAL DIGIT

	SKP

	JMP KLBDAT	/ILLEGAL DIGIT

	LAC KLCHAR

	AND (7

	DAC KLCHAR	/SAVE OCTAL

	LAC KLDATD

	RAL!CLL

	RTL

	XOR KLCHAR	/COMBINE DIGITS

	DAC KLDATD

	JMP KLNASI

KLMIN	LAC	KLDATD

	SZA

	JMP	KLBDAT

	CLA!CMA

	DAC KLSIGN	/NEGATIVE SIGN

	JMP KLNASI	/NEXT CHARACTER

PRDAT	LAC KLSIGN	/SIGN

	SNA!CLA!CMA

	JMP KLPOSD	/POSITIVE

	TAD KLDATD

	CMA

	DAC KLDATD

	XCT	SKPDAT	/ONLY LIST ERROR FOR ILLEGAL .DAT SLOTS

	JMP	KLPOSD	/IF .DAT SLOTS ARE TO BE MODIFIED

	SAD (-7

	JMP KLNMOD	/.DAT-7

	SAD (-3

	JMP KLNMOD		/.DAT-3

	SAD (-2

	JMP KLNMOD		/.DAT-2

KLPOSD	LAC	KLDATD	/FETCH .DAT SLOT #

	SAD	(5		/IT IS ILLEGAL TO CHANGE .DAT'S 5 AND 6

	SKP			/IN BOSS MODE

	SAD	(6

	SKP

	JMP	.+4		/NEITHER 5 NOR 6

	LAC*	(152	/5 OR 6, CHECK FOR BOSS MODE

	SPA			/NOT BOSS MODE

	JMP	KLNMOD		/BOSS MODE, PRINT ERROR MESSAGE

	LAC	KLDATD

	TAD	.DATAD	/-LARGEST POSITIVE .DAT SLOT -1

	SMA!SZA

	JMP	KLBDAT		/OUT OF RANGE

	LAC	(15		/-SMALLEST .DAT SLOT

	TAD	KLDATD

	SPA

	JMP	KLBDAT		/OUT OF RANGE

	LAC	KLDATD

	AND	(777

	DAC	UICDAT		/SET UP .DAT SLOT FOR .USER CAL

	XCT	SKPDAT		/ARE WE MODIFYING .DAT SLOT

	JMP	UICS1		/NO

	SNA

	JMP	KLBDAT		/MAY NOT MODIFY .DAT 0

	LAC	KLDATD

	TAD*	(123	/COMPUTE .DAT SLOT ADDRESS

	DAC	CT1

	LAC	KLDEVC		/PUT IN NEW CONTENTS

	DAC*	CT1

UICS1	XCT	SKPUIC		/UIC TO BE CHANGED?

	JMP	UICS2		/NO

UICDAT	XX			/.USER CAL

	23

ASTU2	XX			/.SIXBT	'UIC'

UICS2	LAC	KLCHAR

	SAD (15		/CR

	JMP KLOK

	SAD (175		/ALT-MODE

	JMP	KLOKLF

	SAD (57		/SLASH

	JMP KLASI

	JMP PRNXDT	/MUST HAVE BEEN COMMA

/CODE TO FETCH A UIC WHEN .DAT SLOT IS TO BE UNTOUCHED

/

SKPDAT	XX

SKPUIC	XX			/SKIP IF UIC IS TO BE MODIFIED

ASTU1	LAW	-2		/MUST BE FIRST CHARACTER

	SAD	KL57

	SKP

	JMP	FETUER		/UIC ERROR

	JMS	FETUIC		/FETCH EXACTLY 3 CHARACTERS

	DAC	ASTU2		/.USER CAL

	JMS	KLGET

	SAD	(40		/SPACE

	JMP	.-2		/IGNORE TRAILING SPACES

	SAD	(76		/>

	SKP

	JMP	FETUER		/MUST BE BRACKETED BY PARENTHESIS

	LAC	(SKP		/CHANGE UIC

	DAC	SKPUIC

	LAC	(NOP		/DO NOT CHANGE .DAT SLOT

	DAC	SKPDAT

	JMP	PRNXDT

/

/ROUTINE TO FETCH A UIC AND CHECK FOR (,)

/	JMS	STUIC2

/	WITH CHARACTER IN AC AND IMMEDIATE EXIT IF NOT (.

/

STUIC2	0

	SAD	(74		/IS THIS A UIC?

	SKP

	JMP*	STUIC2		/NO

	XCT	SKPUIC		/HAS ANOTHER UIC BEEN INPUT

	SKP

	JMP	FETUER		/YES ERROR

	LAC	(SKP		/SET FLAG TO MODIFY UIC

	DAC	SKPUIC

	JMS	FETUIC		/FETCH EXACTLY 3 CHARACTERS

	DAC	ASTU2		/DEPOSIT IN .USER CAL

	JMS	KLGET		/IGNORE TRAILING SPACES

	SAD	(40

	JMP	.-2

	SAD	(76		/MUST BE ENCLOSED WITHIN PARENTHESIS

	SKP

	JMP	FETUER

	LAC	(40

	JMP*	STUIC2		/EXIT WITH SPACE AS DELIMITER
	.TITLE XVM/DOS NRM	$BUFFS

/$BUFFS COMMAND PROCESSOR

/

KLNBUF	JMS	KLGET		/FETCH #

	SAD	(40		/IGNORE SPACES

	JMP	.-2

	DZM	KLCOM		/DEFAULT # 0

	SKP

FIL1	JMS	KLGET

	SAD	(15		/CR

	JMP	FIL2

	SAD	(175		/ALT MODE

	JMP	FIL2

	SAD	(40		/SPACE

	JMP	FIL2

	AAC	-60

	DAC	KLCHAR

	JMS	DGITCK

	LAC	KLCOM

	MUL!SHAL

	12

	LACQ

	TAD	KLCHAR

	DAC	KLCOM

	JMP	FIL1		/GO BACK FOR MORE

								/EAG:101

								/EAG:101

FIL2	LAC* (SC.NMF)		/ CHECK IF WE ARE IN EITHER	/EAG:101

	AND (1)			/ BOSS OR BATCH MODE, AND IF	/EAG:101
	TAD KLCOM		/ WE ARE INCREASE THE NUMBER	/EAG:101
	DAC* (.SCOM+26)		/ OF BUFFERS BY ONE.		/EAG:101

	JMP	KLOK

	.TITLE XVM/DOS NRM	$LOGOUT

/$LOGOUT COMMAND PROCESSOR

/

KLNLOT	LAC	(230322		/REPLACE UIC WITH 'SCR'

/

/RESTOR:  SUBROUTINE TO RESTORE ALL SYSTEM DEFAULTS.

/
/	ON ENTRY:  AC = UIC TO BE PUT IN .SCOM+41.

/

RESTOR	DAC*	(.SCOM+41	/NEW UIC.

	LAC*	(.SCOM+42	/TURN EVERYTHING OFF (BR-094)

	AND	(000355		/EXCEPT HDW PRESENT BITS (BR-094)

				/(GAR:095) AND BOSS AND BATCHING BITS.

	DAC*	(.SCOM+42	/AND SAVE (BR-094)

	LAC*	(.SCOM+52

	SMA

	DZM*	(.SCOM+56	/TURN OFF TIME ESTIMATE.
	LAC	PROTCT		/RESET DEFAULT FILE PROTECTION CODE

	DAC*	(.SCOM+54

	LAC	SCOM4		/RESTORE SYSTEM DEFAULT CONFIG.

	DAC*	(.SCOM+4

	LAC	SCOM20

	DAC*	(.SCOM+20

	LAC	SCOM33		/VT15 DEFAULTS

	XOR*	(.SCOM+33

	AND	(500000

	SNA

	JMP	.+4

	XOR*	(.SCOM+33

	AND	(577777

	DAC*	(.SCOM+33

	LAC	FILES		/DEFAULT # BUFFERS

	DAC*	(.SCOM+26

	JMS	SETMD		/ASK FOR MODE TYPEOUT (BR-092)

	JMP	NRM.2	/EXIT FROM DOSNRM WITHOUGHT SETTING .SCOM BITS

	.TITLE XVM/DOS NRM	$LOGIN

/

/$LOGIN COMMAND PROCESSOR

/

LOGFLG	0

KLNLIN=.

	LAC*	(142	/TURN OFF MIC LOGGED-IN BIT

	AND	(377777

	DAC*	(142

	ISZ	LOGFLG

	JMS	FETUIC		/GET CODE

	DZM	LOGFLG

	SAD	(233123		/ 'SYS' IS ILLEGAL

	JMP	FETUER

	SAD	(021613		/'BNK' IS ILLEGAL

	JMP	FETUER

	SAD	(200107		/'PAG' IS ILLEGAL

	JMP	FETUER

	SAD	(111723		/'IOS' IS ILLEGAL

	JMP	FETUER

	JMP	RESTOR		/RESET SYSTEM DEFAULTS.

	.TITLE XVM/DOS NRM	$MICLOG

/

/$MICLOG COMMAND PROCESSOR

/

KLNMIC=.

	ISZ	LOGFLG

	JMS	FETUIC		/ GET CODE

	DZM	LOGFLG

	SAD	MIC		/ IS IT MIC?

	SKP			/ YES

	JMP	KLNLOT		/ NO, FAKE $LOGOUT

	LAC*	(142	/ SET MIC BIT IN .SCOM

	AND	(377777

	XOR	(400000

	DAC*	(142

	LAC	(233123		/ FAKE LOGIN 'SYS'

	DAC*	(141

	JMS	UFDUPD		/ SET UP .UFD TABLE

	JMP	KLOK

	.TITLE XVM/DOS NRM	SET UP .UFD AND .DAT TABLES

/

/ROUTINE TO SET UP THE .UFD TABLE

/

CT1	0

UFDUPD	0

	LAW	-16		/COMPUTE TRANSFER VECTOR TO FIRST ENTRY

	TAD*	(125

	DAC*	(13		/COMPENSATION MADE FOR PREINDEXING

	LAC NODAT

	CLL!RAR			/GET SIZE OF .DAT

	TAD NOPAR	/ADD # OF PAR. IN SGNBLK

	TAD .SGNBLK	/GET ADDRESS OF .UFDT IN SGNBLK

	DAC* (14	/COMPENSATION MADE FOR PREINDEXING

	LAW	-6		/FIRST SIX .DAT SLOTS GET UIC

	DAC	CT1

	JMS UFDUP1

	ISZ	CT1

	JMP	.-2

	LAC*	(152	/.DAT -7 GETS MIC IF NOT IN BOSS MODE

	CLA!SMA			/AND CTP IF IN BOSS MODE

	LAC	(200503

	TAD	(032420

	DAC*	13

	ISZ* (14	/STEP PAST .DAT -7

	LAW	-5		/.DAT -6 TO -2 GET UIC

	DAC	CT1

	JMS UFDUP1

	ISZ	CT1

	JMP	.-2

	LAC	(233123		/.DAT -1,0 GET MIC

	DAC*	13

	DAC*	13

	ISZ* (14	/STEP PAST .DAT -1,0

	ISZ* (14

	LAC	.DATAD		/# POSITIVE .DAT SLOTS

	DAC	CT1

	JMS UFDUP1	/.DAT 1,N GET UIC

	ISZ	CT1

	JMP .-2

	JMP*	UFDUPD

/

/

/THIS SUBROUTINE PUTS THE LOGGED-IN UIC INTO

/.UFDT IF THE CORRESPONDING ITEM IN SGNBLK

/IS "UIC", OTHERWISE IT TAKES THE CODE FROM SGNBLK

/

/

/

/

UFDUP1	0

	LAC* 14			/GET UIC FROM SGNBLK

	SAD (251103	/IS IT .SIXBIT "UIC"

	LAC* (141 	/IF YES, GET LOGGED IN UIC

	DAC* 13

	JMP* UFDUP1

	.EJECT

/

/ROUTINE TO SET UP .DAT TABLE

/

DATSTP	0

	LAC*	(152

	SMA

	JMP	DAT.ON

	LAC*	DAT6

	DAC	DAT6SV

DAT.ON=.

	LAW	-16		/ COMPUTE ADDRESS OF FIRST ENTRY

	TAD*	(123

	DAC*	(13

	LAC	NOPAR		/ COMPUTE ADDRESS OF .DAT IN SGNBLK

	TAD	.SGNBL

	DAC*	(14

	LAC	NODAT		/ COMPUTE -(.DAT TABLE SIZE)

	CLL

	RAR

	TCA			/TWOCMA (BR-080)

	DAC	CT1		/ TRANSFER .DAT TABLE

D.LOOP	LAC*	14
	SAD	(100000		/ .DAT'S -2,-3,-7 ?

	SKP			/ YES, DO NOT SET UP

	JMP	.+5		/ NO , SET UP

	LAC*	(13

	IAC	

	DAC*	(13

	JMP	.+2

	DAC*	13

	ISZ	CT1

	JMP	D.LOOP

	LAC*	(152

	SMA

	JMP	DAT.CE

	LAC	DAT6SV

	DAC*	DAT6

DAT.CE=.

	JMP*	DATSTP

DAT6SV	0

	.TITLE XVM/DOS NRM	FETCH UIC ROUTINE

/

/FETCH UIC AND LEAVE IN AC

/	JMS	FETUIC

/

FETTMP	0

FETUIC	0

	DZM	FETTMP

LSPAC	LAW	-3

	DAC	KL57

FETU1	JMS	KLGET		/GET NEXT CHARACTER

	ISZ	KL57

	SKP!CLL

	STL

	SAD	(40		/SPACE

	JMP	FETU2

	SAD	(15

	JMP	FETUER		/UIC ERROR

	SAD	(175

	JMP	FETUER		/UIC ERROR

	AND	(77

	XOR	FETTMP

	SZL

	JMP	UICHEK

	JMS	LSHFT6

	DAC	FETTMP

	JMP	FETU1

FETU2	LAC	FETTMP		/IF NON-ZERO ERROR

	SNA

	JMP	LSPAC		/IGNORE LEADING SPACES

	JMP	FETUER		/ERROR MUST BE THREE CHARACTER UIC

UICHEK=.

	DAC	FETTMP

	LAC	LOGFLG

	SNA

	JMP	FETU3

	JMS	KLGET		/MAKE SURE

	SAD	(15		/ONLY 3

	JMP	FETU3		/CHARACTERS WERE

	SAD	(175		/TYPED

	JMP	FETU3

	SAD	(40		/IGNORE SPACES

	JMP	FETU3

	JMP	FETUER

FETU3	LAC	FETTMP

	SNA

	JMP	FETUER

	SAD	(777777

	JMP	FETUER

	SAD	(021613		/'BNK' AND 'PAG' ARE ONLY LEGAL

	JMP	MICHEK		/IF MIC LOGED-IN.

	SAD	(200107

	JMP	MICHEK

	SAD	(032420

	JMP	MICHEK

	JMP*	FETUIC

MICHEK=.

	LAC*	(142

	SMA

	JMP	FETUER

	LAC	FETTMP

	JMP*	FETUIC

	.TITLE XVM/DOS NRM	FETCH UNIT NO. ROUTINE

/SUBROUTINE TO SCAN FOR UNIT NUMBER

KLDIRC	0

KLGUNT	JMS KLGET

	SAD (40		/SPACE

	JMP KLGUNT

	SAD (15		/RETURN

	JMP* KLDIRC

	SAD (175		/ALT MODE

	JMP*	KLDIRC

	ISZ	KLDIRC

	DAC KLCHAR		/SAVE

	AND (170

	SAD (60

	SKP

	JMP	NOUNIT

	LAC KLCHAR

	RTR

	RTR

	DAC	DTTMP1

	JMS	KLGET

	DAC	KLCHAR

	LAC	DTTMP1

NOUNIT=.

	AND	(700000

	JMP*	KLDIRC

	.TITLE XVM/DOS NRM	$INSTRUCT PRINTING ROUTINE

/

/ PRINTING SUBROUTINE

/	JMS MPRINT

/	XX		/BUFFER ADDRESS

/	(RETURN)

/

MPRINT	0

	LAC* MPRINT

	ISZ MPRINT

	DAC KLDIRF

	LAW -1

	DAC KLCNT

	DZM SIXROS	/TREAT 00 AS RUBOUT

MSNXTM	LAC (KLBUFF+2

	DAC KLPUTP

	DZM KL57

MSNXTC	JMS KLFSIX

	SNA

	JMP	MSNXTC

	SAD (45		/%=CR

	JMP MSCRLF

	SAD (74		/<=END

	JMP	ENDCHK

	SAD (76		/>=4 SPACES

	JMP	TABCHK

MPUT=.

	JMS KLPUT

	JMP MSNXTC

MSCRLF	LAC (15		/PUT CR IN BUFFER

	JMS KLPUT

	JMS	PRINT	/PRINT LINE

	KLBUFF

	JMP MSNXTM	/FILL NEXT LINE

MSTAB	LAC	(40		/TREAT AS 4 SPACES

	JMS	KLPUT

	JMS	KLPUT

	JMS	KLPUT

	JMS	KLPUT

	LAC	MPTMP0

	JMP	MSNXTC+1

ENDCHK=.

	JMS	KLFSIX

	SAD	(74

	JMP	MPUT

	JMP*	MPRINT

TABCHK=.

	JMS	KLFSIX

	SAD	(76

	JMP	MPUT

	DAC	MPTMP0

	JMP	MSTAB

MPTMP0	0

	.TITLE XVM/DOS NRM	INITIALIZE SPECIAL SYSTEM PROGRAMS

/

/ ROUTINES TO INITIALIZE SPECIAL SYSTEM PROGRAMS AND CALL .SYSLD

/

KLLOA=.

KLGLO=.

KLDDT=.

KLDDTN=.

	LAC	(KLCOM		/ CHANGE NAME TO .SIXBT

	JMS	CHNSIX

	JMP	SYSLDR		/ CALL IN .SYSLD

								/EAG:101

								/EAG:101

KLEXEC	JMS	KLPGSH		/ GET FILE NAME

	LAC	(.SCOM+7

	JMS	CHNSIX

	LAC	EXECUT

	DAC	KLCOM

	LAC	EXECUT+1

	DAC	KLCOM+1

	JMP SYSLDR						/EAG:101

	.TITLE XVM/DOS NRM	LOAD BOSS XVM

BOSS15	LAC	(741000		/SET 'SKIP IF BOSS15' FLAG

	DAC	SKPBOS

	LAC	LBOSS

	DAC	KLCOM

	LAC	LBOSS+1

	DAC	KLCOM+1

	LAC*	(123		/WHEN LOADING BOSS15 THE SYSTEM

	AAC	-15		/DEVICE MUST BE ASSIGNED TO 

	DAC	BOSTMP		/(GAR:099).DAT -14 AND .DAT -15.

	LAC	SDEV1		/GET SYSTEM DEVICE HANDLER NUMBER.

	IAC	

	JMS	FIONO

	JMP	KLWHAT

	DAC*	BOSTMP		/(GAR:099)PUT IT IN .DAT -15.

	ISZ	BOSTMP		/(GAR:099)

	DAC*	BOSTMP		/(GAR:099)PUT IT IN .DAT -14.

	JMP	LOADSY+2

BOSTMP	0			/(GAR:099) PROVIDE TEMPORARY SO THAT LOCATION

				/(GAR:099) 'BOSS15' WON'T BE ALTERED.

SKPBOS	0

	.TITLE XVM/DOS NRM	CHANGE 6 .ASCII CHARACTERS TO .SIXBT

/THIS ROUTINE CHANGES THE .ASCII PROGRAM NAME IN COMAND TO A 6

/LETTER .SIXBT 2 WORD FILE NAME.  THE AC ON INPUT CONTAINS 

/THE ADDRESS WHERE THE FIRST WORD OF THE PAIR IS STORED.

/	JMS	CHNSIX

/	FIRST EXIT	/ERROR NAME MISSING FROM COMAND

/	SECOND EXIT	/SUCCESS

/

CHNSIX	0

	DAC	COMAND+3		/STORE IN FREE TEMPORARY

	LAC	COMAND		/FETCH FIRST CHARACTER

	SNA!RCL			/ROTATE AND CHECK IF NO NAME

	JMP	KLWHAT		/NO NAME TAKE FIRST EXIT

	DAC	SAVEC		/STORE FOR NEXT EXTRACTION

	AND	(770000		/REMOVE OTHER CHARACTERS

	DAC	SAVE		/START UP THE .SIXBT WORD

	LAC	SAVEC		/GO FOR NEXT CHARACTER

	RCL

	DAC	SAVEC		/STORE REMAINDER FOR PART OF 3RD CHAR

	AND	(7700		/EXTRACT SECOND CHARACTER

	XOR	SAVE		/PUT IN .SIXBT WORD

	DAC	SAVE

	LAC	SAVEC		/THE DIFFICULT EXTRACTION NOW

	RCL

	AND	(70		/GET THE FIRST 3 CHARACTERS

	XOR	SAVE		/PUT IN .SIXBT WORD

	DAC	SAVE

	LAC	COMAND+1	/THE REMAINING 3 BITS ARE IN NEXT WORD

	RTL

	RTL

	DAC	SAVEC		/SAVE FOR NEXT CHARACTERS

	AND	(7

	XOR	SAVE

	DAC*	COMAND+3	/THIS TIME WE PUT THE FIRST .SIXBT WORD AWAY

	ISZ	COMAND+3	/BUMP TO SECOND POSITION

	LAC	SAVEC		/GET 4TH CHARACTER

	AND	(770000

	DAC	SAVE

	LAC	SAVEC

	RCL

	AND	(7700

	XOR	SAVE

	DAC	SAVE

	LAC	COMAND+2

	JMS	LSHFT6

	RTL

	AND	(77

	XOR	SAVE

	DAC*	COMAND+3

	JMP*	CHNSIX

	.TITLE XVM/DOS NRM	LOAD SYSTEM FILES

/

/ROUTINE TO LOAD SYS FILES

/

LOADSY=.

	LAC	(KLCOM		/IS THIS PROGRAM LOAD

	JMS	CHNSIX		/CHANGE TO .SIXBT

	LAC	(KLCOM

	JMS	FCOMK		/FIND NAME IN COMBLK

	LAC	(PLOADC

	DAC	TVCNT

	LAC	(KLCOM		/FIND IN SYSBLK

	JMS	FSYSK

	XCT	SKPBOS		/ SKIP IF LOADING BOSS15

	JMP	SYSLDR

	JMP	LDBOSS

/

/FIND PROGRAM NAME IN COMBLK

/	AC CONTAINS ADDRESS OF NAME ON INPUT

/	JMS	FCOMK

/	RETURN		/COMBLK ADDRESS IN AC

/	P2 ALSO CONTAINS COMBLK ADDRESS

/

/(GAR:099)  CORRECT ABOVE DESCRIPTION.

/

P2	0

FCOMK	0

	DAC	FCOMTP

	DAC	FCOMT1

	ISZ	FCOMT1		/BUMP TO SECOND HALF OF NAME

	LAC	COMBLK

FCOM1	DAC	P2

	SAD	.COMBL		/END OF COMBLK?

	JMP	KLWHAT		/YES; NOT PRESENT

	DAC*	(10

	LAC*	10

	SAD*	FCOMTP

	SKP

	JMP	FCOM2		/NOT THIS ENTRY

	LAC*	10

	SAD*	FCOMT1

	JMP	FCOM3

FCOM2	LAC	P2		/NO MATCH

	TAD*	P2

	JMP	FCOM1		/GO NEXT ENTRY

FCOM3=.				/FOUND IT

	LAC	P2		/ADDRESS IN AC

	JMP*	FCOMK		/EXIT

FCOMTP	0

FCOMT1	0

	.EJECT

/

/FIND PROGRAM NAME IN SYSBLK

/	AC CONTAINS ADDRESS OF NAME

/	JMS	FSYSK

/	RETURN		/AC ADDRESS OF ENTRY

/	P3 ALSO CONTAINS ADDRESS OF ENTRY

/	AUTO INDEX 11 READY TO PICK OUT FB

/

/(GAR:099)  CORRECT ABOVE DESCRIPTION.

/

P3	0

FSYSK	0

	DAC	FCOMTP		/SET UP NAME POINTERS

	DAC	FCOMT1

	ISZ	FCOMT1

	LAC	.SYSBL

	IAC	

FSYS1	DAC	P3		/ARE WE FINISHED?

	SAD	.SYSBL

	JMP	KLWHAT

	DAC*	(11

	LAC*	P3

	SAD*	FCOMTP

	SKP

	JMP	FSYS2		/NOT THIS ONE

	LAC*	11

	SAD*	FCOMT1

	JMP	FSYS3		/FOUND

FSYS2	LAC	P3		/GO TO NEXT ENTRY

	AAC	7

	JMP	FSYS1		/SEVEN WORDS PER ENTRY

FSYS3=.				/BUMP RETURN

	LAC	P3		/ADDRESS IN AC

	JMP*	FSYSK		/EXIT

	.TITLE	XVM/DOS NRM	SET MODE TYPEOUT BIT

/

/	SET BIT 6 IN SCOM+42 - MODE TYPEOUT ENABLE

/

SETMD	0			/ENTRY POINT (BR-087)

	LAC*	(142		/GET SCOM + 42 (BR-087)

	AND	(773777		/CLEAR BIT IF SET (BR-087)

	XOR	(004000		/SET BIT 6 (BR-087)

	DAC*	(142		/SAVE WORD IN SCOM+42 (BR-087)

	JMP*	SETMD		/RETURN TO CALLER (BR-087)

	.EJECT

/

/GET HANDLER NAME FROM TABLE

/	AC	CONTAINS NUMBER OF HANDLER

/	JMS	FIONM

/	AC CONTAINS NAME OF HANDLER ON RETURN

/

FIONM	0

	DAC	HANNO

	CMA

	DAC	HANNAM		/COUNTER

	LAW	-1

	TAD	SGNTAB

	DAC	P1

FIO1	JMS	NHAN		/FETCH NEXT HANDLE NAME

	JMP	BADHNO		/(GAR:095) USED TO BE 'JMP FIOBHN'!

	ISZ	HANNAM		/COUNT #

	JMP	FIO1

	DAC	HANNAM		/STORE AWAY NAME FOUND

	JMP*	FIONM		/EXIT

/(GAR:095) DELETED 14 LINES WHICH HANDLED THE BATCH DEVICE AS

/(GAR:095) A SPECIAL CASE.  THIS IS NO LONGER NECESSARY.

/

/GET HANDLER NUMBER FROM TABLE

/	AC CONTAINS HANDLE NAME

/	JMS	FIONO

/	FIRST RETURN	/NOT IN TABLE

/	SECOND	RETURN	/AC CONTAINS #

/

FIONO	0

	DAC	HANNAM		/SAVE NAME

	LAW	-1

	TAD	SGNTAB

	DAC	P1

	DZM	HANNO

FIO2	JMS	NHAN		/FETCH NEXT HANDLER

	JMP*	FIONO		/HANDLER NOT FOUND

	SAD	HANNAM		/IS THIS THE ONE

	JMP	FIO3		/YES

	ISZ	HANNO		/BUMP HANDLR #

	JMP	FIO2		/ITERATE

FIO3	LAC	HANNO		/GET HANDLER # IN AC

	ISZ	FIONO		/BUMP TO SECOND EXIT

	JMP*	FIONO

/

/GO TO NEXT HANDLER IN TABBE

/	P1 POINTS TO LAST HANDLER

/	JMS	NHAN

/	FIRST RETURN	/END OF TABLE REACHED

/	SECOND RETURN	/FOUND NEXT HANDLERR

/	AC CONTAINS HANDLER NAME

/

NHAN	0

NHAN1	ISZ	P1		/EXAMINE NEXT ENTRY FOR HANDLER NAME

	LAC	P1

	SAD	LSGNBL		/END REACHED

	JMP*	NHAN		/YES TAKE FIRST EXIT

	LAC*	P1		/IS THIS A HANDLER NAME

	AND	(777700		/TAKE ONLY TOP 12 BITS

	SNA			/YES

	JMP	NHAN2		/NO

	LAC*	P1		/GET INTO AC

	ISZ	NHAN		/BUMP EXIT

	JMP*	NHAN

NHAN2	LAC*	P1		/SKIP OVER SKIPS

	RCL			/QUICK MULTIPLY BY 3

	TAD*	P1

	TAD	P1

	DAC	P1

	JMP	NHAN1		/TRY AGAIN

HANNO	0			/HANDLER #

HANNAM	0			/HANDLER NAME

P1	0			/POINTS TO HANDLER IN TABLE

	.TITLE XVM/DOS NRM	'LDRUIC'

/

/ROUTINE LDRUIC

/

/LDRUIC GOES THROUGH THE DAT SLOT TABLE AND PLACES THE

/APPROPRIATE UIC ('BNK' FOR BANK SYSTEMS AND 'PAG' FOR

/PAGE SYSTEMS) IN THE UFD TABLE WHEREVER THE UIC

/'SYS' APPEARS

/CALLING SEQUENCE:

/	JMS	LDRUIC

/	(RETURN)

LDRUIC=.

	0

	LAC*	(125		/POINTER TO .UFD+0

	AAC	-7

	DAC	SYSLDR		/NOW POINTS TO .DAT -7.

	LAC	(233123		/'SYS'

	DAC*	SYSLDR		/RESET -7 TO SYS.

	LAC*	(.SCOM+4		//BIT 11=1 IF BANK MODE.

	AND	(100

	SNA!CLA

	LAC	(156274		/'PAG' (BUILT BY ADDITION) OR

	TAD	(021613		/'BNK'.

	DAC	SYSLDR

	LAC*	(141		/CURRENT UIC.

	SAD	(233123		/'SYS'?

	SKP

	JMP	.+3

	LAC	SYSLDR		/YES - CHANGE UIC TO 'BNK' OR 'PAG'

	DAC*	(141

	LAW	-16

	TAD*	(125

	DAC	P1		/START OF .UFDT.

	LAW	-16

	TAD	.DATAD

	DAC	CT1

SYSLD1=.

	ISZ	CT1

	SKP

	JMP*	LDRUIC

	ISZ	P1

	LAC	(233123		/'SYS' FOR THIS SLOT?

	SAD*	P1

	SKP

	JMP	SYSLD1

	LAC	SYSLDR		/YES - CHANGE TO BNK OR PAG.

	DAC*	P1

	JMP	SYSLD1

	.TITLE XVM/DOS NRM	'SYSLDR'

/

/SYSTEM LOADER ROUTINE

/

SYSLDR=.

	LAC*	(152		/BOSS MODE?

	SMA			/YES, SKIP

	JMP	SYSLD2		/NO, NO SPECIAL CODE

LDBOSS=.

	LAC	(030402		/GET HANDLER NO. FOR CDB

	JMS	FIONO

	JMP	BADBOS		/THERE IS NO CDB HANLER

	DAC*	DAT5

	LAC	(142001		/GET HANDLER NO. FOR LPA

	JMS	FIONO

	JMP	BADBOS		/THERE IS NO LPA ON SYSTEM

	DAC*	DAT6

SYSLD2	JMS	LDRUIC

	LAC*	(142

	AND	(637777

	XOR	(100000

	DAC*	(142

	CAL+0

	24

	KLCOM

	.TITLE XVM/DOS NRM 	'NRMEXI'

/

/ ROUTINE NRMEXI

/

/ THIS ROUTINE CAUSES A NON-RESIDENT MONITOR

/ EXIT WITH BIT 1 OF .SCOM+42 SET TO INDICATE

/ RETURN TO NON-RESIDENT MONITOR

/

CTRLC=.				/ENTRY POINT FOR ^C

	LAC	PRTMP		/RESTORE .DAT -12

	DAC*	DATM12

	LAW 777776		/ TURN OFF BATCH		/EAG:101

	AND* (SC.NMF)						/EAG:101

	DAC* (SC.NMF)						/EAG:101

NRMEXI=.

	LAC*	(.SCOM+52	/BOSS MODE? (BR-086)

	SMA			/YES, SKIP

	JMP	NRM.1		/NO, SKIP SPECIAL CODE

	LAC	(030402		/GET HANDLER NO. FOR CDB

	JMS	FIONO

	JMP	BADBOS		/THERE IS NO CDB ON SYSTEM

	DAC*	DAT5

	LAC	(142001		/GET HANDLER NO. FOR LPA

	JMS	FIONO

	JMP	BADBOS		/THERE IS NO LPA HANDLER ON SYSTEM

	DAC*	DAT6

NRM.1=.

	JMS	LDRUIC

	LAC*	(.SCOM+42	/SET BIT1 OF .SCOM+42 TO 1

	AND	(477777

	XOR	(300000

	DAC*	(.SCOM+42

NRM.2=.				/LOGOUT COMES HERE.

	.EXIT			/EXIT

	.TITLE XVM/DOS NRM	STORAGE CONSTANTS

/STORAGE CONSTANTS AND COUNTERS

EXITLT	0			/ SAME AS .SCOM+34

BANKBT	0

.DATAD	0		/ -(LARGEST # OF POS. .DAT SLOTS)

DAT5	0

DAT6	0

DATM2	0		/ .DAT -2

DAT1	1		/ .DAT +1

SGNTAB	0		/ BEGINNING OF I/O DEVICE TABLE

.SCOM=100

KLCHAR    0                                /LAST CHARACTER

KLCHR2    0                                /INTERMEDIATE CHAR STORAGE

KLCNT     0                                /COUNTER

KLCOMP    0                                /COMMAND POINTER

KLGETP    0                                /KLGET POINTER

KLGET5    0                                /KLGET COUNTER

KLPUTP    0                                /KLPUT POINTER

SAVE	0

SAVEC	0

KLWD1     0                                /TEMP FOR KLPUT

KLWD2     0                                /TEMP FOR KLPUT

KLWD3     0                                /TEMP FOR KLPUT

KL57      0                                /KLPUT COUNTER

KLDEVC    0                     /DEVICE CODE

KLDATD    0                     /DAT DIGITS

KLSIGN    0                     /SIGN STORAGE

KLDIRF    0                     /FILE MAP ADDRESS

KLCNTB    0                     /BIT COUNTER

TVCNT     0                     /NO. OF TRANSFER VECTORS

UNIT      0                     /UNIT NO. ON GET

STOPER=17777

SWI	0

SIXROS	0

KLCNTT	0

KLPOS	0

DATM12	0

DATM14	0

DATM15	0

SDADD	0

LPADDR	0

SINGOK	0

.SYSBL	0

.SGNBL	0

LSGNBL	0

.COMBL	0

TEMP	0		/TEMP STORAGE FOR REQUEST (BR-089)

MANSAV	0		/STORAGE FOR MANUAL QDUMP ADR. (BR-094)

KLNONE	.SIXBT	'NONE'

ON	.ASCII	/ON/

	.LOC	.-1

OFF	.ASCII	/OFF/

	.LOC	.-1

MT7	.ASCII	/7/

	.LOC .-1
MT9	.ASCII	/9/
	.LOC .-1
	.TITLE XVM/DOS NRM	SHIFT ROUTINES

/

/SHIFT ROUTINES

/

/SHIFT LEFT SIX

LSHFT6	0

	RTL

	RTL

	RTL

	JMP*	LSHFT6

/SHIFT RIGHT SIX

RSHFT6	0

	RTR

	RTR

	RTR

	JMP*	RSHFT6

	.TITLE XVM/DOS NRM	'DGITCK'

/

/ROUTINE DGITCK

/

/DGITCK CHECKS THE VALUE IN THE AC FOR A VALID OCTAL

/VALUE FOR A DECIMAL DIGIT.  I.E., IF THE AC VALUE IS NOT

/BETWEEN 0 AND 11 (INCLUSIVE) THE AC VALUE IS DEFINED AS

/INVALID.

/CALLING SEQUENCE:

/	JMS	DGITCK

/	(RETURN IF VALID)

/CONTROL GOES TO KLWHAT IF VALUE IS INVALID

DGITCK=.

	0

	SPA

	JMP	BADIGT

	AAC	-12

	SMA

	JMP	BADIGT

	JMP*	DGITCK

	.TITLE XVM/DOS NRM	'PLIMCN'

PLIMCN	0

	DAC	PLIMTM

	SPA

	JMP	LIMER

	LAC*	PLIMCN

	IAC	

	TCA			/TWOCMA (BR-081)

	TAD	PLIMTM

	SMA

	JMP	LIMER

	ISZ	PLIMCN

LIMER	ISZ	PLIMCN

	LAC	PLIMTM

	JMP*	PLIMCN

PLIMTM	0

	.TITLE	SYSBLK

/

/	.LOC	16100

/

/THIS IS WHERE SYSBLK STARTS. SYSBLK IS IN A SEPERATE SOURCE

/FROM THE MONITOR. SYSBLK IS BLOCKS 33 AND 34 OF THE SYSTEM DEVICE AND IT

/STARTS AT WORD 16100 OF THE MONITOR

/

SYSBLK=16100

COMBLK=17077

	.TITLE	SGNBLK

/

/	.LOC	17100

/	THIS IS WHERE SGNBLK STARTS.  SGNBLK IS BLOCK 35 OF THE SYSTEM

/DEVICE.  SGNBLK IS A SEPERATE SOURCE FROM THE MONITOR.  SGNBLK

/STARTS AT LOCATION 17100 OF THE MONITOR.

/

SGNBLK=17100	/END OF I/O DEVICE TABLE 

NOPAR=SGNBLK+1	/# OF SYSTEM PARAMETERS

NODAT=SGNBLK+2	/# OF .DAT SLOTS

NOSKP=SGNBLK+3	/# OF SKIPS

SDEV1=SGNBLK+4	/.SIXBT 'DV' SYSTEM DEVICE CODE

SCOM4=SGNBLK+5	/.SCOM+4 CONTENTS

SCOM20=SGNBLK+6	/.SCOM+20 CONTENTS

X1=SGNBLK+7	/NUMBER OF BUFFER WORDS/FILE

FILES=SGNBLK+10	/DEFAULT FILES COMMAND

MIC=SGNBLK+11	/MONITOR IDENTIFICATION CODE

SCOM33=SGNBLK+12	/^X FEATURE - CONTENTS OF .SCOM+33

PROTCT=SGNBLK+13		/DEFAULT PROTECTION CODE FOR FILES.

	.TITLE	BUFFER

/

/

/	THIS 257 (10) WORD BUFFER IS USED FOR LISTING AND REFRESHING

/DECTAPE BUFFERS AS WELL AS BEING A TELETYPE BUFFER ETC.  INITIAL

/CONTENTS SHOULD BE IGNORED.

/

COMAND=.

KLCOM=COMAND		/.BLOCK	4

KLCOM2=KLCOM+4		/.BLOCK	4

KLBUFF=KLCOM2+4		/TELETYPE I/O BUFFER

	.BLOCK	70

	.TITLE XVM/DOS NRM	$SCOM TYPEOUT TEXT

	LAW	0

	LAW	0

SCMHDR	.ASCII	<12>'SYSTEM INFO - XVM/DOS -           '<12><15>

	.LOC	.-1

SCMBRA	.ASCII	<0>'7646 - BOOTSTRAP RESTART ADDR '<15>

	.LOC	.-1

SCMFCB	.ASCII	<0>'7636 - 1ST FREE CELL BELOW BOOTSTRAP '<15>

SCMDAT	.ASCII	<0><0><0><0>' - ADDR OF .DAT '<15>

	.LOC	.-1

SCMUFD	.ASCII	<0><0><0><0>' - ADDR OF .UFD '<15>

	.LOC	.-1

SCMPOS	.ASCII	<0><0><0>' - NO. OF POS. .DAT SLOTS '<15>

SCMAPI	.ASCII	'API IS ENABLED'<15>

SCMXVM	.ASCII	'XVM MODE IS ENABLED'<15>	/(BR-086)

SCMODE	.ASCII	<0><0><0><0><0>'MODE OPERATION'<15>

SCMCHN	.ASCII	'7 CHANNEL MAGTAPE ASSUMED BY HANDLERS'<15>

SCMLPS	.ASCII	'     HARACTER LINE PRINTER ASSUMED BY HANDLERS'<15>

SCMCQR	.ASCII	<0><0><0><0>' - ^Q ADDRESS FOR MANUAL DUMP'<15>

SCMPRO	.ASCII	'  - DEFAULT FILE PROTECTION CODE'<15>

CURPRO	.ASCII  '  - CURRENT FILE PROTECTION CODE'<15>

SCMBUF	.ASCII	<0><0><0><0><0>'- DEFAULT BUFFS SETTING'<15>

SCM01	.ASCII	'I/O HANDLERS AVAILABLE'<15>

SCM2	.SIXBT	'TTA   TELETYPE: I/O, ASCII MODES, ALL FUNCTIONS%<'

SCM3	.SIXBT	'PRA   TAPE READER: INPUT, ALL MODES, ALL FUNCTIONS%<'

SCM4	.SIXBT	'PRB   TAPE READER: INPUT, IOPS ASCII MODE, ALL FUNCTIONS%<'

SCM5	.SIXBT	'PPA   PUNCH: OUTPUT, ALL MODES, ALL FUNCTIONS%<'

SCM6	.SIXBT	'PPB   PUNCH: OUTPUT,ALL MODES LESS IOPS ASCII, ALL FUNCTIONS%<'

SCM7	.SIXBT	'PPC   PUNCH: OUTPUT, IOPS BINARY MODE, ALL FUNCTIONS%<'

SCM8	.SIXBT	'DTA   DECTAPE: 3 FILES, I/O, ALL MODES, ALL FUNCTIONS%<'

SCM9	.SIXBT	'DTB   DECTAPE: 2 FILES, I/O, IOPS MODES, LIM FUNCTIONS%<'

SCM10	.SIXBT	'DTC   DECTAPE: 1 FILE, INPUT, IOPS MODES, LIM FUNCTIONS%<'

SCM11	.SIXBT	'DTD   DECTAPE: 1 FILE, I/O, ALL MODES, ALL FUNCTIONS%<'

SCM12	.SIXBT	'DTE   DECTAPE: 1 FILE, I/O, ALL MODES, NO .MTAPE%<'

SCM13	.SIXBT	'DTF   DECTAPE: NON-FILE ORIENTED FOR F4 .OTS%<'

SCM14	.SIXBT	'DKA   DECDISK: N FILES, I/O, ALL MODES, ALL FUNCTIONS%<'

SCM15	.SIXBT	'DKB   DECDISK: N FILES, I/O, ALL MODES, LIM FUNCTIONS%<'

SCM16	.SIXBT	'DKC   DECDISK: N FILES, INPUT, ALL MODES, LIM FUNCTIONS%<'

SCM17	.SIXBT	'DPA   DISKPACK: N FILES, I/O, ALL MODES, ALL FUNCTIONS%<'

SCM18	.SIXBT	'DPB   DISKPACK: N FILES, I/O, ALL MODES, LIM FUNCTIONS%<'

SCM19	.SIXBT	'DPC   DISKPACK: N FILES, INPUT, ALL MODES, LIM FUNCTIONS%<'

SCM19A	.SIXBT	'RKA   DISKCART: N FILES, I/O, ALL MODES, ALL FUNCTIONS%<'

SCM19B	.SIXBT	'RKB   DISKCART: N FILES, I/O, ALL MODES, LIM FUNCTIONS%<'

SCM19C	.SIXBT	'RKC   DISKCART: N FILES, INPUT, ALL MODES, LIM FUNCTIONS%<'

SCM20	.SIXBT	'MTA   MAGTAPE: 3 FILES, I/O, ALL MODES, ALL FUNCTIONS%<'

SCM21	.SIXBT	'MTC   MAGTAPE: 1 FILE, INPUT, IOPS MODES, ALL FUNCTIONS%<'

SCM22	.SIXBT	'MTF   MAGTAPE: NON-FILE ORIENTED FOR F4 .OTS%<'

SCM23	.SIXBT	'LPA   LINE PRINTER: OUTPUT, ASCII MODES, ALL FUNCTIONS%<'

SCM24	.SIXBT	'CDB   CARD READER: INPUT, IOPS ASCII MODE, ALL FUNCTIONS%<'

SCM25	.SIXBT	'VPA   VP DISPLAY: OUTPUT, ASCII AND DUMP MODES, ALL FUNCTIONS%<'

SCM27	.SIXBT	'VTA   VT-15: I/O%<'

SCM27A	.SIXBT	'XYA    PLOTTER: OUTPUT, ASCII & BINARY MODES, ALL FUNCTIONS%<'

SCM28	.SIXBT	'LKA   LK-35 KEYBOARD: INPUT, ASCII MODES, ALL FUNCTIONS%<'

SCM26	.ASCII	'SKIP CHAIN ORDER'<15>

SCMSKP	.ASCII	<11>'      '<15>

	.TITLE XVM/DOS NRM 	PATCH AREA

/
PATCH	.BLOCK 20
	.LTORG		/(RKB-108) ASSEMBLE THE LITERALS
	.IFPNZ	.-16100-20	/(RKB-210) ARE WE TOO BIG?
ERROR	THE NON-RESIDENT MONITOR HAS OVERLAPPED 
ERROR	THE SPACE ALLOCATED FOR SGNBLK, ET. AL.
	.ENDC			/(RKB-210)
	.END
