	.TITLE PATCH
 
/COPYRIGHT 1969, 1970, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
 
/VERSION V4A - 14 JAN 69
/PDP9 ADVANCED SOFTWARE PACKAGE.
/SYSTEM PROGRAM TO PATCH SYSTEM PROGRAMS.
 
/SEQUENTIAL ORGANIZATION: COMMAND DECODER; COMMAND PROCESSORS;
/SUBROUTINES; ERROR HANDLER; TELETYPE MESSAGES; SYMBOL TABLE; COMMAND TABLE;
/DATA REGISTERS; BUFFERS & BANK BIT INITIALIZATION ROUTINE.
 
	.ABS
	.LOC 15236
 
IDX=ISZ			/USED WHEN SKIP NOT INTENDED.
SET=ISZ			/USED TO SET A FLAG NON-0.
.SCOM=100
 
/PROGRAM STARTS HERE.
 
BEGIN	JMP INBANK	/ONE-TIME-ONLY INITIALIZATION OF
			/BANK BITS IN 15-BIT ADDRESSES.
 
/PROGRAM RESTARTED HERE.
 
BEGRET	CAL 764		/.INIT -14, SYSTEM DEVICE HANDLER,
	1		/FOR INPUT AND OUTPUT.
ADR1	BEGRET		/^P ADDRESS (JUST IN CASE).
	0
 
	CAL 1775		/.INIT -3, TO PRINT CAR. RET. LINE FD.
	1		/ON THE TELETYPE.
ADR2	BEGRET		/^P RESTART ADDRESS.
	0
 
	CAL 2775		/.WRITE IOPS ASCII ON TELETYPE.
	11
ADR3	MSG1		/ADDRESS OF 'PATCH V4A'.
SYSNAM	0		/SYSTEM-PROGRAM-SELECTED FLAG.
 
	DZM SYSNAM	/SYSTEM PROGRAM NOT YET SELECTED.
	LAW -1		/# OF CURRENT BLOCK IN CORE SET
	DAC CURBLK	/NEGATIVE,I.E. NONE YET.
 
/RETURN HERE WHEN READY TO READ IN AND DECODE A NEW COMMAND.
 
NUCMND	DZM BLKOUT	/SET FLAG ZERO INDICATING THAT
			/THE BLOCK IN CORE (IF ANY) HAS
			/NOT YET BEEN MODIFIED.
	JMS TTYIN		/PRINT'>'; READ IN USER'S LINE; SET
			/PICKUP COUNT AND POINTER.
	.EJECT

/NOW CONVERT THE COMMAND FROM.ASCII TO .SIXBT AND STORE
/FOR SUBSEQUENT COMPARISION WITH LEGAL ENTRIES IN THE
/COMMAND TABLE. COMMAND IS EITHER A SYSTEM PROGRAM
/NAME OR AN ACTION (L, READ, OR EXIT). L IS FOLLOWED
/BY A SPACE AND THEN AN OCTAL ADDRESS. B, B+, AND B-
/ARE TREATED LIKE PROGRAM NAMES.
 
TRYAGN	LAC (40
	DAC LASTCH
	JMS STRING	/CONVERT COMMAND TO .SIXBT .
	JMP NUCMND	/NULL LINE.
 
/NOW, SEARCH COMTAB FOR A MATCHING COMMAND.
 
MATCH	LAC ADR5		/(COMTAB
	DAC PUTP		/INITIAL ADDRESS OF TABLE.
	LAC (COMEND-COMTAB/5\777777+1
	DAC PUTC		/2'S COMPLEMENT OF # TABLE ENTRIES.
 
NXCMD	LAC* PUTP		/TRY TO MATCH 2 WORDS.
	IDX PUTP
	SAD COMAND
	SKP		/1ST WORDS MATCH.
	JMP NXCMD1
	LAC* PUTP
	IDX PUTP
	SAD COMAND+1
	SKP		/2ND WORDS MATCH.
	JMP NXCMD2
 
	LAC* PUTP		/3RD WORD IN TABLE ENTRY.
	SMA
	JMP SETUP		/IT'S A PROGRAM NAME.
	JMP* PUTP		/IT'S AN ACTION.
 
NXCMD1	IDX PUTP		/SKIP OVER REMAINDER OF THIS ENTRY.
NXCMD2	IDX PUTP
	IDX PUTP
	IDX PUTP
 
	ISZ PUTC		/ANY MORE ENTRIES?
	JMP NXCMD		/YES.
	JMP ILLCMD	/NO. ILLEGAL COMMAND.
 
 
	.EJECT

/SYSTEM-PROGRAM-NAME COMMAND. USER ASKS TO SETUP FOR
/PATCHING A NEW SYSTEM PROGRAM OR A SINGLE BLOCK.
 
SETUP	DAC STBLOK	/FIRST BLOCK# OF THE PROGRAM ON
			/THE SYSTEM DEVICE.
	RTL		/GET BIT 1 INTO THE LINK.
	IDX PUTP
	LAC* PUTP
	DAC LOCAT		/PROGRAM'S LOAD ADDRESS -1.
	IDX PUTP
	LAC* PUTP
	DAC SIZE		/PROGRAM'S SIZE (2'S COMPLEMENT).
	DAC SYSNAM	/SET THIS FLAG NON-ZERO TO INDICATE
			/THAT A SYSTEM PROGRAM IS SELECTED.
	LAW -1		/SET THE # OF THE BLOCK IN CORE NEGATIVE
	DAC CURBLK	/SO THAT A BLOCK WILL HAVE TO BE LOADED.
			/THIS IS IN CASE THE BLOCK IN CORE WAS
			/READ IN IN THE OPPOSITE DIRECTION.
	SZL		/IF BIT 1 WAS SET, THE COMMAND WAS
	JMP BLOCK		/FOR A SINGLE BLOCK PATCH.
	LAC (764
	DAC TRANIN	/CAL TO .TRAN IN FORWARD.
	TAD (1000
	DAC TRANOUT	/CAL TO .TRAN OUT FORWARD.
	JMS ENDLIN	/TERMINATE THE LINE.
	JMP NUCMND	/GET NEW COMMAND.
 
/SINGLE BLOCK SELECT COMMAND. B OR B+ INDICATE THAT THE BLOCK IS WRITTEN
/FORWARD; B- INDICATES THAT THE BLOCK IS WRITTEN IN REVERSE.
 
BLOCK	JMS OCTAL.	/RETURN NUMBER IN OCTNUM.
	JMP ILLCMD	/RETURN HERE IF VALUE IS NULL.
	LAC OCTNUM
	SPA
	JMP BADBLK	/BLKNUM<0 IS ILLEGAL.
	TAD (-1102
	SMA
	JMP BADBLK	/BLKNUM>1101 IS ILLEGAL.
	LAC STBLOK
	AND (2000		/SAVE DIRECTION BIT.
	TAD (764
	DAC TRANIN	/.TRAN IN (FWD OR REV).
	TAD (1000
	DAC TRANOUT	/.TRAN OUT (FWD OR REV).
	LAC OCTNUM
	DAC STBLOK	/BLOCK #.
	JMP NUCMND	/GET NEXT COMMAND.
 
	.EJECT
/EXIT ACTION: PRINT CARRIAGE RETURN LINE FEED AND THEN EXIT
/TO THE MONITOR.
 
EX.IT	CAL 775		/.CLOSE -3 TO PRINT CAR. RET.
	6		/LINE FEED ON THE TTY.
 
	CAL		/.EXIT TO THE MONITOR.
	15
 
/L ACTION: LIST LOCATION AND CONTENTS AND OPEN THE REGISTER
/FOR MODIFICATION.
 
LIST.	LAC SYSNAM	/CHECK THAT A SYSTEM PROGRAM HAS
	SNA		/BEEN SELECTED.
	JMP ILLCMD	/NO. ILLEGAL COMMAND.
	JMS OCTAL.	/RETURNS ADDRESS IN OCTNUM.
	JMP ILLCMD	/RETURNS HERE IF NO NUMBER FOUND
			/BEFORE THE LINE TERMINATOR. ILLEGAL.
	LAC OCTNUM
DACADR	DAC ADRESS	/ADDRESS TO BE LISTED.
 

/INSURE THAT THE ADDRESS IS WITHIN THE RANGE OF THE PROGRAM.
/THEN DO WHAT IS NECESSARY TO GET THAT LOCATION INTO CORE.
 
TSTADR	JMS TEST		/CHECK IF ADDRESS IS VALID; COMPUTE
			/BLOCK# AND RELATIVE ADDRESS WITHIN
			/THE BLOCK. RETURN BLOCK # IN THE AC.
	SAD CURBLK	/IS THIS BLOCK ALREADY IN CORE?
	JMP LISTIT	/YES.
	JMS OUTPUT	/NO. OUTPUT OLD BLOCK, IF NECESSARY.
	JMS NUBLOK	/SET AND TRAN IN NEW BLOCK.
	JMS PRTGTH	/PRINT '>'.
	JMP PRTADR
 
/LIST ADDRESS AND CONTENTS. WAIT FOR REPLY.
 
LISTIT	CAL 2775		/.WRITE IOPS ASCII ON TTY.
	11
ADR6	MSG7		/A SPACE.
ADRESS	0		/CORE ADDRESS TO BE LISTED.
 
PRTADR	LAC ADRESS	/PRINT THE ADDRESS AS
	STL		/A 5-DIGIT OCTAL # FOLLOWED
	JMS PRTOCT	/BY A SLASH.
	LAC ADR19		/(BUFFER
	TAD BLKADR	/COMPUTE ADDRESS RELATIVE TO THE 1ST
	DAC PICKUP	/LOCATION OF THE BLOCK IN CORE.
	LAC* PICKUP	/GET ITS CONTENTS.
	CLL		/PRINT CONTENTS AS
	JMS PRTOCT	/A 6-DIGIT OCTAL #.
	JMS TTYIN		/PRINT '>'; THEN READ IN USER'S REPLY
			/AND SETUP GET POINTER AND COUNTER.
 
	.EJECT
/PROCESS COMMAND STRING TO DETERMINE WHETHER OR NOT TO MODIFY THE CONTENTS
/OF THE OPEN REGISTER AND WHAT REGISTER TO LIST NEXT: (1) OPTIONAL EXPRESSION
/FOLLOWED BY (2) OPTIONAL _ OR / FOLLOWED BY (3) OPTIONAL COMMENT AND
/TERMINATED BY (4) CAR. RET. OR ALT MODE. THE EXPRESSION IS PROCESSED LEFT
/TO RIGHT. THE INITIAL VALUE IS ZERO AND THE INITIAL OPERATOR IS +. WHENEVER
/A STRING OF OPERATORS IS SEEN, ONLY THE LAST IS USED. INITIAL OPERATORS
/ARE LEGAL. TRAILING OPERATORS ARE LEGAL BUT ARE IGNORED. (!) IS INCLUSIVE
/OR. (-) IS 2'S COMP. SUBTRACTION. (SPACE)(+)(HORIZ. TAB)(*) ARE ALL
/2'S COMP. ADD. (*) IS SPECIAL: WHEN IT IS ENCOUNTERED, 20000 IS XORED
/INTO THE ACCUMULATED VALUE OF THE EXPRESSION AND A FLAG IS SET INDICATING
/THAT THE OPEN REGISTER IS TO BE MODIFIED (ALSO SET BY NUMBERS AND
/SYMBOLS). NUMBERS ARE OCTAL WITH FROM 1 TO 6 DIGITS. SYMBOLS ARE ALPHA-
/NUMERIC WITH FROM 1 TO 3 CHARACTERS, THE 1ST NOT BEING AN OCTAL DIGIT.
/SYMBOL VALUES ARE LOOKED UP IN THE SYMBOL TABLE OF INSTRUCTION MNEMONICS.
/"LAW" IS A SPECIAL SYMBOL. IT IS ASSUMED THAT IT WILL BE USED ONLY IN
/EXPRESSIONS OF THE FORM: "LAW N" OR "LAW -N". IF THE EXPRESSION
/(OPTIONAL) IS TERMINATED BY / OR _ , THE REMAINDER OF THE LINE IS IGNORED.
/AFTER THE REGISTER HAS BEEN (OPTIONALLY) MODIFIED, _ OPENS THE REGISTER
/ADDRESSED BY THE CONTENTS OF THE CURRENT REGISTER. IF _ NOT THERE,
/CAR. RET. OPENS THE NEXT SEQUENTIAL REGISTER AND ALT MODE TERMINATES THE
/LISTING SEQUENCE.
 
	DZM VALFLG	/NO VALUE EXPR. YET SEEN.
	DZM LAWFLG	/SET NON-0 WHEN LAW ENCOUNTERED.
	DZM VALUE		/SET INITIAL VALUE OF 0.
SAVSPC	LAC (40		/SPACE (+) IS INITIAL OPERATOR.
SAVEOP	DAC OPER		/STORE OPERATOR.
	JMS ENDCH		/GET NEXT CHAR.; TEST FOR TERMINATOR.
	JMP SAVEOP	/SPACE.
	JMP LINEND	/CAR. RET. OR ALT MODE.
SKPCHN	SAD (55		/ -
	JMP SAVEOP
	SAD (41		/ !
	JMP SAVEOP
	SAD (52		/ *
	JMP STAR
	SAD (53		/ +
	JMP SAVEOP
	SAD (11		/HORIZ. TAB.
	JMP SAVEOP
	SAD (137		/ _
	JMP INDREC
	SAD (57		/ /
	JMP COMENT
	JMS OCTDIG	/SKIP IF NOT 0-7.
	JMP NUMBER
	JMS ALFNUM	/SKIP IF NOT A-Z 0-9.
	SKP
	JMP ILLCMD	/ILLEGAL COMMAND STRING.
 
	.EJECT
/CONVERT ALPHANUMERIC SYMBOL, UP TO 3 CHARS., TO .SIXBT .
 
	LAW -4		/SETUP >3 CHAR ERROR DETECTION COUNT.
	DAC TEMP
	LAW -3		/INIT 3-CHAR-PER-WORD COUNT.
	DAC PUTC
	LAC ADR20		/(FNAME1
	DAC PUTP		/STORAGE WORD POINTER.
	DZM FNAME1
 
LOOP3	ISZ TEMP		/IS SYMBOL > 3 CHARS.?
	SKP
	JMP ILLCMD	/YES. ILLEGAL COMMAND STRING.
	LAC LASTCH
	JMS PUT		/PUT CHAR. IN SYMBOL.
	JMS ENDCH		/GET NEXT CHAR.; TEST FOR TERMINATOR.
	JMP SEARCH	/SPACE ENDS SYMBOL.
	JMP SEARCH	/SAME FOR CAR. RET. OR ALT MODE.
	JMS ALFNUM	/SKIP IF NON-ALFAMERIC.
	JMP LOOP3
 
/THE .SIXBT SYMBOL IS IN FNAME1. LOOK UP VALUE IN SYMBOL TABLE.
 
SEARCH	LAC ADR18		/(SYMTAB
	DAC PUTP
	LAC* PUTP		/GET 1ST WORD IN SYMTAB:
	DAC PUTC		/2'S COMP. ENTRY COUNT.
 
NEXSYM	IDX PUTP		/POINT AT NEXT SYMBOL NAME.
	LAC* PUTP		/GET NAME.
	IDX PUTP		/POINT AT SYMBOL VALUE.
	SAD FNAME1	/MATCH?
	JMP FNDSYM
	ISZ PUTC		/END OF TABLE?
	JMP NEXSYM
	JMP ILLCMD	/YES. ILLEGAL COMMAND SYMBOL.
 
/FOUND SYMBOL.
 
FNDSYM	LAC* PUTP		/SAVE SYMBOL VALUE IN OCTNUM.
	DAC OCTNUM
	LAC FNAME1	/IS THIS SYMBOL "LAW"?
	SAD LAWSYM
	SET LAWFLG	/YES.
	JMP COMBIN	/COMBINE SYMBOL VALUE INTO EXPRESSION.
 
	.EJECT
/CONVERT OCTAL NUMBER, UP TO 6 DIGITS.
 
NUMBER	DZM OCTNUM	/INIT STORAGE WORD.
	LAW -7		/SETUP >6 DIGIT ERROR DETECTION COUNT.
	DAC PUTC
 
PUTDIG	JMS PUTOCT	/PUT DIGIT IN NUMBER.
	JMS ENDCH		/GET NEXT CHAR.; TEST FOR TERMINATOR.
	JMP COMBIN	/SPACE TERMINATES NUMBER.
	JMP COMBIN	/SO DOES CAR. RET. OR ALT MODE.
	JMS OCTDIG	/SKIP IF NOT AN OCTAL DIGIT.
	JMP PUTDIG
 
/COMBINE NEW VALUE INTO ACCUMULATED VALUE.
 
COMBIN	LAC OPER		/DISPATCH ON OPERATOR.
	SAD (55		/- (2'S COMP).
	JMP MINUS
	SAD (41		/! (INCLUSIVE OR).
	JMP INCLOR
	JMP GETNUM	/ALL OTHERS EQUIV TO TAD.
 
INCLOR	LAC VALUE
	XOR OCTNUM
	DAC TEMP
	LAC VALUE
	AND OCTNUM
	XOR TEMP
	JMP DACVAL
 
MINUS	LAC OCTNUM
	CMA
	TAD (1
	DAC OCTNUM
	LAC LAWFLG
	SNA
	JMP GETNUM	/"LAW" WAS NOT JUST SEEN.
	DZM LAWFLG
	LAC OCTNUM	/ASSUME EXPRESSION "LAW N" OR "LAW -N".
	JMP DACVAL
GETNUM	LAC OCTNUM
TADVAL	TAD VALUE
DACVAL	DAC VALUE
	SET VALFLG	/INDICATE VALUE EXPRESSION WAS SEEN.
 
	.EJECT
	JMS ALFNUM	/SKIP IF CHAR. FOLLOWING # NON-ALFAMERIC.
	JMP ILLCMD	/ILLEGAL COMMAND STRING.
	LAC LASTCH
	SAD (40		/SPACE?
	JMP SAVEOP
	SAD (15		/CAR. RET.?
	JMP LINEND
	SAD (175		/ALT MODE?
	JMP LINEND
	JMP SKPCHN
 
STAR	LAC BSPACE	/(20000) THE INDIRECT BIT.
	XOR VALUE
	DAC VALUE
	SET VALFLG	/INDICATE VALUE EXPRESSION SEEN.
	JMP SAVSPC	/* EQUIV TO SPACE AND +.
 
INDREC	JMS ENDLIN	/TERMINATE INPUT LINE.
	JMS CHANGE	/MODIFY OPEN REGISTER IF EXPR SEEN.
	LAC* PICKUP	/OPEN REGISTER'S CONTENTS.
	AND (17777	/MASK TO 13-BIT ADDRESS.
	JMP DACADR	/OPEN THAT REGISTER.
 
COMENT	JMS ENDLIN	/TERMINATE INPUT LINE.
LINEND	JMS CHANGE	/MODIFY OPEN REGISTER IF EXPR SEEN.
 
/CHECK LINE TERMINATOR: ALT MODE ENDS AND CARRIAGE RETURN
/CONTINUES THE SEQUENCE.
 
	LAC (15		/IS THE LINE TERMINATOR A CARRIAGE
	SAD LASTCH	/RETURN ?
	JMP NEXLOC	/YES.
OUTNUC	JMS OUTPUT	/NO, ALT MODE. WRITE OUT THE BLOCK IN
			/CORE ONTO THE SYSTEM DEVICE IF
			/THE BLOCK HAS BEEN MODIFIED.
	JMP NUCMND	/GET A NEW COMMAND.
 
NEXLOC	IDX ADRESS	/POINT TO NEXT SEQUENTIAL LOCATION.
	JMP TSTADR	/LIST AND OPEN FOR MODIFICATION.
 
/READ ACTION: READ FROM AUXILIARY DEVICE AND PATCH. IF ABS BIN
/LOADER IS ON THE TAPE, SKIP OVER IT. ERRORS TERMINATE READ.
 
READ	LAC SYSNAM	/CHECK THAT A SYSTEM PROGRAM HAS
	SNA		/BEEN SELECTED.
	JMP ILLCMD	/NO. ILLEGAL COMMAND.
 
	CAL 770		/.INIT -10, THE AUX. DEVICE, FOR
	1		/INPUT.
ADR8	BEGRET		/^P RESTART ADDRESS (JUST IN CASE).
TEMP	0
 
	.EJECT
/ CONVERT REMAINDER OF LINE TO FILENAME.
 
	DZM EXT		/0 GOES TO EXTENSION.
	JMS STRING	/CONVERT FILENAME, IF ANY, TO .SIXBT .
	JMP FSTAT		/NULL FILENAME.
	LAC COMAND	/SAVE FIRST 6 CHARS. AS FILE NAME.
	DAC FNAME1
	LAC COMAND+1
	DAC FNAME2
	LAC LASTCH
	SAD (40
	JMP EXTEN		/SPACE MEANS THERE MIGHT BE AN EXTENSION.
NULEXT	LAC (10223	/.SIXBT /ABS/
	JMP .+4		/ASSUME AN EXTENSION OF 'ABS'.
EXTEN	JMS STRING	/CONVERT EXTENSION TO .SIXBT .
	JMP NULEXT	/NULL EXTENSION.
	LAC COMAND
	DAC EXT		/SAVE FIRST 3 CHARS. AS THE EXTENSION.
	JMS ENDLIN	/TERMINATE THE INPUT LINE.
 
/ IS THE DEVICE FILE ORIENTED? IF SO, THE FILENAME HAD BETTER BE THERE.
 
FSTAT	LAC ADR20		/(FNAME1 ; DIRECTORY POINTER.
	DAC DVCTYP
 
	CAL 3770		/.FSTAT -10 ON FNAME1.
	2
DVCTYP	XX		/DEVICE TYPE BITS RETURNED IN 0-2.
 
VALFLG=.-1		/USED IN LIST COMMAND.
 
	SZA!CLL		/AC=0 IF FILE NOT FOUND.
	STL
	LAC DVCTYP	/GET CODE BITS FOR DEVICE TYPE.
	AND IOTSYM	/(700000
	SNA
	JMP NONFOD	/NON-FILE-ORIENTED DEVICE.
	SNL
	JMP FNF		/ERROR. FILE NOT FOUND.
 
	CAL 770		/.SEEK THE FILE ON -10.
	3
ADR20	FNAME1		/POINTER TO FILE DIRECTORY ENTRY BLOCK.
 
	DZM CMDBUF
	DZM CMDBUF+1	/PROTECT AGAINST EOM ON PTR.
 
NONFOD	CAL 4770		/.READ -10 IN DUMP MODE.
	10
ADR9	CMDBUF
	-2		/2 WORDS; NO HEADER.
 
	.EJECT

	CAL 770		/.WAIT ON -10 FOR READIN.
	12
 
	LAC CMDBUF	/1ST WORD READ IN.
	SMA
	JMP NOLOAD	/NOT THE ABS BIN LOADER.
 
/SINCE THE 1ST WORD ON THE TAPE IS NEGATIVE, ASSUME IT'S
/THE BEGINNING OF THE ABS BIN LOADER. WILL BE ON PAPER TAPE, ONLY.
 
LDLOOP	CAL 3770		/.READ IMAGE ALPHA FROM -10.
	10
ADR10	CMDBUF
	-3		/1 LINE + 2 WORD HEADER.
 
	CAL 770		/.WAIT ON -10 FOR READIN.
	12
 
	LAC CMDBUF+2	/IF 7-HOLE PUNCH IS ON THIS
	AND (100		/PAPER TAPE LINE, IT'S THE END OF
	SNA		/THE ABS BIN LOADER.
	JMP LDLOOP
 
/THIS IS THE RESTART LOCATION OF THE READ LOOP. READ IN
/FIRST 2 WORDS OF ABS BLOCK HEADER.
 
READLP	DZM CMDBUF+1	/PROTECT AGAINST EOM ON PTR.
 
	CAL 4770		/.READ DUMP MODE FROM -10.
	10
ADR11	CMDBUF
	-2		/2 WORDS; NO HEADER.
 
	CAL 770		/.WAIT ON -10 FOR READIN.
	12
 
	LAC CMDBUF	/1ST WORD READ IN.
	SMA
	JMP NOLOAD	/NOT A START BLOCK.
 
/START BLOCK HAS BEEN DETECTED. TERMINATE READ COMMAND.
 
	CAL 770		/.CLOSE -10.
	6
 
	JMP OUTNUC
 
	.EJECT

/ABS BLOCK HEADER WORDS 1 AND 2 HAVE BEEN READ IN.
 
NOLOAD	DAC ADRESS	/SAVE 1ST LOCATION TO MODIFY.
	LAC CMDBUF+1	/WORD 2 IS BLOCK BODY COUNT (-).
	SMA
	JMP SUMERR	/TREAT WORD COUNT ERROR AS CHECKSUM ERROR.
	TAD (31		/MAX. # OF WORDS IN BLOCK BODY.
	SPA
	JMP SUMERR	/WORD COUNT TOO LARGE. GIVE CHECKSUM ERROR.
	TAD (-32
	DAC BODYCT	/SAVE WORD COUNT +1 (INCLUDES CHECKSUM WORD).
	DAC GETC
	LAC ADR13		/(CMDBUF
	DAC TEMP		/SETUP POINTERS TO FIRST DATA WORD.
	DAC GETP
	IDX GETP
	LAC CMDBUF	/START PARTIAL CHECKSUM.
	TAD CMDBUF+1
	DAC CHKSUM
 
	DZM CMDBUF+1	/PROTECT AGAINST EOM ON PTR.
 
	CAL 4770		/.READ DUMP MODE FROM -10.
	10
ADR13	CMDBUF
BODYCT	XX		/2'S COMPL. OF # OF WORDS TO READ.
 
VALUE=.-1			/USED IN LIST COMMAND.
 
	CAL 770		/.WAIT ON -10 FOR READIN.
	12
 
/FINISH COMPUTING CHECKSUM ON ABS BIN BLOCK.
 
CKSMLP	LAC* TEMP		/PICKUP NEXT BLOCK WORD.
	TAD CHKSUM
	DAC CHKSUM	/ADD INTO CHECKSUM.
	IDX TEMP
	ISZ BODYCT	/SKIP WHEN DONE.
	JMP CKSMLP
	SZA		/CHECKSUM MUST BE ZERO.
	JMP SUMERR	/CHECKSUM ERROR.
 
	.EJECT

/CHECK IF ANY WORDS REMAIN IN READER BUFFER. IF SO,
/TEST VALIDITY OF PRESENT ADDRESS. THEN BRING IN THE 
/APPROPRIATE BLOCK INTO CORE AND TRANSFER THE NEXT
/BUFFER WORD TO IT.
 
ANYMOR	ISZ GETC		/READER BUFFER EMPTY?
	SKP
	JMP READLP	/YES, GO FILL IT UP.
	LAC* GETP		/GET NEXT BUFFER WORD, THE NEW
	DAC OCTNUM	/CONTENTS FOR THE GIVEN ADDRESS.
	IDX GETP
	JMS TEST		/TEST VALIDITY OF THE ADDRESS. RETURN
			/WITH THE BLOCK # IN THE AC.
	SAD CURBLK	/SKIP IF THAT BLOCK IS NOT IN CORE.
	JMP .+3
	JMS OUTPUT	/WRITE OUT THE OLD BLOCK, IF NECESSARY.
	JMS NUBLOK	/SET AND READ IN THE NEW BLOCK.
 
	LAC (DAC BUFFER
	TAD BLKADR	/COMPUTE ADDRESS RELATIVE TO FIRST
	DAC .+2		/LOCATION OF THE BLOCK IN CORE.
	LAC OCTNUM
	XX		/STORE NEW CONTENTS.
 
LAWFLG=.-1		/USED IN LIST COMMAND.
 
	LAW -1		/SET FLAG TO INDICATE THAT THE BLOCK
	DAC BLKOUT	/IN CORE HAS BEEN MODIFIED.
	IDX ADRESS	/UPDATE ADDRESS BY 1.
	JMP ANYMOR	/GET NEXT WORD.
 
	.EJECT
/SUBROUTINE OCTDIG: SKIP ON RETURN IF LASTCH IS NOT AN OCTAL DIGIT.
 
OCTDIG	0
 
	LAW -60
	TAD LASTCH
	SPA
	JMP .+3
	TAD GETS		/(-10
	SMA
	IDX OCTDIG	/NOT OCTAL.
	JMP* OCTDIG
 
/SUBROUTINE ALFNUM: SKIP ON RETURN IF LASTCH IS NOT ALPHANUMERIC.
 
ALFNUM	0
 
	JMS OCTDIG	/SKIP IF NOT AN OCTAL DIGIT.
	JMP* ALFNUM
	SZA		/SKIP IF 8.
	SAD (1		/SKIP IF NOT 9.
	JMP* ALFNUM
	TAD (-11		/-101 SO FAR.
	SPA
	JMP .+3
	TAD (-32
	SMA
	IDX ALFNUM	/NOT ALPHANUMERIC.
	JMP* ALFNUM
 
/SUBROUTINE CHANGE: IF VALFLG NON-0, CHANGE CONTENTS OF OPEN REGISTER.
 
CHANGE	0
 
	LAC VALFLG
	SNA
	JMP* CHANGE
	LAC VALUE		/VALUE OF USER-TYPED EXPRESSION.
	DAC* PICKUP	/STORE IN CURRENT REGISTER.
	LAW -1		/SET FLAG TO INDICATE THAT THE BLOCK
	DAC BLKOUT	/IN CORE HAS BEEN MODIFIED.
	JMP* CHANGE
 
	.EJECT
/ SUBROUTINE STRING: UNPACK CHARACTERS FROM THE COMMAND INPUT BUFFER
/ AND CONVERT THEM TO .SIXBT STORED IN REGISTERS COMAND TO COMAND+2.
/ STRING TERMINATORS ARE SPACE, CAR. RET. AND ALT MODE.
 
STRING	0
 
	LAC ADR4		/(COMAND
	DAC PUTP		/1ST LOC. TO STORE IN.
	LAW -3
	DAC PUTC		/INITIAL BYTE COUNT.
	DZM COMAND	/0 REGISTERS WHERE STRING WILL BE STORED
	DZM COMAND+1	/IN .SIXBT .
	DZM COMAND+2
	LAW -12		/SET COUNT USED TO CHECK IF
	DAC MAXCNT	/STRING IS > 9 CHARS.
	LAC LASTCH
	SAD (40
 
GETNXT	JMS ENDCH		/GET NEXT CHAR.; TEST FOR TERMINATOR.
	JMP ENDSTR	/SPACE.
	JMP ENDSTR	/CAR. RET. OR ALT MODE.
			/OTHER.
	ISZ MAXCNT	/SKIP IF > 9 CHARS.
	SKP
	JMP ILLCMD	/ILLEGAL COMMAND.
 
	JMS PUT		/PACK CHAR. IN .SIXBT .
	JMP GETNXT
 
ENDSTR	LAW -3		/FILL IN THE LAST WORD WITH 0'S IF
	SAD PUTC		/WORD IS PARTIALLY FULL, I.E.,
	JMP .+4		/LEFT JUSTIFY.
	CLA
	JMS PUT
	JMP ENDSTR
 
	LAW -12		/IS THE STRING EMPTY?
	SAD MAXCNT
	JMP .+3		/YES.
	IDX STRING
	JMP* STRING
	LAC (40		/IS LAST CHAR. A SPACE?
	SAD LASTCH
	JMP STRING+1	/YES. TRY AGAIN.
	JMP* STRING
 
	.EJECT

/SUBROUTINE OCTAL.: CONVERT NUMBER FROM 5/7 ASCII, IN COMMAND
/INPUT BUFFER, INTO AN OCTAL NUMBER AND STORE IT IN OCTNUM. IGNORE
/LEADING AND TRAILING SPACES.  PRINT CARRIAGE RETURN LINE FEED IF
/LINE IS TERMINATED BY ALT MODE. SKIP ON RETURN IF NUMBER IS 
/NON-EMPTY.
 
OCTAL.	0
	DZM OCTNUM
	LAW -7
	DAC PUTC		/COUNT SET FOR 6 DIGITS MAXIMUM.
	LAC LASTCH	/IF LASTCH IS NOT SPACE, THERE'S NO
	SAD (40		/NUMBER AT ALL.
	SKP
	JMP* OCTAL.
	JMS ENDCH		/GET NEXT CHAR.; TEST FOR TERMINATOR.
	JMP .-1		/IGNORE LEADING SPACES.
	JMP* OCTAL.	/CAR. RET. OR ALTMODE - NO NUMBER.
	IDX OCTAL.
NEXDIG	JMS PUTOCT
	JMS ENDCH		/GET NEXT CHAR.; TEST FOR TERMINATOR.
	JMS ENDLIN	/SPACE. IGNORE REMAINDER OF LINE.
	JMP* OCTAL.	/CAR. RET. OR ALTMODE.
	JMP NEXDIG
 
/SUBROUTINE PUTOCT: TEST THAT THE CHAR. IS AN OCTAL DIGIT AND THAT THE
/NUMBER IS <7 DIGITS LONG. PUT DIGIT IN NUMBER.
 
PUTOCT	0
 
	JMS OCTDIG	/SKIP IF NOT OCTAL.
	SKP
	JMP NOTOCT	/ERROR.
	ISZ PUTC		/SKIP IF TOO MANY DIGITS.
	SKP
	JMP TOOBIG	/ERROR.
	LAW -60
	TAD LASTCH	/GET DIGIT.
	DAC DIGIT
	LAC OCTNUM
	RCL		/MAKE ROOM FOR NEW DIGIT.
	RTL
	XOR DIGIT
	DAC OCTNUM
	JMP* PUTOCT
 
	.EJECT
/SUBROUTINE PRTOCT: CONVERT THE OCTAL NUMBER IN THE AC TO
/ASCII. IF LINK IS SET, PRINT 5-DIGIT ADDRESS.
 
PRTOCT	0
	DAC OCTNUM	/SAVE NUMBER.
	LAW -1
	DAC PUTC		/LOOP COUNT FOR 6 DIGITS.
	LAC (57		/(/) STORED AS 6TH CHAR IN CASE 5 DIGIT
	DAC DIG6		/ADDRESS IS TO BE PRINTED.
	LAC (DAC DIGIT
	DAC DACDIG
 
PRTLP	LAC OCTNUM	/PRINT LOOP.
	RCL
	RTL
	DAC OCTNUM	/SAVE REMAINING DIGITS.
	RAL		/NEXT DIGIT IN POSITION.
	AND (7		/MASK IT.
	TAD (60		/CONVERT TO ASCII.
DACDIG	XX		/STORE DIGIT IN PRINT BUFFER.
	ISZ PUTC		/SKIP IF ON 1ST DIGIT.
	JMP .+4
	LAC PRTOCT	/IF LINK WAS SET ON ENTRY,
	SPA		/MEANING PRINT 5-DIGIT ADDRESS,
	JMP PRTLP		/IGNORE 1ST DIGIT.
	IDX DACDIG
	LAC PUTC
	SAD (5
	SKP		/DONE.
	JMP PRTLP
 
	CAL 3775		/.WRITE IMAGE ALPHA ON TELETYPE.
	11
ADR15	IMAGE		/ADDRESS OF BUFFER.
	-7
 
	CAL 775		/.WAIT ON -3 FOR OUTPUT COMPLETION.
	12
 
	JMP* PRTOCT
 
IMAGE	4000		/WORD PAIR COUNT.
	0
DIGIT	0
	0
	0
	0
	0
DIG6	0
 
	.EJECT

/SUBROUTINE GET: INITIALIZE BY SETTING GETC TO -1 AND GETP
/TO ADDRESS OF FIRST BUFFER WORD. GET PICKS UP A 5/7 ASCII WORD
/PAIR AND, EACH TIME CALLED, RETURNS NEXT CHAR. IN THE AC.
 
GET	0
	ISZ GETC		/SKIP IF WORD PAIR EXHAUSTED.
	JMP GETS		/NO, GET NEXT CHAR.
	LAC* GETP		/PICKUP NEXT WORD PAIR.
	IDX GETP
	DAC GET1		/WORD 1.
	LAC* GETP
	IDX GETP
	DAC GET2		/WORD 2.
	LAW -5
	DAC GETC		/RESET BYTE COUNT TO 5.
 
GETS	LAW -10		/SETUP SHIFT COUNT TO ROTATE WORDS 1
	DAC GETR		/AND 2 COMBINED 7+1/2 TIMES.
 
GETL	LAC GET2		/SHIFT LOOP.
	RAL
	ISZ GETR		/SKIP IF CHAR. IN POSITION.
	JMP .+3
	AND (177
	JMP* GET		/RETURN CHAR. IN THE AC.
 
	DAC GET2
	LAC GET1
	RAL
	DAC GET1
	JMP GETL		/CONTINUE SHIFT LOOP.
 
	.EJECT
/SUBROUTINE PUT: THE ASCII CHAR. IN THE AC IS TRIMMED TO
/.SIXBT AND PACKED IN WORDS OF 3 CHARS. EACH. INITIALIZE
/BY SETTING PUTC TO -3, PUTP TO THE ADDRESS OF THE FIRST
/STORAGE WORD, AND ALL STORAGE WORDS TO ZERO.
 
PUT	0
	AND (77		/CHANGE TO .SIXBT.
	XOR* PUTP		/ADD IN OTHER CHARS.
	ISZ PUTC		/SKIP IF WORD NOW FULL.
	JMP SHIFT
	DAC* PUTP		/STORE WORD WITHOUT SHIFTING.
	IDX PUTP		/POINT TO NEXT WORD.
	LAW -3		/RESET BYTE COUNT TO 3.
	DAC PUTC
	JMP* PUT
 
SHIFT	RCL		/SHIFT LEFT 6 TO MAKE ROOM FOR
	RTL		/NEXT CHAR.
	RTL
	RAL
	DAC* PUTP		/SAVE IT.
	JMP* PUT
 
/SUBROUTINE ENDCH: GET AND DISPATCH ON END
/OF LINE CHARACTER.
 
ENDCH	0
	JMS GET		/GET NEXT CHAR. FROM CMDBUF.
	DAC LASTCH	/SAVE LAST CHARACTER.
	SAD (40		/SPACE?
	JMP* ENDCH
	IDX ENDCH
	SAD (15		/CAR. RET.?
	JMP* ENDCH
	SAD (175		/ALT MODE?
	JMP ALT.
	IDX ENDCH		/OTHER.
	JMP* ENDCH
 
ALT.	CAL 775		/.CLOSE -3 TO PRINT CAR. RET.
	6		/LINE FEED ON THE TTY.
 
	LAC LASTCH
	JMP* ENDCH
 
	.EJECT

/SUBROUTINE TEST:  CHECK VALIDITY OF THE ADDRESS.  THEN CALCULATE
/THE BLOCK# (RETURNED IN THE AC) AND THE ADDRESS RELATIVE TO THE
/BEGINNING OF THE BLOCK.
 
TEST	0
	LAC ADRESS
	CMA
	TAD (1
	TAD LOCAT		/PROGRAM'S LOAD ADDRESS -1.
	SMA!CMA
	JMP RANGER	/INVALID ADDRESS.
	TAD SIZE		/2'S COMPLEMENT OF PROGRAM'S SIZE.
	SMA
	JMP RANGER
	LAC LOCAT		/CALCULATE ADDRESS RELATIVE TO
	CMA		/LOAD ADDRESS.
	TAD ADRESS
	DAC TEMP
	AND (377		/CALCULATE ADDRESS RELATIVE TO THE
	DAC BLKADR	/BEGINNING OF THE BLOCK.
	XOR TEMP
	RCR		/CALCULATE RELATIVE BLOCK #.
	RTR
	RTR
	RTR
	RAR
	TAD STBLOK	/STARTING BLOCK# ON SYSTEM DEVICE.
	DAC BLKNUM	/ABSOLUTE BLOCK#.
	JMP* TEST
 
/SUBROUTINE PRTGTH: PRINT '>' ON THE TELETYPE.
 
PRTGTH	0
	CAL 2775		/.WRITE IOPS ASCII ON TTY.
	11
ADR14	MSG2		/ADDRESS OF '>'.
BLKADR	0		/ADDRESS RELATIVE TO THE BEGINNING
			/OF THE CURRENT BLOCK.
	JMP* PRTGTH	/RETURN WITHOUT WAITING.
 
 
	.EJECT

/SUBROUTINE ENDLIN:  READ INPUT LINE UP TO THE CAR.RET. OR
/ALTMODE.  IF ALTMODE, PRINT CAR.RET. LINE FEED.
 
ENDLIN	0
	LAC LASTCH	/LAST CHARACTER.
	SAD (15		/CAR. RET.?
	JMP* ENDLIN
	SAD (175		/ALT MODE?
	JMP* ENDLIN	/LINE ALREADY TERMINATED.
	JMS ENDCH		/GET NEXT CHAR.; TEST FOR TERMINATOR.
	JMP .-1		/IGNORE SPACES.
	JMP* ENDLIN	/CAR. RET.OR ALT MODE.
	JMP .-3		/IGNORE ALL OTHER CHARACTERS.
 
/SUBROUTINE NUBLOK:  SET CURRENT BLOCK FROM NEW BLOCK #
/AND .TRAN IN THE NEW BLOCK.
 
NUBLOK	0
	LAC BLKNUM
	DAC CURBLK
 
TRANIN	XX		/.TRAN IN FROM -14 (FWD OR REV), THE
	13		/SYSTEM DEVICE HANDLER.
CURBLK	-1		/# OF THE CURRENT BLOCK.
ADR19	BUFFER
	-400
 
	CAL 764		/.WAIT ON -14 TO COMPLETE INPUT.
	12
 
	JMP* NUBLOK
 
	.EJECT

/SUBROUTINE  OUTPUT:  .TRAN OUT THE CURRENT BLOCK IN CORE
/IF THE FLAG INDICATES IT IS NECESSARY. THEN TURN OFF THE FLAG.
 
OUTPUT	0
	LAC BLKOUT
	SNA		/SKIP IF CURRENT BLOCK WAS MODIFIED.
	JMP* OUTPUT
	LAC CURBLK
	DAC .+3		/SET UP BLOCK #.
 
TRANOUT	XX		/.TRAN OUT TO -14 (FWD OR REV).
	13
	XX		/BLOCK #.
ADR16	BUFFER
	-400
 
	CAL 764		/.WAIT ON -14 TO COMPLETE OUTPUT.
	12
 
	DZM BLKOUT	/CLEAR OUTPUT-NECESSARY FLAG.
	JMP* OUTPUT
 
/SUBROUTINE TTYIN:  PRINT '>', READ IN USER-TYPED LINE INTO THE
/COMMAND BUFFER, AND SETUP POINTER AND COUNTER.
 
TTYIN	0
	JMS PRTGTH	/PRINT '>'.
 
	CAL 2776		/.READ IOPS ASCII FROM -2, THE TTY
	10		/OR BATCH DEVICE, INTO COMMAND BUFFER.
ADR17	CMDBUF
	-44
 
	CAL 776		/.WAIT ON -2 TO COMPLETE READIN.
	12
 
	LAW -1		/SETUP BYTE COUNT FOR GET SUBROUTINE.
	DAC GETC
	LAC ADR17		/(CMDBUF
	TAD (2
	DAC GETP		/SETUP POINTER TO COMMAND BUFFER.
	JMP* TTYIN
 
	.EJECT
/ERROR PRINT ROUTINE: SEARCH FOR LINE
/TERMINATOR IN ORDER TO PRINT CAR. RET. LINE FEED IF ALT MODE
/ENCOUNTERED. THEN, IF THE CURRENT BLOCK IN CORE HAS BEEN
/MODIFIED, WRITE IT OUT. THEN PRINT THE ERROR MESSAGE.
 
ERROR	DAC ERRMSG	/POINTER TO ERROR MESSAGE.
	JMS ENDLIN	/TERMINATE THE INPUT LINE.
	JMS OUTPUT	/WRITE OUT BLOCK IN CORE, IF NECESSARY.
 
	CAL 2775		/.WRITE IOPS ASCII ON TTY.
	11
ERRMSG	XX		/ADDRESS OF ERROR MESSAGE.
MAXCNT	0		/TEMP. COUNT REGISTER.
 
OPER=.-2			/USED IN LIST COMMAND.
	JMP NUCMND	/GET A NEW COMMAND.
 
/ERROR: ILLEGAL COMMAND.
 
ILLCMD	LAC ADR21		/POINTER TO 'ILLEGAL COMMAND'.
	JMP ERROR
 
/ERROR: RANGE ERROR.
 
RANGER	LAC ADR22		/POINTER TO 'ADDRESS OUT OF RANGE'.
	JMP ERROR
 
/ERROR: NOT AN OCTAL DIGIT.
 
NOTOCT	LAC ADR23		/POINTER TO 'NOT OCTAL DIGIT'.
	JMP ERROR
 
/ERROR: TOO MANY DIGITS.
 
TOOBIG	LAC ADR24		/POINTER TO  'TOO MANY DIGITS'.
	JMP ERROR
 
/ERROR: CHECKSUM ERROR OR BAD WORD COUNT IN ABS BLOCK HEADER OR EOF REACHED.
 
SUMERR	LAC ADR26		/POINTER TO 'CHECKSUM ERROR'.
	JMP ERROR
 
/ERROR: ILLEGAL BLOCK NUMBER.
 
BADBLK	LAC ADR12		/POINTER TO 'ILLEGAL BLOCK #'.
	JMP ERROR
 
/ERROR: FILE NOT FOUND.
 
FNF	LAC ADR27		/POINTER TO 'FILE NOT FOUND'.
	JMP ERROR
 
	.EJECT

/IOPS ASCII MESSAGES FOR OUTPUT TO THE TELETYPE.
 
MSG1	2000
CHKSUM	0		/TEMP. CHECKSUM REGISTER.
	.ASCII /PATCH V4A/<15>
MSG2=.-2
	.ASCII />/<175>
MSG3=.-3
	.LOC .-1
	.ASCII /ILLEGAL COMMAND/<15>
MSG4=.-3
	.LOC .-1
	.ASCII /NOT OCTAL DIGIT/<15>
MSG5=.-3
	.LOC .-1
	.ASCII /ADDRESS OUT OF RANGE/<15>
MSG7=.-3
	.LOC .-1
	.ASCII / /<175>
 
	.EJECT
MSG9=.-3
	.LOC .-1
	.ASCII /TOO MANY DIGITS/<15>
MSG11=.-3
	.LOC .-1
	.ASCII /CHECKSUM ERROR/<15>
MSG12=.-2
	.ASCII /ILLEGAL BLOCK #/<15>
MSG13=.-3
	.LOC .-1
	.ASCII /FILE NOT FOUND/<15>
 
	.EJECT
/SYMBOL TABLE USED IN LIST COMMAND. THE 1ST WORD CONTAINS THE TWOS
/COMPLEMENT COUNT OF THE # OF TABLE ENTRIES. EACH ENTRY IS 2 WORDS:
/(1) .SIXBT SYMBOL MNEMONIC; (2) SYMBOL VALUE.
 
SYMTAB	SYMSIZ/2\777777+1	/2'S COMP. ENTRY COUNT.
	.SIXBT /ADD/
	300000
	.SIXBT /AND/
	500000
	.SIXBT /CAL/
	0
	.SIXBT /CCL/
	744002
	.SIXBT /CLA/
	750000
	.SIXBT /CLC/
	750001
	.SIXBT /CLL/
	744000
	.SIXBT /CMA/
	740001
	.SIXBT /CML/
	740002
	.SIXBT /DAC/
	40000
	.SIXBT /DZM/
	140000
	.SIXBT /EAE/
	640000
	.SIXBT /GLK/
	750010
	.SIXBT /HLT/
	740040
	.SIXBT /IOT/
IOTSYM	700000
	.SIXBT /ISZ/
	440000
	.SIXBT /JMP/
	600000
	.SIXBT /JMS/
	100000
	.SIXBT /LAC/
	200000
	.SIXBT /LAS/
	750004
	.SIXBT /LAT/
	750004
LAWSYM	.SIXBT /LAW/
	760000
	.SIXBT /NOP/
	740000
	.SIXBT /OAS/
	740004
 
	.EJECT
	.SIXBT /OPR/
	740000
	.SIXBT /RAL/
	740010
	.SIXBT /RAR/
	740020
	.SIXBT /RCL/
	744010
	.SIXBT /RCR/
	744020
	.SIXBT /RTL/
	742010
	.SIXBT /RTR/
	742020
	.SIXBT /SAD/
	540000
	.SIXBT /SKP/
	741000
	.SIXBT /SMA/
	740100
	.SIXBT /SML/
	740400
	.SIXBT /SNA/
	741200
	.SIXBT /SNL/
	740400
	.SIXBT /SPA/
	741100
	.SIXBT /SPL/
	741400
	.SIXBT /STL/
	744002
	.SIXBT /SZA/
	740200
	.SIXBT /SZL/
	741400
	.SIXBT /TAD/
	340000
	.SIXBT /XCT/
	400000
	.SIXBT /XOR/
	240000
	.SIXBT /XX@/
	740040
 
SYMSIZ=.-SYMTAB-1
 
	.EJECT
/COMMAND TABLE: 5 WORDS PER ENTRY. FIRST 2 WORDS ARE .SIXBT
/FOR THE COMMAND (SYSTEM NAME OR AN ACTION). IF A NAME,
/THE LAST 3 WORDS ARE: FIRST BLOCK# ON THE SYSTEM DEVICE, LOAD
/ADDRESS -1, AND THE  2'S COMPLEMENT OF THE (ALLOWED) PROGRAM SIZE. IF AN 
/ACTION, WORD 3 IS A JMP TO THE APPROPRIATE ROUTINE. WORDS 4 AND
/5 ARE USED AS VARIABLE REGISTERS.
 
COMTAB=.			/COMMAND TABLE.
 
KM9.	.SIXBT /KM9/
	0
	0
	77
	761000
 
SYSLD.	.SIXBT /.SYSLD/
	56
	13377
	773542
 
UPDTE.	.SIXBT /UPDATE/
	45
	13777
	774142
 
DUMP.	.SIXBT /DUMP/
	1044
	15777
	776142
 
EXEC.	.SIXBT /EXECUT/
	67
	17077
	777242
 
EDIT.	.SIXBT /EDIT/
	657
	12777
	773142
 
	.EJECT
PIP.	.SIXBT /PIP/
	0
	671
	7737
	770102
 
F4.	.SIXBT /F4/
	0
	711
	3602
	763745
 
MACRO.	.SIXBT /MACRO/
	742
	4552
	764714
 
F4A.	.SIXBT /F4A/
	0
	771
	5017
	765162
 
MACA.	.SIXBT /MACROA/
	1020
	6332
	766474
 
CONV.	.SIXBT /CONV/
	1064
	11777
	772142
 
SGEN1.	.SIXBT /.SGEN1/
	1050
	11777
	772142
 
	.EJECT
SGEN2.	.SIXBT /.SGEN2/
	36
	14777
	775142
 
PATCH.	.SIXBT /PATCH/
	652
	15235
	775400
 
/FOR B, B+ AND B-, THE 3RD WORD IS THE .TRAN FORWARD OR BACKWORD BIT.
/ALSO, BIT 1 IS SET TO DISTINGUISH SINGLE BLOCK MODE FROM SYSTEM PROGRAM
/NAMES.
 
BSPACE	.SIXBT /B/
	0
	200000
	-1
	-400
 
BPLUS	.SIXBT /B+/
	0
	200000
	-1
	-400
 
BMINUS	.SIXBT /B-/
	0
	202000
	-1
	-400
 
L.	.SIXBT /L/
	0
	JMP LIST.
GETC	0		/COUNTER FOR GETTING INPUT CHARS.
GETP	0		/POINTER INTO COMMAND INPUT BUFFER.
 
	.EJECT
R.	.SIXBT /READ/
	JMP READ
GET1	0		/WORD1 OF WORD PAIR FROM INPUT BUFFER.
GET2	0		/WORD2 OF WORD PAIR FROM INPUT BUFFER.
 
X.	.SIXBT /EXIT/
	JMP EX.IT
GETR	0		/TEMP. SHIFT COUNTER.
OCTNUM	0		/TEMP. NUMBER ACCUMULATOR.
 
COMEND=.			/END OF COMMAND TABLE.
 
/DATA REGISTERS AND 15-BIT ADDRESS LITERALS.
 
LOCAT	0		/SYSTEM PROGRAM LOAD ADDRESS-1.
SIZE	0		/SYSTEM PROGRAM 2'S COMPLEMENT SIZE.
STBLOK	0		/SYSTEM PROGRAM FIRST BLOCK #.
BLKNUM	0		/BLOCK # ON SYSTEM DEVICE IN WHICH
			/THE SELECTED ADDRESS IS LOCATED.
BLKOUT	0		/IF NON-ZERO.INDICATES THAT THE
			/CURRENT BLOCK IN CORE HAS BEEN MODIFIED.
PUTC	0		/BYTE COUNTER.
PUTP	0		/WORD POINTER.
PICKUP	0		/POINTER TO LOCATION IN BLOCK IN CORE.
LASTCH	0		/LAST CHARACTER EXAMINED
			/FROM COMMAND INPUT BUFFER.
COMAND	0		/3 REGISTERS:COMMAND CONVERTED TO
	0		/.SIXBT AND SAVED HERE TO MATCH
	0		/WITH ENTRIES IN COMMAND TABLE.
FNAME1	0		/FILE DIRECTORY ENTRY BLOCK FOR READ COMMAND.
FNAME2	0
EXT	0
 
ADR4	COMAND		/THE FOLLOWING ARE 15-BIT ADDRESS
ADR5	COMTAB		/LITERALS.
ADR12	MSG12
ADR18	SYMTAB
ADR21	MSG3
ADR22	MSG5
ADR23	MSG4
ADR24	MSG9
ADR26	MSG11
ADR27	MSG13
 
	.EJECT

/BUFFERS: THIS AREA CONTAINS THE SYSTEM DEVICE BLOCK BUFFER
/AND THE COMMAND INPUT BUFFER (ALSO USED AS A PAPER TAPE
/READER BUFFER). THE ONE-TIME-ONLY BANK BIT INITIALIZATION
/ROUTINE IS IN FIRST BUFFER.
 
BUFFER=.			/SYSTEM DEVICE BLOCK BUFFER.
 
INBANK	LAC* (.SCOM	/BANK BIT INIT. ROUTINE.
	AND LIT60K	/(60000
	DAC TEMP		/BANK BITS.
	LAC ADR1
	XOR TEMP
	DAC ADR1
	DAC ADR2
	DAC ADR8
	LAC ADR3
	XOR TEMP
	DAC ADR3
	LAC ADR4
	XOR TEMP
	DAC ADR4
	LAC ADR5
	XOR TEMP
	DAC ADR5
	LAC ADR6
	XOR TEMP
	DAC ADR6
	LAC ADR9
	XOR TEMP
	DAC ADR9
	DAC ADR10
	DAC ADR11
	DAC ADR13
	DAC ADR17
	LAC ADR12
	XOR TEMP
	DAC ADR12
	LAC ADR14
	XOR TEMP
	DAC ADR14
 
	.EJECT

	LAC ADR15
	XOR TEMP
	DAC ADR15
	LAC ADR16
	XOR TEMP
	DAC ADR16
	DAC ADR19
	LAC ADR18
	XOR TEMP
	DAC ADR18
	LAC ADR20
	XOR TEMP
	DAC ADR20
	LAC ADR21
	XOR TEMP
	DAC ADR21
	LAC ADR22
	XOR TEMP
	DAC ADR22
	LAC ADR23
	XOR TEMP
	DAC ADR23
	LAC ADR24
	XOR TEMP
	DAC ADR24
	LAC ADR26
	XOR TEMP
	DAC ADR26
	LAC ADR27
	XOR TEMP
	DAC ADR27
	JMP BEGRET	/END OF BANK BIT INITIALIZATION.
LIT60K	60000
 
	.BLOCK .-BUFFER\777777+1+400
 
/THE .BLOCK PSEUDO-OP ABOVE RESERVES SOME MORE SPACE SO THAT
/THE BUFFER IS 400 OCTAL WORDS LONG.
 
CMDBUF	.BLOCK 44		/COMMAND BUFFER AND PAPER TAPE
			/READER BUFFER. SIZE BASED ON
			/CARD READER MAX. LINE BUFFER SIZE.
 
	.END
