/ BINARY LOADER UTILITY FOR P?S/8
XLIST OFF
IFNDEF OFF
ON= 0
XLIST ON
/ LAST EDIT: 17-DEC-1986 23:00:00 CJL
/ MAY BE ASSEMBLED WITH '/J' SWITCH SET.
/ THIS ASSEMBLY COVERS THE "START", "BIN", AND "GET" SYSTEM PROGRAMS.
/ ALL THREE SYSTEM PROGRAMS SHARE ONE CORE IMAGE AND ARE ACTUALLY
/ DIFFERENT ENTRY POINTS INTO A COMMON PROGRAM. SEVERAL INTERNAL
/ SUBROUTINES ARE COMMON TO ALL PROGRAMS. THE BIN PROGRAM IS THE BASIS FOR
/ THE OTHER TWO PROGRAMS AS "GET" IS MERELY A SHORTHAND ALTERNATIVE TO
/ USING "BIN", AND "START" IS AN ALTERNATIVE TO SELF START FROM EITHER
/ "BIN" OR "GET".
/ START SYSTEM DESCRIPTION.
/ START LOADS THE FIELD ZERO SCRATCH AREA (BLOCK 0020-56) INTO
/ 00000-07577, AND THEN STARTS AT LOCATION 00200 UNLESS STARTING OPTIONS
/ ARE USED.
/ IT IS THE USER'S RESPONSIBILITY TO PRELOAD ANY EXTENDED MEMORY SEGMENTS
/ OF THE PROGRAM (IF ANY) BY OTHER MEANS BEFORE USING "START." THE USUAL
/ METHOD WOULD BE TO "GET" ALL BINARIES, THEN TO "START", AS THE MONITOR
/ DOES NOT VIOLATE ANY EXTENDED MEMORY BEYOND ANY AREAS POSSIBLY RESERVED
/ BY HANDLER EXTENSIONS OR THE "CONSOLE" OVERLAY.
/ START OPTIONS.
/ =NNNN START AT THIS ADDRESS IN THE DESIGNATED FIELD INSTEAD OF 0200
/ (DEFAULT FIELD IS ZERO).
/ /1 CHANGE STARTING FIELD FROM ZERO TO ONE.
/ /2 CHANGE STARTING FIELD FROM ZERO TO TWO.
/ /3 CHANGE STARTING FIELD FROM ZERO TO THREE.
/ /4 CHANGE STARTING FIELD FROM ZERO TO FOUR.
/ /5 CHANGE STARTING FIELD FROM ZERO TO FIVE.
/ /6 CHANGE STARTING FIELD FROM ZERO TO SIX.
/ /7 CHANGE STARTING FIELD FROM ZERO TO SEVEN.
/ THE LOWEST OF /1-/7 WILL BE CHOSEN IGNORING ANY MULTIPLE SWITCHES FROM
/ THAT GROUP. THIS ALLOWS /2-/7 TO BE AVAILABLE OPTIONS TO A PROGRAM
/ STARTING IN FIELD ONE, ETC.
/ IF THE STARTING FIELD IS DEFAULTED TO FIELD ZERO (BY NOT USING /1-/7),
/ THE SYSTEM LOADER IS FORMATTED NORMALLY. IF THE STARTING FIELD IS 1-7,
/ THE SYSTEM LOADER IS MODIFIED TO:
/ *7632 /WHERE SYSTEM LOADER IS
/ SLOAD, JMS SYSIO /CALL I/O ROUTINES
/ SCORE, 0000 /TRANSFER STARTS AT 0000
/ SFUN, 37^100+.-. /UNIT BITS WILL BE FILLED IN
/ SBLOCK, 0020 /DEFAULT CORE IMAGE BLOCK
/ STFLD, CIF CDF 00+.-. /FIELD WILL BE FILLED IN
/ SYSTART,JMP I SPARM /GO START IT UP THROUGH THERE
/ IF AN EXTENDED FIELD START IS SPECIFIED, THE SYSTEM EQUALS PARAMETER
/ WORD WILL BE FORCED TO THE STARTING ADDRESS EVEN IF NONE WAS GIVEN,
/ I. E. THE EQUALS PARAMETER WILL BE 0200 IF NONE WERE GIVEN WHILE
/ NORMALLY IT WOULD BE 7777.
/ IF A FIELD ZERO START IS SPECIFIED, THE SYSTEM EQUALS PARAMETER WILL BE
/ PASSED AS IS; NOT STATING ANY EXPLICIT ADDRESS YIELDS 7777 IN 007756.
/ ALL OTHER OPTIONS, SWITCHES, FILES, ETC. ARE PASSED TO THE USER PROGRAM.
/ START CAN BE ACCOMPLISHED FROM A WRITE-PROTECTED SYSTEM DEVICE TO ALLOW
/ FOR SAFETY WHEN DEBUGGING A NEW PROGRAM (SEE "GET").
/ BIN SYSTEM DESCRIPTION.
/ BIN IS A UTILITY FOR MANIPULATION OF BINARY PAPER TAPES AND BINARY FILES.
/ BIN HAS FOUR BASIC INTERNAL MODES OF OPERATION:
/ MODE (A) LOADING PAPER TAPES DIRECTLY INTO MEMORY.
/ MODE (B) LOADING INPUT FILES DIRECTLY INTO MEMORY.
/ MODE (C) CREATING BINARY OUTPUT FILES FROM PAPER TAPES.
/ MODE (D) PUNCHING BINARY PAPER TAPES FROM INPUT FILES.
/ EACH MODE OF OPERATION HAS ITS OWN OPTIONS; SEVERAL SWITCH OPTIONS HAVE
/ ANALOGOUS MEANINGS IN DIFFERENT MODES.
/ TO DISTINGUISH THE VARIOUS MODES THE FOLLOWING CONVENTIONS APPLY:
/ THE /P OPTION ALWAYS IMPLIES PAPER TAPE INPUT OR OUTPUT AND PRECLUDES
/ MODE (B) AND MODE (D); MODE (A) AND MODE (C) ARE DISTINGUISHED FROM EACH
/ OTHER BY THE PRESENCE OF PASSED OUTPUT FILES WHICH FORCES MODE (C). FOR
/ THE PURPOSES OF THE ABOVE, THE PRESENCE OF THE /B OR /D OR /G OR /U OPTIONS
/ IMPLY PASSED OUTPUT FILES IF NO EXPLICIT ONES WERE GIVEN. IN THE ABSENCE
/ OF /P, /W ALWAYS FORCES MODE (D). THE COMBINATION OF /B, /D, /G, /U CREATES
/ A DEFAULT LIST OF FILES ACCORDING TO THE FOLLOWING RULES:
/ /B USE %:[BOOTSTRAP UNIT] AS THE (FIRST) FILE.
/ /D IMPLIES /B ALSO USE $:[BOOTSTRAP UNIT] AS THE SECOND FILE.
/ /G IMPLIES /B ALSO CHAINING BACK TO BIN IF MODE (C).
/ /U IMPLIES /B ALSO CHANGE THE UNIT(S) TO [BOOTSTRAP UNIT XOR ONE].
/ MODE (A): LOADING VALID BINARY PAPER TAPES INTO MEMORY.
/ THIS MODE IMPLEMENTS AN OPTIMIZED VERSION OF DEC'S PAPER TAPE BINARY LOADER.
/ ALL DEC OPTIONS NOT RELATED TO THE READING OF THE SWITCH REGISTER HAVE BEEN
/ RETAINED INCLUDING MOST NOTABLY THE ABILITY TO DELETE SECTIONS OF TAPE
/ FRAMED BY RUBOUT CHARACTERS. (A FEATURE OF EARLY PAPER TAPE ASSEMBLERS
/ WAS THE OUTPUTTING OF ERROR MESSAGES FRAMED BY RUBOUT CHARACTERS. IF THE
/ OUTPUT WAS PUNCHED ON A TELETYPE, THEN THE PAPER TAPE COULD CONTAIN
/ IMBEDDED FRAMED ERROR MESSAGES. THEY WILL PROPERLY BE IGNORED.)
/ USING THIS MODE CAUSES A PAPER TAPE BIN LOADER AND RIM LOADER TO APPEAR
/ IN THE LAST PAGE OF MEMORY ALONG WITH THE SYSTEM BOOTSTRAP. THIS METHOD
/ WILL WORK WITH ALL KNOWN VALID BINARY PAPER TAPES EXCEPT THOSE WHICH
/ ASSUME THE SOMEWHAT ILLEGAL CONVENTION THAT EITHER:
/ A) THE "OFFICAL" DEC LOADER IS LOADING THE PROGRAM AND CERTAIN WORDS
/ IN THE LAST PAGE OF MEMORY ARE THEREFORE AVAILABLE. THIS OFTEN YIELDS
/ CLOBBERING OF THE BOOTSTRAP AT 007600 BY THE OFFENDING PROGRAM.
/ B) THE "OFFICIAL" DEC LOADER IS LOADING THE PROGRAM AND CERTAIN WORDS
/ WITHIN THE LOADER ITSELF CAN BE MODIFIED FOR SELF-STARTING AND
/ OTHER RELATED PURPOSES. THIS COULD EVEN FAIL WHEN USING THE DEC
/ "OFFICAL" LOADER! (SEVERAL KNOWN PROGRAMS ACTUALLY MODIFY THE DEC
/ LOADER IN ANTICIPATION OF SELF STARTING. ONE KNOWN PROGRAM ACTUALLY
/ ATTEMPTS TO DETERMINE IF THERE WAS A CHECKSUM ERROR DURING ITS
/ LOADING PROCESS AND WILL ALLOW RELOADING IF AN ERROR IS DETECTED.
/ IF NO ERROR, IT RESTORES THE LOADER AND SELF STARTS. THIS SITUATION
/ IS PATENTLY ABSURD AS THERE IS NO WAY TO PREVENT THE ERROR FROM
/ BEING IN THE LOADING IN OF THOSE WORDS WHICH OVERLAY THE LOADER
/ ITSELF, AS OPPOSED TO ELSEWHERE IN THE LOADING, THUS UNPREDICTABLE
/ RESULTS ARE POSSIBLE!)
/ IT SHOULD ALSO BE POINTED OUT THAT DEC HAS SUPPORTED AT LEAST THREE KNOWN
/ INCOMPATIBLE VERSIONS OF ITS "OFFICAL" LOADER AND THE ABOVE IRREGULAR
/ PROGRAMS CAN'T NECESSARILY LOAD FROM ANY ONE PARTICULAR DEC LOADER.
/ THE ONLY ITEM NOT AVAILABLE IN THE P?S/8 LOADER IS THE SWITCH REGISTER
/ OPTION. THE P?S/8 BIN VERSION CANNOT CHOOSE THE INPUT DEVICE FOR LOADING
/ FROM THE SWITCH REGISTER. THIS IS NOT SEEN AS A PROBLEM AS THE USER SELECTS
/ THE INPUT DEVICE ON THE COMMAND LINE OF THE MONITOR. IT ONLY MEANS THAT THE
/ CHOICE OF INPUT OPTIONS FEATURE AFTER CONTROL IS PASSED TO THE PAPER TAPE
/ LOADER IS DELETED; IT WOULD APPEAR THAT CHANGING DEVICES IN MID-LOAD IS
/ UNLIKELY, AS THE USER WOULD PROBABLY CHOOSE THE FASTER INPUT DEVICE
/ (HIGH-SPEED READER) IF AVAILABLE.
/ AS IN THE DEC LOADERS, THE LOADER HALTS AT THE END OF A PAPER TAPE LOAD.
/ THE AC SHOULD BE ZERO ELSE A CHECKSUM ERROR WAS DETECTED AND THE LOAD IS
/ INVALID. IF THE LOADER WAS NOT VIOLATED (A POSSIBILITY!), IT CAN BE
/ RESTARTED EITHER BY HITTING CONTINUE OR RESTARTING AT 007777 AS IN THE
/ DEC LOADERS.
/ DEC PAPER TAPE SYSTEMS ALSO SUPPORT A RIM LOADER WITH FIXED INPUT DEVICE.
/ THE RIM LOADER RESIDES NEXT TO THE BIN LOADER AND STARTS AT 007756. THE
/ P?S/8 VERSION IS TOTALLY COMPATIBLE WITH THE DEC RIM LOADER AND INCLUDES
/ CHOICE OF INPUT DEVICE AT THE COMMAND LINE OF THE MONITOR; EITHER LOADER
/ CAN BE CHOSEN BY COMMAND, ALONG WITH THE INITIAL DATA FIELD OF LOADING
/ WHICH CAN ONLY BE CHOSEN BY FRONT PANEL MANIPULATION IN THE DEC PROGRAMS.
/ SHOULD MANUAL RESTART OF EITHER LOADER BE DESIRED AFTER LOADING AT LEAST
/ ONE PAPER TAPE, THEN THE FOLLOWING COMPATIBLE CONVENTIONS APPLY:
/ A) BOOTSTRAP AT 007600. THE ONLY RESTRICTION IS TO CLEAR THE DATA FIELD.
/ B) START THE BINARY LOADER AT 007777.
/ C) START THE RIM LOADER AT 007756.
/ BIN MODE (A) OPTIONS.
/ /F USE HIGH-SPEED READER (DEVICE 01) AS INPUT DEVICE FOR EITHER LOADER.
/ /H FILL ALL UNPROTECTED MEMORY WITH HLT INSTRUCTIONS (7402) BEFORE
/ STARTING THE PAPER TAPE LOADER (P?S/8 CORE SIZE PROTECTION APPLIES).
/ /P LOAD BINARY PAPER TAPES (MUST BE PRESENT TO INDICATE MODE (A)).
/ /R USE RIM LOADER (DEFAULT IS BIN LOADER).
/ /Z ZERO ALL UNPROTECTED MEMORY BEFORE STARTING THE PAPER TAPE LOADER
/ (P?S/8 CORE SIZE PROTECTION APPLIES).
/ /1 INITIAL LOADING INTO FIELD ONE (DEFAULT IS ZERO).
/ /2 SAME AS ABOVE ONLY INITIAL LOADING INTO FIELD TWO.
/ /3 SAME AS ABOVE ONLY INITIAL LOADING INTO FIELD THREE.
/ /4 SAME AS ABOVE ONLY INITIAL LOADING INTO FIELD FOUR.
/ /5 SAME AS ABOVE ONLY INITIAL LOADING INTO FIELD FIVE.
/ /6 SAME AS ABOVE ONLY INITIAL LOADING INTO FIELD SIX.
/ /7 SAME AS ABOVE ONLY INITIAL LOADING INTO FIELD SEVEN.
/ IN MODE (A), ANY INPUT FILES PASSED ARE IGNORED.
/ 007600-007642 WILL CONTAIN THE SYSTEM BOOTSTRAP CODE TAKEN FROM THE SLURP
/ LOADER INITIALIZED AS NECESSARY.
/ MODE (A) INPUT DEVICE IS EITHER THE HIGH-SPEED READER (/F) OR THE SYSTEM
/ CONSOLE IF IT IS EQUIPPED WITH A COMPATIBLE READER. THIS UTILITY DOES NOT
/ SUPPORT CONSOLE OVERLAY DEVICES FOR PAPER TAPE INPUT, HOWEVER APPROPRIATE
/ MESSAGES (PRIMARILY IN OTHER MODES) WILL OUTPUT TO THE LOGICAL CONSOLE
/ DEVICE IF APPLICABLE.
/ IF /H OR /Z ARE IN EFFECT, THEN THE FIELD ZERO MEMORY SPACE WILL NOT BE
/ COMPLETELY INITIALIZED. THE DISCREPANCY IS VERSION-DEPENDENT AND IS
/ APPROXIMATELY 007570-007577. THE EXACT VALUES ARE ALSO DEPENDENT ON /H
/ VERSUS /Z.
/ WHEN LOADING BINARY PAPER TAPES WITH THE BIN LOADER, FIELD SETTINGS
/ PRESENT ON THE TAPES WILL OVERRIDE THE INITIAL LOADING FIELD.
/ MODE (B): LOADING BINARY INPUT FILES INTO MEMORY.
/ MODE (B) IS THE DEFAULT MODE OF OPERATION AS IT IS INDICATED BY LACK OF
/ PAPER TAPE ORIENTED SWITCH OPTIONS.
/ LOADING OF BINARY FILES IS ACCOMPLISHED BY ONE OF TWO METHODS:
/ 1) A "VIRTUAL" LOADER (/V) IS AVAILABLE WHICH PSEUDO-LOADS AN AREA OF
/ MEMORY WHICH IS PROTECTED BY THE LOADER INTO A SCRATCH AREA ON THE
/ SYSTEM DEVICE LOCATED IMMEDIATELY AFTER THE BIN SYSTEM PROGRAM
/ ITSELF. THIS LOADER CANNOT WORK ON A WRITE-PROTECTED DEVICE (WHICH
/ COULD BE DANGEROUS WHEN USING A NON-DEBUGGED NEW PROGRAM! SEE "GET"
/ AND "START" FOR A SOLUTION TO THIS PROBLEM). THE SCRATCH AREA WILL
/ BE LOADED OVER THE VIRTUAL LOADER AREA OF MEMORY AT THE END OF THE
/ LOADING PROCESS. THE LOADER IS PROTECTED FROM ACCIDENTAL (OR
/ OTHERWISE!) LOADING OVER 007600 AND MAKES THE LOADING OF THIS AREA
/ AVAILABLE ON THE SYSTEM DEVICE (SEE VIRTUAL LOADER DOCUMENTATION
/ FOR A SUGGESTED METHOD OF RETRIEVING THIS PAGE). THE VIRTUAL LOADER
/ VALIDATES EACH FILE AS IT LOADS AND CAN BE INTERRUPTED/SUSPENDED
/ BY THE STANDARD SET OF CONTROL CHARACTERS FROM THE SYSTEM CONSOLE:
/ <^S> SUSPEND LOADING UNTIL <^Q> PRESSED.
/ <^Q> RESUME LOADING.
/ ABORT LOADING AND RETURN TO THE MONITOR.
/ <^A> SAME AS .
/ <^B> SAME AS .
/ <^C> ABORT LOADING AND RETURN TO THE MONITOR; ABORT BATCH
/ OPERATIONS IF APPLICABLE.
/ INVALID FILES PASSED TO THE VIRTUAL LOADER WILL YIELD THE ERROR MESSAGE:
/ INVALID INPUT FILE!
/ AS THE STANDARD SYSTEM I/O ROUTINES ARE USED DURING THE LOADING
/ PROCESS, ANY I/O ERRORS ARE SUBJECT TO THE PREVAILING ERROR HANDLING
/ (HALT/HANG ON ERROR WITH MANUAL RESTART/AUTOMATIC RETRY, CONSOLE
/ OVERLAY).
/ 2) A "SLURP" LOADER IS PROVIDED BY DEFAULT ON SOME SYSTEMS (WHEN NOT
/ AVAILABLE, THE VIRTUAL (/V) LOADER WILL BE USED INSTEAD.) WHICH HAS
/ A DIFFERENT SET OF TRADEOFFS:
/ THE "SLURP" LOADER REPLACES THE SYSTEM I/O ROUTINES IN THE LAST
/ PAGE OF MEMORY DURING THE LOADING PROCESS (THE /I OPTION EXISTS TO
/ RELOAD THE DISPLACED SYSTEM I/O ROUTINES AFTER LOADING). THE "SLURP"
/ LOADER DOES NOT WRITE ON THE SYSTEM DEVICE AND IS THEREFORE SAFER
/ TO USE WHEN DEBUGGING A NEW (AND POTENTIALLY DANGEROUS!) PROGRAM.
/ IT GENERALLY RUNS CONSIDERABLY FASTER THAN THE VIRTUAL LOADER WHEN
/ BOTH ARE AVAILABLE. ERROR RECOVERY OF THE SLURP LOADER HOWEVER, IS
/ SEVERELY LIMITED AND, ACCORDING TO THE PARTICULAR WORKINGS OF EACH
/ VERSION, MAY BE IMPOSSIBLE; SEVERAL SLURP LOADERS HALT ON DETECTED
/ ERROR; PRESSING CONTINUE AFTER THIS HALT IS IMPLEMENTATION DEPENDENT.
/ SOME SLURP LOADER VERSIONS IGNORE (CERTAIN) ERRORS. SOME SLURP
/ LOADERS "HANG UP" WHEN AN ERROR OCCURS.
/ THE "SLURP" LOADER IGNORES BINARY FILE VALIDITY AND CAN PRODUCE
/ UNPREDICTABLE RESULTS WHEN PASSING OTHER FORMAT FILES. THE "SLURP"
/ LOADER CANNOT BE INTERRUPTED BY CONSOLE CONTROL CHARACTERS. THE
/ "SLURP" LOADER IS NOT PROTECTED FROM LOADING OVER ITSELF!
/ THE SLURP LOADER CONTAINS A STAND-ALONE BOOTSTRAP TO THE SYSTEM
/ DEVICE WHICH WILL OCCUPY 007600-007642 WHEN INITIALIZED. THIS CODE
/ WILL BE USED IN MODE (A) AS THE SYSTEM BOOTSTRAP BECAUSE IT IS
/ SMALL ENOUGH TO CO-EXIST WITH THE BIN AND RIM LOADERS. AS IN ALL
/ BOOTSTRAP PROCEDURES, USE OF THE SLURP LOADER'S BOOTSTRAP CODE
/ COULD CAUSE FAILURE TO BOOTSTRAP THE SYSTEM; THIS IS GENERALLY NOT
/ RESTARTABLE. THIS IS NOT AS RELIABLE AS RESTARTING THE SYSTEM AT
/ 007600 WHEN THE SYSTEM I/O ROUTINES ARE RESIDENT AS IS THE CASE
/ WITH THE VIRTUAL LOADER.
/ THE "SLURP" LOADER ALWAYS SUPPORTS THE /I OPTION TO RELOAD THE
/ SYSTEM I/O ROUTINES AFTER LOADING. THIS IS ACCOMPLISHED BY PASSING
/ AN INTERNAL FILE TO THE SLURP LOADER FROM THE SYSTEM DEVICE WHICH
/ IS PARTICULAR TO THE SLURP LOADER, WHICH MODIFIES IT INTO A LOADING
/ ROUTINE FOR THE SYSTEM I/O ROUTINES. NO USER MEMORY IS VIOLATED
/ DURING THIS PROCESS. SINCE THE SYSTEM I/O ROUTINES ARE LOADED, BUT
/ NOT INITIALIZED BY THIS PROCESS, THE SYSTEM CORE SIZE WORD IS NOT
/ COMPLETELY ACCURATE AFTER RELOADING. IF THE USER IS CONCERNED WITH
/ THE CONTENTS OF THE SYSTEM'S PARAMETER WORDS, THIS IS THE WRONG
/ METHOD TO USE (SEE "GET" THEN "START", "R %", "R $" OR "ODT" FOR
/ SEVERAL SOLUTIONS TO THIS PROBLEM).
/ ALL OTHER ASPECTS OF THE SYSTEM I/O ROUTINES ARE VALID, INCLUDING
/ THE POTENTIALLY MORE RELIABLE BOOTSTRAP PROCEDURE. IF A CONSOLE
/ OVERLAY IS PRESENTLY INSTALLED ON THE SYSTEM, THE "SLURP" LOADER
/ AND /I OPTION WILL AUTOMATICALLY BE "UPGRADED" TO /V INSTEAD. IF
/ /I IS IN EFFECT, THE FILE LIMIT IS LOWERED TO SIXTEEN INPUT FILES
/ AS OPPOSED TO THE NORMAL SEVENTEEN AS THE /I OPTION IS PASSED AS
/ A "FILE" TO THE SLURP LOADER.
/ BIN MODE (B) OPTIONS.
/ USE SLURP LOADER IF AVAILABLE (ELSE USE VIRTUAL LOADER AS IN /V)
/ TO LOAD %:[BOOTSTRAP UNIT]. PROGRAM HALTS IN A DEVICE-DEPENDENT
/ ADDRESS BETWEEN 07643-07755 WITH CLEAR AC. ANY OTHER HALT INDICATES
/ A BAD LOAD. MANUAL START OF USER PROGRAM IS REQUIRED.
/ /B SAME AS PASSING NO OPTIONS. USED TO ESTABLISH %:[BOOTSTRAP UNIT]
/ AS THE FILE TO BE LOADED. THIS OPTION IS IGNORED IF INPUT FILES
/ ARE PASSED. OUTPUT FILES ARE IGNORED IN MODE (B) AND HAVE NO BEARING
/ ON THIS OPTION.
/ /D SAME AS /B ALSO LOAD $:[BOOTSTRAP UNIT] AS A SECOND FILE.
/ /G SAME AS /B.
/ /H FILL ALL UNPROTECTED MEMORY WITH HLT INSTRUCTIONS (7402) BEFORE
/ STARTING THE LOADER (P?S/8 CORE SIZE PROTECTION APPLIES).
/ /I RELOAD SYSTEM I/O ROUTINES AFTER SLURP LOADER IS DONE LOADING. IF
/ NO STARTING ADDRESS IS SPECIFIED, IT IS DEFAULTED TO 007776 WHEN
/ INVOKING /I. STARTING AT 007632 WILL SAVE FIELD ZERO IN THE DEFAULT
/ SCRATCH AREA ("%" AND "$" FILE AREA) AND RELOAD THE MONITOR. ANY
/ ATTEMPT TO USE ANY OTHER STARTING ADDRESS OR FIELD WITH THE /I
/ OPTION WHILE A CONSOLE OVERLAY IS IN EFFECT WILL FORCE THE /V OPTION
/ AND IGNORE /I.
/ /U SAME AS /B BUT CHANGES THE FILE(S) TO %:[BOOTSTRAP UNIT XOR ONE]
/ (AND $:[BOOTSTRAP UNIT XOR ONE] IF /D).
/ /V USE VIRTUAL LOADER INSTEAD OF "SLURP" LOADER. IF NO STARTING ADDRESS
/ IS SPECIFIED, IT IS DEFAULTED TO 007776 WHEN INVOKING /V. STARTING
/ AT 007632 WILL SAVE FIELD ZERO IN THE DEFAULT SCRATCH AREA ("%"
/ AND "$" FILE AREA) AND RELOAD THE MONITOR.
/ /Z ZERO ALL UNPROTECTED MEMORY BEFORE STARTING THE LOADER (P?S/8 CORE
/ SIZE PROTECTION APPLIES).
/ =NNNN STARTUP USER PROGRAM AT NNNN IN DESIGNATED FIELD WITH CLEAR AC. IF
/ FIELD SWITCHES NOT USED, DEFAULT IS FIELD ZERO. ANY HALT OTHER THAN
/ THE LOADER HALT IS USER'S RESPONSIBILITY.
/ /1 START AT NNNN AS ABOVE ONLY IN FIELD ONE (1NNNN). THIS OPTION IS
/ IGNORED UNLESS =NNNN IS GIVEN.
/ /2 SAME AS ABOVE ONLY USE FIELD TWO.
/ /3 SAME AS ABOVE ONLY USE FIELD THREE.
/ /4 SAME AS ABOVE ONLY USE FIELD FOUR.
/ /5 SAME AS ABOVE ONLY USE FIELD FIVE.
/ /6 SAME AS ABOVE ONLY USE FIELD SIX.
/ /7 SAME AS ABOVE ONLY USE FIELD SEVEN.
/ PASSING EXPLICIT INPUT FILES CAUSES /B, /D, /G, /U TO BE IGNORED.
/ PASSED OUTPUT FILES ARE ALWAYS IGNORED AS IF NOT PASSED AND SERVE ONLY
/ TO WASTE SPACE IN THE FILE LIST.
/ IF THE /I OPTION IS INVOKED AND IN EFFECT, THEN ONLY UP TO SIXTEEN FILES
/ WILL BE LOADED. NORMALLY THIS LIMIT IS SEVENTEEN; THE KEYBOARD MONITOR
/ NORMALLY PREVENTS ATTEMPTS TO PASS TOO MANY FILES, BUT CANNOT FORESEE THIS
/ SITUATION.
/ IF THE "SLURP" LOADER IS IN EFFECT, THEN USING /H OR /Z WILL NOT COMPLETELY
/ AFFECT THE FIELD ZERO USER MEMORY SPACE. THE DISCREPANCY IS
/ VERSION-DEPENDENT AND IS APPROXIMATELY 007570-007577. THE EXACT VALUES ARE
/ ALSO DEPENDENT ON /H VERSUS /Z.
/ IF /V IS IN EFFECT, THE FOLLOWING ADDITIONAL CONDITIONS APPLY:
/ A) /H OR /Z OPERATIONS WILL COMPLETELY FILL THE FIELD ZERO MEMORY
/ SPACE WITH THE APPROPRIATE CONSTANT (7402 OR 0000).
/ B) THE LOADER WILL REQUIRE WRITE-ENABLE ON THE SYSTEM DEVICE FROM
/ WHICH "BIN" (OR "GET") WAS INVOKED.
/ C) THE LOADER WILL BE SENSITIVE TO <^S>/<^Q>, , <^A>, <^B> AND
/ <^C> ACCORDING TO THEIR STANDARD MEANINGS.
/ D) THE LOADER WILL CHECK THE PASSED FILES FOR BINARY VALIDITY. IF ANY
/ FILES ARE INVALID, AN ERROR MESSAGE WILL BE PRINTED AND THE LOADING
/ PROCESS AUTOMATICALLY TERMINATED RETURNING CONTROL TO THE MONITOR.
/ E) AN IMAGE OF 005200-007777 WILL BE CREATED ON THE SYSTEM DEVICE ON
/ THE 12 BLOCKS FOLLOWING THE "BIN" PROGRAM ITSELF. THE INTENDED
/ LOADING OF 007600 (IF ANY) WILL BE AVAILABLE AFTER THE LOADING
/ PROCESS IS COMPLETED FOR ANY TENTATIVE PURPOSE.
/ F) THE CONSOLE DEVICE FOR ALL CONTROL INPUT AND MESSAGE OUTPUT WILL
/ BE THE STANDARD SYSTEM CONSOLE DEVICE INCLUDING ANY CONSOLE OVERLAY.
/ IF THE CONSOLE OVERLAY IS PRESENT, ALL I/O ERRORS ARE GOVERNED BY
/ THE OVERLAY.
/ G) WARNING: NO ATTEMPT IS MADE TO PROTECT THE OVERLAY OR ANY EXTENDED
/ HANDLER CODE IN UPPER MEMORY!
/ MODE (C) CREATING BINARY OUTPUT FILES FROM VALID BINARY PAPER TAPES.
/ THE USER MUST PASS SUFFICIENT FILES TO BIN FOR MODE (C) TO BE EFFECTIVE.
/ INSUFFICIENT OUTPUT FILES WILL YIELD AN OVERFLOW MESSAGE AND ABORT BACK TO
/ THE MONITOR WITH THE CONVERSION FROM PAPER TAPE TO FILES INCOMPLETE. THE
/ UTILITY WILL GIVE A REPORT OF THE COUNT OF FILES CREATED TO ASSIST THE USER
/ IN POSSIBLY DISCARDING EXCESS OUTPUT FILES.
/ IF THE USER INVOKES THE CHAINING OPTION (/G), THE EXCESS FILE ARGUMENTS
/ WILL BE DELETED FROM THE FILE LIST BEFORE CHAINING BACK TO A NEW COPY OF
/ THE "BIN" PROGRAM.
/ OTHER MESSAGES INCLUDE:
/ A) COMPLAINT OF CHECKSUM ERROR ON PAPER TAPE. THIS IS A FATAL ERROR
/ AND ABORTS THE CONVERSION PROCESS, RETURNING TO THE MONITOR.
/ B) REPORT OF PAPER TAPE END-OF-FILE. THE USER WILL THEN BE PROMPTED
/ REGARDING ANY ADDITIONAL PAPER TAPES TO BE LOADED AT THIS TIME TO
/ HAVE THEIR CONTENTS APPENDED TO THE CONTENTS OF THE OUTPUT FILES.
/ A "Y" (FOR YES) OR "N" (FOR NO) RESPONSE IS REQUIRED AT THIS POINT.
/ SHOULD THE CONSOLE DEVICE CURRENTLY BE DEFINED AS A TELETYPE-LIKE
/ DEVICE WITH A READER, AND THE PAPER TAPE INPUT DEVICE IS THE CONSOLE
/ ITSELF (DEVICE 03), THEN THE CONTROL CHARACTERS NORMALLY ASSOCIATED
/ WITH CONTROLLING THE PROGRAM ARE DISABLED, AS THE READER ITSELF MAY
/ ACCIDENTLY INPUT CONTROL CHARACTERS WHILE THE TAPE MOVES PAST THE
/ END-OF-FILE POINT. IF THIS IS THE CASE, THE PROGRAM CAN ONLY BE
/ TERMINATED WITH A NO RESPONSE AT THIS POINT, OR BY MANUALLY
/ RESTARTING THE MONITOR AT 007600.
/ MODE (C) OPTIONS.
/ /B OUTPUT TO %:[BOOTSTRAP UNIT]. THIS OPTION IS IGNORED IF OUTPUT
/ FILES ARE EXPLICITLY PASSED.
/ /D SAME AS /B AND ADDITIONALLY OUTPUT TO $:[BOOTSTRAP UNIT] AS A
/ SECOND FILE IF NEEDED.
/ /F INPUT DEVICE FOR PAPER TAPES IS THE HIGH-SPEED READER (01).
/ DEFAULT IS THE CONSOLE DEVICE EQUIPPED WITH A PAPER TAPE READER
/ (03). IF A CONSOLE OVERLAY IS PRESENT, THE DEFAULT DEVICE DOES
/ NOT CHANGE.
/ /G SAME AS /B; ALSO CHAINING OPTION. REMOVE /P FROM THE OPTION LIST
/ AND MAKE THE CURRENT OUTPUT FILE LIST INTO AN INPUT FILE LIST. IF
/ /W ALSO PASSED, THEN THE CREATED FILES WILL BE PUNCHED (SEE MODE
/ (D)). IF /W IS NOT PASSED, THEN THE CREATED FILES WILL BE LOADED
/ (SEE MODE (B)). ALL APPROPRIATE OPTIONS TO MODE (B) OR MODE (D)
/ APPLY. "GET/P" IS AN APPLICATION OF MODE (C) FOLLOWED BY CHAINING
/ BACK IN MODE (B).
/ /P MUST BE PRESENT IN MODE (C).
/ /R INPUT FORMAT IS RIM PAPER TAPE. DEFAULT IS BIN PAPER TAPE.
/ /U SAME AS /B BUT CHANGES THE FILE(S) TO %:[BOOTSTRAP UNIT XOR ONE]
/ (AND $:[BOOTSTRAP UNIT XOR ONE] IF /D).
/ /1 INITIAL LOADING FIELD IN OUTPUT FILES IS FIELD ONE (DEFAULT IS ZERO).
/ /2 SAME AS ABOVE ONLY INITIAL LOADING FIELD IS TWO.
/ /3 SAME AS ABOVE ONLY INITIAL LOADING FIELD IS THREE.
/ /4 SAME AS ABOVE ONLY INITIAL LOADING FIELD IS FOUR.
/ /5 SAME AS ABOVE ONLY INITIAL LOADING FIELD IS FIVE.
/ /6 SAME AS ABOVE ONLY INITIAL LOADING FIELD IS SIX.
/ /7 SAME AS ABOVE ONLY INITIAL LOADING FIELD IS SEVEN.
/ IF EXPLICIT OUTPUT FILES ARE PASSED, /B, /D, AND /U ARE IGNORED. THE
/ DEFAULT FILE ASPECT OF /G WILL BE IGNORED; THE CHAINING ACTION WILL APPLY.
/ IF /G IS INVOKED, THEN ONLY THOSE OUTPUT FILES NEEDED ARE PASSED BACK AS
/ INPUT FILES TO THE CHAINED COPY OF BIN. ALL OTHER FILES, INCLUDING INPUT
/ FILES ARE IGNORED. ALL DISTINCT OPTIONS OF MODE (B) OR MODE (D) WILL BE
/ PASSED TO THE CHAINED COPY; THEY ARE IGNORED BY THE MODE (C) PHASE OF
/ THE UTILITY.
/ WHEN CREATING FILES FROM BINARY PAPER TAPES, FIELD SETTINGS PRESENT ON THE
/ TAPES WILL OVERRIDE THE INITIAL LOADING FIELD.
/ MODE (D) PUNCHING BINARY PAPER TAPES FROM VALID BINARY INPUT FILES.
/ THE USER PASSES BINARY FILES TO THE BIN UTILITY IN MODE (D). THE FILES ARE
/ VALIDATED AND PUNCHED ON THE SELECTED PUNCH DEVICE. IF ANY FILE IS INVALID,
/ AN ERROR MESSAGE WILL BE ISSUED AND THE PROCESS ABORTED, RETURNING TO THE
/ MONITOR.
/ ALL STANDARD CONSOLE CONSIDERATIONS APPLY INCLUDING THE USUAL CONTROL
/ CHARACTERS (<^S>/<^Q>, , <^A>, <^B>, <^C>).
/ INVOKING THIS UTILITY MULTIPLE TIMES CAN PRODUCE A MULTI-FILE PAPER TAPE
/ IF THE PUNCH FLAG IS NOT CLEARED BETWEEN USAGES. THE FLAG WILL BE TIMED OUT
/ AND FORCED ON BY PUNCHING A CHARACTER IF NECESSARY (ONLY NEEDED IF
/ POWER-CLEAR HAS OCCURRED SINCE LAST PUNCH USAGE). THIS CAN ONLY BE DONE ON
/ THE HIGH-SPEED PUNCH (OR CONSOLE TELETYPE PUNCH WITH A CONSOLE OVERLAY
/ ENABLED TO AN ALTERNATE DEVICE).
/ MODE (D) OPTIONS.
/ /B INPUT IS %:[BOOTSTRAP UNIT]. THIS IS THE DEFAULT FILE IF NO OTHER
/ INPUT FILE IS SPECIFIED.
/ /D SAME AS /B AND ADDITIONALLY USE $:[BOOTSTRAP UNIT] AS SECOND
/ INPUT FILE.
/ /F USE HIGH-SPEED PUNCH (DEVICE 02) AS PAPER TAPE OUTPUT DEVICE.
/ DEFAULT IS THE CONSOLE TELETYPE EQUIPPED WITH A PAPER TAPE PUNCH
/ (DEVICE 04).
/ /G SAME AS /B.
/ /R OUTPUT IN RIM FORMAT; DEFAULT IS BIN FORMAT.
/ /U SAME AS /B EXCEPT FILE(S) ARE %:[BOOTSTRAP UNIT XOR ONE] (AND
/ $:[BOOTSTRAP UNIT XOR ONE] IF /D).
/ /W MUST BE PRESENT FOR MODE (D). IF NO INPUT FILES SPECIFIED, USE
/ %:[BOOTSTRAP UNIT].
/ IF EXPLICIT INPUT FILES ARE PASSED, IGNORE /B, /D, /G, AND /U.
/ IF A CONSOLE OVERLAY IS IN EFFECT, THE DEFAULT OUTPUT DEVICE IS STILL
/ ASSUMED TO BE DEVICE 04 WITH A PAPER TAPE PUNCH INSTALLED.
/ ALL OUTPUT FILES ARE IGNORED.
/ IF RIM FORMAT OUTPUT IS SELECTED, A CHECKSUM IS ALSO PUNCHED WHICH LOOKS
/ (TO RIM) LIKE AN EXTRA DATA WORD. THIS ALLOWS BINARY LOADERS TO LOAD AND
/ VALIDATE PAPER TAPES CREATED BY THIS UTILITY. TO PREVENT DESTRUCTION OF THE
/ LAST WORD ON THE TAPE, ALWAYS INCLUDE AN ORIGIN SETTING AT THE END OF THE
/ INPUT FILE(S) TO A NEUTRAL LOCATION TO ACCOMODATE THE CHECKSUM.
/ ALL FIELD SETTINGS ARE IGNORED IN RIM MODE.
/ GET SYSTEM DESCRIPTION.
/ "GET" IS A SHORT-HAND METHOD OF SPECIFYING SEVERAL OPTIONS TO "BIN".
/ THE PRIMARY PURPOSE OF "GET" IS TO LOAD BINARY INPUT, SAVE A COPY OF
/ FIELD ZERO IN THE SYSTEM SCRATCH AREA (%:[BOOTSTRAP UNIT, $:[BOOTSTRAP UNIT])
/ AND THEN RELOAD THE MONITOR TO ALLOW OTHER OPERATIONS TO PROCEED (START,
/ R $, R %, ODT, BSAVE, ETC.). THIS AFFORDS THE USER THE OPPORTUNITY TO
/ WRITE-PROTECT THE SYSTEM DEVICE BEFORE STARTING UP UNPREDICTABLE
/ (UN-DEBUGGED!) PROGRAMS AND THUS BE PROTECTED FROM UNEXPECTED RESULTS.
/ THE FOLLOWING OPTIONS ARE FORCED:
/ /1 THROUGH /7 ARE REMOVED.
/ /W IS REMOVED.
/ /G IS FORCED ON TO ALLOW CHAINING IN CASE THE USER INVOKES /P.
/ =NNNN IS FORCED TO 7632, THE ADDRESS OF THE SYSTEM LOADER WHERE A
/ CORE SAVE ROUTINE IS LOCATED.
/ /I IS FORCED ON TO RELOAD THE SYSTEM I/O ROUTINES BEFORE SAVING THE
/ COPY OF FIELD ZERO. EVEN IF A CONSOLE OVERLAY IS PRESENT, THIS IS ALLOWED,
/ AS THE OVERLAY WILL BE RELOADED AFTER THE MONITOR IS RELOADED.
/ THE FOLLOWING OPTIONS ARE AVAILABLE THOUGH NOT FORCED:
/ IF /P IS INVOKED, MODE (C) OPERATIONS WILL HAPPEN FIRST, WITH THE
/ PREVAILING LIST OF OUTPUT FILES (/B, /D, /G, /U CREATED IF NECESSARY) THEN
/ MODIFIED INTO AN INPUT FILE LIST ON THE CHAIN BACK FOR THE MODE (B)
/ OPERATIONS.
/ /V IS ALLOWED IF DESIRED (N. B. THIS MAY BE THE DEFAULT IF THE PARTICULAR
/ SYSTEM DOESN'T SUPPORT A SLURP LOADER!).
/ /H AND /Z ARE ALLOWED.
/ /R AND /F ARE ALLOWED AND MEANINGFUL IF /P IS USED.
/ /SINCE /1-/7 ARE REMOVED, THESE OPTIONS ARE NOT AVAILABLE TO MODE (C)
/ OPERATIONS WHEN INVOKED FROM "GET" WITH /P. THIS CAN ONLY BE ACCOMPLISHED
/ VIA TWO DIFFERENT COMMANDS: "BIN [OUTPUT FILES]
OR FIELD BIT
FLAGS, .-. /BINARY FLAG WORD
RNEWLOC,.-. /RIM NEW LOCATION COUNTER
TXR, VUNLST-1 /TEMPORARY INDEX REGISTER; INITIALIZED FOR BSTART
*20 /GET PAST AUTO-INDEX AREA
/ SLURP LOADER AND BOOTSTRAP INITIALIZE ROUTINE.
BINIT, VERSION^100+REVISION /INITIALIZE SLURP ROUTINE
NL0002 /SETUP "C" BIT MASK
AND I [SCRSIZE] /GET THE BIT
SNA CLA /SKIP IF SET
JMP BINIT2 /JUMP IF NOT
TAD I [P7TSF+VOFF2] /GET "CIF MCS+10"
DCA BCHECK /STORE IN-LINE
BCHECK, .-. /BINARY PUNCH CHECKSUM; WILL BE CIF MCS+10 WHEN NEEDED
JMS CONOFF /TURN OFF OVERLAY
BINIT2, ZBLOCK BINITLN /AMPLE SPACE FOR SPECIAL DEVICE INITIALIZATION
JMP I BINIT /RETURN
/ DEFAULT FILE LIST (USED ONLY IF NECESSARY).
BFILE1, BINADR+.-. /BOOTSTRAP UNIT BITS WILL BE FILLED IN
/**** /U **** XOR ONE
BFILE2, 0000+.-. /**** /D **** DOLBLK+BOOTSTRAP UNIT BITS
/**** /U **** XOR ONE
0000 /THIS DEFINITELY ENDS THE LIST
/ STARTING ADDRESS FOR VARIOUS LOADERS.
BINGO, BAUTO+BPOFF /P AND OUTPUT FILES STARTING ADDRESS
/**** /P AND /R AND OUTPUT FILES **** BWORD2+BPOFF
/**** /P AND NO OUTPUT FILES **** BAUTO
/**** /P AND /R AND NO OUTPUT FILES **** RIMBEG
/ SYSTEM LOADER IMAGE FOR "START".
STLOAD, RELOC SLOAD /WHERE THIS WILL EXECUTE
SLOAD, STRLOC= STLOAD-. /RELOCATION FACTOR FOR SYSTEM LOADER IMAGE
SLOAD, JMS SYSIO /CALL I/O ROUTINES TO LOAD SCRATCH AREA
SCORE, 0000 /TRANSFER ADDRESS; START AT 00000
SFUN, 37^100+.-. /READ FUNCTION; UNIT BITS WILL BE FILLED IN
SBLOCK, BINADR /BLOCK NUMBER FOR BINARY SCRATCH AREA
STFLD, JMP I SYSTART /GO START IT UP
SYSTART,.-. /**** /1-/7 **** JMP I SPARM
RELOC .+STRLOC /RESTORE OUR ORIGIN
PAGE
/ THE BIN SYSTEM PROGRAM STARTS HERE.
IFNZRO .&177
IFNZRO .-200
BSTART= . /START OF BIN SYSTEM
BBINLEN,BINLEN /LENGTH OF BIN SYSTEM; HERE IN CASE CHAINED TO
TAD I [SCRSIZE] /GET CORE SIZE WORD
AND [70] /JUST CURRENT CORE SIZE BITS IN AC[6-8]
CLL RTR /MOVE DOWN TO AC[9-11] AND
STL CMA RAR /FORM ONE'S COMPLEMENT COUNT
DCA BCORCNT /SETUP /H, /Z FIELD COUNTER
TAD I (SBLOCK) /GET OUR LOADING BLOCK
TAD (BINLEN-VOFFSET)/CALCULATE MYTHICAL BASE BLOCK
DCA I (VBASE+VOFF2) /STORE VIRTUAL BASE BLOCK
TAD I (SBLOCK) /GET OUR LOADING BLOCK AGAIN
TAD BBINLEN/(BINLEN)/CALCULATE LOWEST EXISTANT VIRTUAL BLOCK
DCA I (VMBLOCK+VSOFF) /SETUP FOR FINAL LOADING LATER
TAD I (VMBLOCK+VSOFF) /GET FINAL LOADING BLOCK BACK
DCA I (VLOC+VOFF1) /SETUP VIRTUAL CLEARING/HALTING BLOCK ARGUMENT
TAD I (VMBLOCK+VSOFF) /GET FINAL LOADING BLOCK AGAIN
DCA I (VBLOC+VOFF2) /SETUP VIRTUAL DUMPING ROUTINE
/ SETUP "BIN" UNIT BITS IN FUNCTION CALLS, ETC. FOR /V LOADER.
UNITLP, TAD I TXR /GET A LOCATION REQUIRING OUR UNIT BITS
SPA /END OF LIST?
JMP CONSETUP /YES, GO DO OTHER FIXUPS
DCA BZIP /NO, STASH THE ADDRESS
TAD I [SFUN] /GET OUR LOAD FUNCTION
AND [7] /JUST UNIT BITS
TAD I BZIP /GET FUNCTION BITS FROM ADDRESS
DCA I BZIP /STASH COMPOSITE
JMP UNITLP /GO BACK FOR MORE
CONSETU,AND I [SBOOT] /GET BOOTSTRAP INSTRUCTION
TAD (-JMSSYSIO) /COMPARE TO POSSIBLE VALUE
SNA CLA /SKIP IF OTHER
JMP CHKCOVRLAY /JUMP IF IT MATCHES
ISZ I PCHKKRS/(CHKKRS+VOFF2) /MAKE "KRSIOT"
ISZ I PCHKKRS/(CHKKRS+VOFF2) /INTO "KRBIOT"
DCA I (CHKKCC+VOFF2) /DESTROY "KCCIOT"
CHKCOVR,NL0002 /SET "C" BIT MASK
AND I [SCRSIZE] /GET THE "C" BIT
SNA CLA /SKIP IF OVERLAY PRESENT
JMP BTESTZ /JUMP IF NOT
TAD I [SCRSIZE] /GET THE CORE SIZE WORD
RTR;RAR /MOVE OVER MCS BITS
AND [70] /ISOLATE MCS BITS
TAD (CIF 10) /TURN INTO "CIF MCS+10"
DCA I (CHKKSF+VOFF2) /STORE OVER "KSFIOT"
TAD I (CHKKSF+VOFF2) /GET "CIF MCS+10" BACK
DCA I [P7TSF+VOFF2] /STORE OVER "TSFIOT"
DCA I (CHKKCC+VOFF2) /DESTROY "KCCIOT"
/ TAD (BCONLST-1) /POINT AT OUR LIST
/ JMS I [BREPLC] /GO DO CONSOLE OVERLAY ZAPS
JMP BREPL2 /DO IT THIS WAY!
/ COMES BACK HERE AFTER DOING CONSOLE ZAPS.
BTESTZ, NL2000 /CHECK FOR /Z
AND I [SWY9] /AND JUST /Z
SZA CLA /SKIP IF OFF
DCA I (BZSET) /MAKE ZAP INDICATING /Z
BTESTH, TAD I [SWAL] /CHECK FOR /H
AND (20) /AND JUST /H
SNA CLA /SKIP IF SET
DCA I (BHSET) /MAKE ZAP INDICATING NO /H
JMS I [TSTFLD] /TEST FOR STARTING FIELD
/ SETUP DEFAULT FILE LIST IN CASE /B, /D, /G, /U.
JMS I [GBUNIT] /GET BOOTSTRAP UNIT
TAD (BINADR) /GET SCRATCH BLOCK BITS
DCA BFILE1 /STORE AS FIRST DEFAULT FILE
BTESTU, TAD I [SWMX] /CHECK FOR /U
AND [10] /AND JUST /U
SNA CLA /SKIP IF SET
JMP DSETUP /JUMP IF NOT
TAD BFILE1 /GET FIRST DEFAULT FILE
CLL RAR /MOVE LOW-ORDER TO LINK
CML RAL /INVERT AND RESTORE
DCA BFILE1 /SAVE BACK XOR-ED UNIT
TAD (NL7777) /FORCE DEFAULT FILE LIST
DCA I (BFORCE) /IF NECESSARY
DSETUP, TAD BFILE1 /GET FIRST DEFAULT FILE
TAD (DOLBLK-BINADR) /UPDATE TO SECOND DEFAULT FILE
DCA BZIP /SAVE IN CASE NEEDED
BTESTD, TAD I [SWAL] /CHECK FOR /D
AND [400] /BUT ONLY /D
SNA CLA /SKIP IF SET
JMP BTESTR /TEST FOR /R
TAD (NL7777) /FORCE DEFAULT FILE LIST
DCA I (BFORCE) /IF NECESSARY
TAD BZIP /GET SECOND DEFAULT FILE
BTESTR, DCA BFILE2 /SETUP (OR ZERO) SECOND FILE
TAD I [SWMX] /CHECK FOR /R
AND [100] /JUST /R
SZA CLA /SKIP IF OFF
TAD (RMLIST-1) /PASS REPLACEMENT LIST ADDRESS IF ON
JMS I [BREPLC] /CALL ZAPPING ROUTINE
JMP I (BTESTF) /CONTINUE THERE
BREPLC, BTESTZ /REPLACEMENT ROUTINE; INITIALIZED FOR CONSOLE ZAPS
SNA /ANY LIST PASSED?
JMP I BREPLC /NO, FORGET IT
DCA BXR /YES, SAVE ZAP LIST ADDRESS
BREPL2, TAD I BXR /GET ADDRESS TO BE ZAPPED
SNA /END OF LIST?
JMP I BREPLC /YES, RETURN
DCA BZIP /NO, STASH THE ADDRESS
TAD I BXR /GET REPLACEMENT VALUE
DCA I BZIP /ZAP IT IN
JMP BREPL2 /KEEP GOING
/ CONSOLE OVERLAY REPLACEMENT LIST.
BCONLST,CHKJMP+VOFF2 /WAS "JMP I CTLCTST"
JMS INCON /MAKE IT CALL INPUT ROUTINE
PCHKKRS,CHKKRS+VOFF2 /WAS "KRSIOT" OR "KRBIOT"
CTLCTST&177+JMPIC /MAKE IT "JMP I CTLCTST"
P7JMP+VOFF2 /WAS "JMP P7AGN"
JMS OUTCON /MAKE IT CALL OUTPUT ROUTINE
P7TLS+VOFF2 /WAS "TLSIOT"
P7AGN&177+JMPC /MAKE IT "JMP P7AGN"
0000 /THIS ENDS THE LIST
PAGE
/ THE START SYSTEM PROGRAM STARTS HERE.
IFNZRO .&177
START= . /START SYSTEM STARTS HERE
PBFILE1,BFILE1-1 /POINTER TO DEFAULT FILE LIST; HERE IN CASE CHAINED TO
JMS I [TSTFLD] /TEST FOR STARTING FIELD
TAD I [SPARM] /GET STARTING ADDRESS
CMA /INVERT FOR TESTING
SNA /SKIP IF ANY WAS GIVEN
TAD (-200-1) /ELSE USE 000200 BY DEFAULT
CMA /NOW HAVE ORIGINAL OR 000200
DCA SYSTART+STRLOC /STORE STARTING ADDRESS
TAD BFIELD /GET STARTING FIELD
SNA /SKIP IF EXTENDED FIELD START
JMP STROK /JUMP IF NORMAL FIELD ZERO START
TAD (CIF CDF 00) /TURN INTO STARTING FIELD INSTRUCTION
DCA STFLD+STRLOC /STORE IN SYSTEM LOADER IMAGE
TAD SYSTART+STRLOC /GET STARTING ADDRESS
DCA I [SPARM] /STORE IN EQUALS PARAMETER WORD
TAD (SPARM&177+JMPIC) /MAKE IT DO
DCA SYSTART+STRLOC /"JMP I SPARM" INSTEAD
STROK, JMS I [GBUNIT] /GET BOOTSTRAP UNIT
TAD SFUN+STRLOC/[37^100] /ADD ON PAGE BITS
DCA SFUN+STRLOC /STORE IN SYSTEM LOADER IMAGE
JMS I [BMOVE] /\
STLOAD / \MOVE DOWN THE
SLOAD / /SYSTEM LOADER
SLOAD-SYSIO //
JMP I [SLOAD] /GO START IT UP
BTESTF, TAD I [SWAL] /CHECK FOR /F
AND [100] /AND ONLY /F
SZA CLA /SKIP IF OFF
TAD (HILIST-1) /GET REPLACEMENT LIST ADDRESS IF ON
JMS I [BREPLC] /CALL ZAPPING ROUTINE
BTESTP, TAD I [SWMX] /CHECK FOR /P
AND [400] /AND JUST /P
SNA CLA /SKIP IF SET
JMP BFILD /LOAD BINARY FILES
TAD I [SOUTFLS] /GET NUMBER OF OUTPUT FILES
SZA CLA /SKIP IF NONE
JMP BMVBIP /MOVE DOWN BIP OVERLAYS
TAD I [SWAL] /CHECK FOR /B OR /G
BFORCE, AND (2040) /**** /D OR /U **** NL7777
SNA CLA /SKIP IF DEFAULT FILES
JMP BLODE /JUST DO PAPER TAPE LOADING
TAD PBFILE1/(BFILE1-1) /POINT OUTPUT FILE HANDLER
DCA BFPTR /TO INTERNAL LIST
BMVBIP, TAD I [SOUTFLS] /GET NUMBER OF OUTPUT FILES AGAIN
TAD [SFILES-1] /MOVE UP TO POINT
DCA TXR /TO FIRST INPUT FILE
DCA I TXR /DESTROY INPUT FILES
NL0002 /SETUP "C" BIT MASK
AND I [SCRSIZE] /GET THE BIT
BMVZAP, SZA CLA /SKIP IF NO OVERLAY **** /F **** CLA!400
DCA I [CBPLIST] /PREVENT CONTROL CHARACTER DESTRUCTION
TAD (BPLIST-1) /GO DO
JMS I [BREPLC] /BIN ZAPS
JMS I (BCLEAR) /SETUP FOR BIN FILE
DCA BLDMZP /PREVENT BAD REAL DATA FIELD
BLDMOR, TAD BFIELD /GET OPTIONAL FIELD SWITCH
TAD BEXFLD /ADD ON CDF INSTRUCTION
DCA I (BMTEM+BPOFF) /PUT IN LOADER TEMPORARY FOR BIN OR RIM
BLDMZP, TAD I (BMTEM+BPOFF) /**** /P AND OUTPUT FILES **** 0000
DCA BEXFLD /PUT IT IN-LINE FOR RIM OR BIN LOADER
RDINIT, KCCIOT /**** /F **** RFC
TAD BINGO /GET OUR STARTING ADDRESS
DCA I (BLDST) /SETUP HALTING/CLEARING ROUTINE IN CASE /H OR /Z
BHZAP, SKP /**** /P AND NO FILES AND /H OR /Z **** 0000
JMP I [BFILIT] /CLEAR/HALT CORE BEFORE STARTING
BEXFLD, CDF 00+.-. /**** /P AND OUTPUT FILES **** 0000
JMP I BINGO /STARTUP BIN (OR RIM)
BLODE, ISZ BINGO /UPDATE STARTING ADDRESS
ISZ (BMTEM+BPOFF) /UPDATE POINTER
ISZ (BPAGE-SBOOT) /DONE YET?
JMP BLODE /NO, GO BACK
RIMZAP, SKP /**** /R **** 0000
ISZ BINGO /FIELD INTERCEPT ROUTINE NOT USED IF RIM LOADING
JMS I (SLURPREAD) /READ IN SLURP BLOCK TO GET THE BOOTSTRAP
JMS BINIT /INITIALIZE SLURP BOOTSTRAP
JMS I [BMOVE] /\
SLUPAGE / \
SBOOT / \
-BBLEN / \MOVE DOWN BOOTSTRAP AND
JMS I [BMOVE] / /THE BIN AND RIM LOADERS
BEGG+BPOFF / /
BEGG / /
BEGG //
NL7777 /INDICATE PAPER TAPE LOADING
JMS I [BHZ] /CHECK FOR /H OR /Z
JMP BLDMOR /GET STARTING FIELD AND BEGIN LOADING
BFILD, TAD I [SOUTFLS] /GET NUMBER OF OUTPUT FILES
TAD PSFILES/(SFILES) /MOVE UP POINTER
SMA /SKIP IF STILL SOME INPUT FILES
JMP BNOINF /ALL OUTPUT, NO INPUT
DCA BZIP /SAVE AS POINTER
TAD [SFILES-1] /SETUP THE
DCA TXR /INPUT POINTER
BFMLUP, TAD I BZIP /\
DCA I TXR / >MOVE DOWN THE INPUT FILES
ISZ BZIP //
JMP BFMLUP /GO BACK 'TIL DONE
DCA I TXR /SETUP INDICATOR
TAD I PSFILES/(SFILES) /GET FIRST INPUT FILE
SZA CLA /SKIP IF NONE
JMP BMOVEV /JUMP IF ANY
BNOINF, JMS I [BMOVE] /\
BFILE1 / \MOVE DOWN THE DEFAULT FILES (/B,
PSFILES,SFILES / //D, /G, /U, ETC. ALREADY DONE)
-3 //
BMOVEV, JMS I [BMOVE] /\
VPAGE / \MOVE DOWN
VLOAD / /V LOADER
VLOAD-VEND //
TAD I [SPARM] /GET EQUALS PARAMETER
CMA /INVERT FOR TESTING
SZA CLA /SKIP IF NO STARTING ADDRESS SPECIFIED
TAD BFIELD /GET FIELD SETTING
TAD (CIF CDF 00) /TURN INTO STARTING FIELD INSTRUCTION
DCA I [VCIF] /STORE IN /V LOADER
JMP I (BTESTW) /CONTINUE THERE
PAGE /END OF PAGE FOR NOW
/ THE GET SYSTEM PROGRAM STARTS HERE.
IFNZRO .&177
GET= . /GET SYSTEM STARTS HERE
B50, 50 /CONSTANT 0050; HERE IN CASE CHAINED TO
TAD I [SWAL] /GET /A-/L SWITCHES
AND (7727) /REMOVE /G, /I
TAD B50/(50) /FORCE THEM ON
DCA I [SWAL] /STORE BACK
NL7775 /SETUP MASK
AND I [SWMX] /SAVE ALL BUT /W
DCA I [SWMX] /STORE BACK
TAD I [SWY9] /GET /Y-/9 SWITCHES
AND (7003) /REMOVE /1-/7
DCA I [SWY9] /STORE BACK
TAD [SLOAD] /GET NEW STARTING ADDRESS
DCA I [SPARM] /FORCE START IN SYSTEM LOADER
JMP I CURORG/[BSTART] /GO STARTUP THE BIN SYSTEM
BTESTW, NL0002 /CHECK FOR /W
AND I [SWMX] /AND JUST /W
SZA CLA /SKIP IF NOT SET
JMP I (BSETPUNCHFLAG) /JUMP IF SET
TAD I [SWMX] /CHECK FOR /V
AND [4] /AND JUST /V
SZA CLA /SKIP IF NOT SET
JMP BSLSHV /JUMP IF SET
JMS SLURPREAD /READ IN SLURP LOADER
TAD I (SLPSA&177+SLUPAGE) /GET STARTING ADDRESS
SNA /SKIP IF A SLURP LOADER PRESENT
JMP BSLSHV /JUMP IF NOT
DCA BSLPGO /SAVE STARTING ADDRESS
TAD I [SWAL] /CHECK FOR /I
AND [10] /AND JUST /I
SNA CLA /SKIP IF ON
JMP BNOI /JUMP IF OFF
NL0002 /SETUP "C" BIT MASK
AND I [SCRSIZE] /GET THE "C" BIT
SNA CLA /SKIP IF OVERLAY ON
JMP ALLOWI /ELSE JUST ALLOW /I
TAD I [SWY9] /GET /Y-/9
AND (774) /JUST /1-/7
SNA CLA /SKIP IF ANY OF THESE SET
TAD I [SPARM] /ELSE GET EQUALS PARAMETER
TAD (-SLOAD) /COMPARE TO MAGIC VALUE
SZA CLA /SKIP IF IT MATCHES
JMP BSLSHV /ELSE FORGET IT
ALLOWI, DCA I (SFILES+20) /CLEAR LAST POTENTIAL FILE
TAD I BIPTR /GET A FILE
SNA CLA /END OF LIST?
JMP BFINDI /YES, GO STICK IT IN
ISZ BIPTR /BUMP TO NEXT
JMP .-4 /NO, GO BACK
BFINDI, JMS I [GBUNIT] /GET BOOTSTRAP UNIT
TAD IBLK/(IBLOCK) /ADD ON BLOCK BITS
DCA I BIPTR /PUT INTO FILE LIST
JMS CHEKST /CHECK IF PARAMETER PASSED
BISTRT /PUT IN THIS ADDRESS IF NONE
BNOI, TAD I (SPARM&177+SLUPAGE) /GET DEFAULT STARTING ADDRESS OF SLURP LOADER
DCA IBLK /STORE IN-LINE
JMS CHEKST /CHECK FOR LACK OF PARAMETER
IBLK, IBLOCK /WILL BE BERR WHEN NEEDED
JMS BINIT /INITIALIZE SLURP LOADER
JMS I [BMOVE] /\
SLUPAGE / \MOVE DOWN
SBOOT / /SLURP LOADER
SBOOT-SPARM //
TAD I [VCIF] /GET STARTING FIELD'S FINAL VALUE
DCA I (BCIF) /PUT IT INTO SLURP LOADER
BSLPSTA,/NL0000 /INDICATE WE ARE CALLING
JMS I [BHZ] /CHECK FOR /H OR /Z
JMP I BSLPGO /START THE SLURP OR /V LOADER
BSLSHV, JMS I [BMOVE] /\
VSLOAD / \MOVE DOWN THE
SWAL / /LAST I/O CALL
SWAL-SDATE //
JMS I [BMOVE] /\
SLVRES / \RESTORE CORE
SLOAD / /SAVE ABILITY
SLOAD-SYSIO //
JMS I [GBUNIT] /GET BOOTSTRAP UNIT
TAD I [SFUN] /ADD ON WRITE FUNCTION
DCA I [SFUN] /STORE IT BACK
JMS CHEKST /CHECK FOR STARTING ADDRESS
BISTRT /PUT IN THIS ADDRESS IF NONE
TAD (-VLOAD) /PREVENT DESTRUCTION OF
DCA I (BCLCNT+FIRELOC) /V IN CASE /H OR /Z
TAD (VLOAD) /UPDATE THE
DCA BSLPGO /STARTING ADDRESS
JMP BSLPSTART /NOW FINISH UP AS DID SLURP LOADER
CHEKST, .-. /CHECK FOR PASSED STARTING ADDRESS
TAD I [SPARM] /GET PARAMETER
CMA /INVERT FOR TESTING
SLSYSIO,SZA CLA /SKIP IF IT WAS DEFAULT
JMP CHKEXT /ELSE RETURN
TAD I CHEKST /GET NEW VALUE
DCA I [SPARM] /STORE IT
CHKEXT, ISZ CHEKST /BUMP PAST ARGUMENT
JMP I CHEKST /RETURN
SLURPRE,.-. /SLURP LOADER READ ROUTINE
JMS I [GBUNIT] /GET BOOTSTRAP UNIT
TAD [1^100] /ADD ON READ FUNCTION
DCA SLURFUN /STORE IN-LINE
JMS I SLSYSIO/(SYSIO) /CALL I/O ROUTINES
SLUPAGE /BUFFER
SLURFUN,.-. /FUNCTION WORD; UNIT BITS WILL BE FILLED IN
SLPBLK /BLOCK
SLMILP, TAD I (SFILES&177+SLUPAGE) /GET AN INITIALIZING WORD
DCA BINIT2 /STORE IT
ISZ .-1 /BUMP TO NEXT
ISZ (SFILES&177+SLUPAGE) /BUMP THE POINTER
ISZ (-BINITLN) /DONE YET?
JMP SLMILP /NO, KEEP GOING
JMP I SLURPREAD /YES, RETURN
BIPTR, SFILES /FILE POINTER TO FIND /I BLOCK SLOT
PAGE
BSETPUN,TAD I [SWAL] /GET /A-/L
AND [100] /JUST /F
SNA CLA /SKIP IF SET
JMP BTSTCONSOLE /JUMP IF NOT
PSF /FLAG UP?
PLS /NO, SET IT
JMP BPUN /CONTINUE THERE
BTSTCON,TSFIOT /FLAG UP?
SKP /SKIP IF NOT
JMP BPUN /JUMP IF SO
ISZ BZIP /WAIT FOR
JMP .-1 /AWHILE
ISZ BSCRIBE /WAITING LONG ENOUGH?
JMP BTSTCONSOLE /NO, KEEP WAITING
TLSIOT /YES, JUST SET THE FLAG
BPUN, DCA BCHECK /START PUNCH ROUTINE WITH CLEAR CHECKSUM
JMS BLEED /PUT IN A LEADER
BPUNLP, JMS I (VGIMME) /GET A WORD
JMP BTSTEOF /WORD IS OR FIELD
JMS BPUTWD /PUNCH DATA OR ORIGIN SETTING
JMP BPUNLP /KEEP GOING
BTSTEOF,SNL /SKIP IF FIELD SETTING
JMP BWEOF /JUMP IF
AND [70] /JUST FIELD BITS
BRMFLD, JMS BFRAME /**** /R **** SKP CLA
300 /PUNCH A FIELD SETTING
JMP BPUNLP /KEEP GOING
BWEOF, DCA RIMEND /PREVENT RIM PROBLEMS
TAD BCHECK /GET CHECKSUM
JMS BPUTWD /PUNCH IT
JMS BLEED /PUT OUT A TRAILER
JMP I [SBOOT] /BOOTSTRAP
BPUTWD, .-. /PUT A WORD ROUTINE
DCA BLEED /SAVE WORD
BPTRIM, NOP /**** /R **** JMP RIMCHK
SZL /SKIP IF DATA
TAD [100] /ADD ON ORIGIN FLAG
DCA BCODE /SAVE FLAG VALUE
RIMOUT, TAD BLEED /GET PASSED WORD
RIMOT2, JMS BOUTPUT /PUNCH IT OUT
JMP I BPUTWD /RETURN
RIMCHK, SZL /DATA?
JMP SETORG /NO, HANDLE ORIGIN SETTING
TAD [100] /YES, SETUP AUTO-ORIGIN
DCA BCODE /TO CURRENT LOCATION
TAD RNEWLOC /GET CURRENT VALUE
JMS BOUTPUT /OUTPUT IT
ISZ RNEWLOC /BUMP TO NEXT
B15, 15 /CONSTANT 0015; HERE IN CASE IT SKIPS
RIMEND, JMP RIMOUT /**** **** 0000
TAD BCHECK /GET UPDATED CHECKSUM VALUE
JMP RIMOT2 /GO OUTPUT THAT VALUE INSTEAD OF PREVIOUS
SETORG, TAD BLEED /GET LATEST VALUE
DCA RNEWLOC /SAVE AS CURRENT ORIGIN
JMP I BPUTWD /DON'T PUNCH IT, JUST RETURN
BOUTPUT,.-. /WORD OUTPUT ROUTINE
DCA BZIP /SAVE PASSED VALUE
TAD BZIP /GET IT BACK
RTR;RTR;RTR /GET HIGH-ORDER HALF
JMS BFRAME /OUTPUT IT
BCODE, .-. /100=ORIGIN, 000=DATA
TAD BZIP /GET LOW-ORDER HALF
JMS BFRAME /OUTPUT IT
000 /ALWAYS 0000
DCA BCODE /CLEAR FOR OTHERS
JMP I BOUTPUT /RETURN
BFRAME, .-. /PAPER TAPE OUTPUT
AND [77] /JUST 6-BIT
TAD I BFRAME /GET CODE (ORIGIN, ETC.)
DCA FLAGS /SAVE TEMPORARILY
TAD FLAGS /GET IT BACK
TAD [7600] /CHECK IF WE CHECKSUM
SPA CLA /SKIP IF NO
TAD FLAGS /ADD IT IN IF YES
TAD BCHECK /GET CURRENT CHECKSUM ALSO
DCA BCHECK /SAVE IT BACK
PUNLUP, JMS I (CHKUP) /CHECK FOR <^C>, ETC.
TAD FLAGS /RESTORE AC
LOPUN, TSFIOT /**** /F **** PSF
JMP PUNLUP /CHECK WHILE WAITING
TLSIOT /**** /F **** PLS
JMS I (CHKUP) /CHECK FOR <^C>, ETC.
JMP I BFRAME /EXECUTE HARMLESS ARGUMENT AND RETURN
BLEED, .-. /LEADER/TRAILER ROUTINE
TAD BTSTEOF/(-360) /SETUP FOR 2 FOOT LEADER
DCA BCODE /SAVE AS COUNTER
JMS BFRAME /PUNCH 1 FRAME
200 /OF LEADER TRAILER
ISZ BCODE /DONE YET?
JMP .-3 /NO, GO BACK
JMP I BLEED /YES, RETURN
BSCRIBE,-12 /SCRIBE ROUTINE; INITIALIZED FOR PUNCH TIME OUT
TAD B15/("M&37) /\
JMS I (P7CH+VOFF2) / \PRINT A
TAD ["J&37] / /AND A
JMS I (P7CH+VOFF2) //
BCHRLP, TAD I BSCRIBE /GET THE FIRST PAIR
RTR;RTR;RTR /GET HIGH-ORDER HALF
JMS BCROUT /OUTPUT IT
TAD I BSCRIBE /GET THE PAIR AGAIN
ISZ BSCRIBE /PUSH UP POINTER FOR NEXT PAIR
JMS BCROUT /OUTPUT LOW-ORDER HALF
JMP BCHRLP /DO NEXT PAIR
BCROUT, .-.
AND [77] /JUST SIX-BIT
SNA /SKIP ON GOOD CHARACTER
JMP I BSCRIBE /WE FOUND THE END OF MESSAGE
TAD [40] /\
AND [77] / >CONVERT TO SEVEN BIT ASCII
TAD [40] //
JMS I (P7CH+VOFF2) /PRINT IT
JMP I BCROUT /RETURN
PAGE
BHZ, .-. /ROUTINE TO CHECK /H OR /Z
DCA BZIP /SAVE CALL INDICATOR
BHSET, JMP BCTFLD /**** NOT /H **** 0000
BZSET, JMP I BHZ /**** /Z **** 0000
DCA BFILL+FIRELOC /ZERO CORE INSTEAD OF HALTING IT
JMP BCTFLD /GO DO IT
BZOOM, JMS I [CHKUP+VOFF2] /CHECK FOR <^C> PERIODICALLY
BNXFLD, CDF 10 /GOTO NEXT FIELD
TAD BFILL+FIRELOC /\
DCA I BCORPT+FIRELOC / \FILL A FIELD WITH
ISZ BCORPT+FIRELOC / /7402/0000 'TIL DONE
JMP .-3 //
TAD BNXFLD /\
TAD [10] / >SETUP FOR NEXT FIELD
DCA BNXFLD //
CDF 00 /DO THIS NOW TO PREVENT HAVOC LATER
BCTFLD, ISZ BCORCNT /DONE ALL FIELDS?
JMP BZOOM /NO, GO BACK AND DO ANOTHER
ISZ BZIP /WHO CALLED?
JMP BFLEND /FINISH UP FOR FILE LOADING
TAD BFIELD /GET OPTIONAL FIELD SWITCH
TAD BHZCDF+FIRELOC /ADD ON CDF INSTRUCTION
DCA BHZCDF+FIRELOC /PUT IN LINE FOR LATER
DCA BFLNDZP /DON'T STARTUP YET
BMVCLR, JMS I [BMOVE] /\
BFILL+FIRELOC / \MOVE DOWN ROUTINE TO
BFILL / /CLEAR/HALT FIELD ZERO
BFILL-SBOOT //
BFLNDZP,JMP I [BFILIT] /**** /P AND NO OUTPUT FILES **** 0000
DCA I (BHZAP) /MAKE IT DO SO LATER
JMP I BHZ /JUST RETURN NOW
BFLEND, DCA I ENDFLD/(VLOAD) /IN CASE /V
TAD BSLPGO /GET PROPER STARTING ADDRESS
DCA BLDST+FIRELOC /FOR THE CORRECT FILE LOADER
JMP BMVCLR /CONTINUE THERE
TSTFLD, .-. /TEST FOR /1-/7
TAD I [SWY9] /Y, /Z, /0-/9
CLL RTL /INITIALIZE FOR SHIFT
NXTFLD, RAL /SHIFT NEXT TEST BIT
SPA /THIS ONE SET?
JMP ENDFLD /YES
ISZ BFIELD /DONE ALL YET?
JMP NXTFLD /NO, GO BACK
ENDFLD, CLA /CLEAN UP
TAD BFIELD /GET COUNT
AND [7] /JUST GOOD BITS
CLL RTL /MOVE UP
RAL /TO FIELD BITS
DCA BFIELD /SAVE IT
JMP I TSTFLD /RETURN
/ BINARY PAPER TAPE TO OUTPUT FILES REPLACEMENT LIST.
BPLIST, BIPZP1+BPOFF; JMP I [BINEND]/FINISH UP WITH CHECKSUM IN AC
BIPZP2+BPOFF; JMP I [BININT]/OUTPUT PREVIOUS WORD
RIMZP1+BPOFF; JMP I [RIMINT]/OUTPUT LATEST WORD IF /R
RIMZP2+BPOFF; JMP I [RIMLED]/INTERCEPT LEADER/TRAILER IF /R
CBPLIST,CTLZP1; CLA!400 /MAKE IT IGNORE <^S> **** ZAPPED **** 0000
CTLZP2; CTLXIT&177+JMPC /MAKE IT IGNORE <^C>
0000 /END OF PAPER TAPE CHANGE LIST
/ RIM FORMAT REPLACEMENT LIST.
RMLIST, BRMFLD; SKP CLA /NO FIELD SETTINGS ON RIM TAPE
BPTRIM; RIMCHK&177+JMPC /AUTO-ORIGIN ENABLE
BINGO; BWORD2+BPOFF /USE RIM STARTING ADDRESS
RIMZAP; 0000 /ALLOW NORMAL RIM LOADER IF NEEDED
0000 /THIS ENDS THE LIST
/ HIGH-SPEED READER/PUNCH REPLACEMENT LIST.
HILIST, RDINIT; RFC /WAS "KCCIOT"
BNREAD+1+BPOFF; RSF /WAS "KSFIOT"
BNREAD+3+BPOFF; RFC RRB /WAS "KRBIOT"
BBEGIN+BPOFF; RFC /WAS "KCCIOT"
RIMBEG+BPOFF; RFC /WAS "KCCIOT"
RIMBG1+BPOFF; RSF /WAS "KSFIOT"
RIMBG1+2+BPOFF; RFC RRB /WAS "KRBIOT"
RIMZP2+2+BPOFF; RSF /WAS "KSFIOT"
RIMZP2+4+BPOFF; RRB /WAS "KRSIOT"
LOPUN; PSF /WAS "TSFIOT"
LOPUN+2; PLS /WAS "TLSIOT"
BMVZAP; CLA!400 /PREVENT CONTROL CHARACTER DESTRUCTION
0000 /END OF "/F" LIST
HERE, PAGE /END OF PAGE FOR NOW
*HERE /RESET ORIGIN
HERE, RELOC SBOOT-13 /WHERE THIS ULTIMATELY EXECUTES
FIRELOC=HERE-. /RELOCATION FACTOR FOR FILL ROUTINE
BFILL, HLT /**** /Z **** 0000
BCORPT, 0000 /FILLING POINTER
BCLCNT, -. /**** /V **** -VLOAD
ISZ BCORPT /BUMP TO NEXT
BFILIT, TAD BFILL /GET FILLER WORD
DCA I BCORPT /STORE IT
ISZ BCLCNT /DONE ALL YET?
JMP BFILIT-1 /NO, GO BACK
BHZCDF, CDF 00 /**** /P AND NO OUTPUT FILES AND /1-/7 **** CDF 10-70
JMP I BLDST /STARTUP THE APPROPRIATE LOADER, ETC.
BLDST, BAUTO+BPOFF /P AND FILES STARTUP ADDRESS
/**** /P AND /R AND OUTPUT FILES **** BWORD2+BPOFF
/**** /P AND NO OUTPUT FILES **** BAUTO
/**** /P AND /R AND NO OUTPUT FILES **** RIMBEG
/**** FILE LOADING **** BREAD
/**** /V FILE LOADING **** VLOAD
SBOOT, RELOC .+FIRELOC /RESTORE OUR ORIGIN
PAGE
BPAGE= . /BINARY (PAPER TAPE) LOADER PAGE
BMOVE, .-. /MOVE ROUTINE
NL7777 /BACK UP FOR AUTO INDEX
TAD I BMOVE /GET FIRST ARGUMENT
DCA TXR /SET UP FROM INDEX REGISTER
ISZ BMOVE /PUSH UP POINTER
NL7777 /BACK UP FOR AUTO INDEX
TAD I BMOVE /GET SECOND ARGUMENT
DCA BXR /SET UP TO INDEX REGISTER
ISZ BMOVE /PUSH UP POINTER
TAD I BMOVE /GET THIRD ARGUMENT
DCA BZIP /SET UP TWO'S COMPLEMENT COUNT
ISZ BMOVE /PUSH UP POINTER FOR THE RETURN
BMOVLP, TAD I TXR /GET A WORD
DCA I BXR /NOW PUT IT AWAY
ISZ BZIP /DONE YET?
JMP BMOVLP /NO, GO DO SOME MORE
JMP I BMOVE /YES, RETURN
BFLDCHK,.-. /FIELD SETTING ROUTINE
TAD BMTEM+BPOFF /GET POTENTIAL FIELD SETTING
SNA CLA /SKIP IF PRESENT
JMP I BFLDCHK /ELSE RETURN
JMS I [DANGIT] /CHECK IF ROOM STILL EXISTS
NL0001 STL /SET FIELD BITS
DCA EOFBIT /SAVE IN FIELD FLAG
TAD BMTEM+BPOFF /GET THE NEW FIELD SETTING
DCA CURFLD /STASH IT
TAD CURFLD /GET IT BACK
JMS I [BINOUT] /PUNCH IT WITH LINK ON
DCA EOFBIT /RESET THE FLAG
DCA BMTEM+BPOFF /ZERO THE FIELD SETTING
JMP I BFLDCHK /RETURN
GBUNIT, .-. /GET BOOTSTRAP UNIT ROUTINE
TAD I [SBTFUN] /GET THE BOOTSTRAP UNIT WORD
AND [7] /ISOLATE THE UNIT BITS
JMP I GBUNIT /RETURN
ZBLOCK BPAGE+BBLEN-. /EMPTY SPACE
/ THE FIRST 43 WORDS OF THE SLURP LOADER (FOR USE AS A BOOTSTRAP), ALONG
/ WITH THE REST OF THIS PAGE WILL BE MOVED TO 007600 FOR PAPER TAPE
/ STAND-ALONE OPTIONS (/P, /R, ETC.).
BHERE, RELOC .-BPAGE+SBOOT /WHERE THIS WILL BE LOADED
BPOFF= BHERE-. /RELOCATION FACTOR FOR PAPER TAPE LOADER
/DEC PAPER TAPE BINARY AND RIM LOADERS FOR PAPER TAPE INPUT ZAPPED FOR BIP
/(OR RIP) AS NECESSARY.
/ROUTINE TO EXTRACT ERRORS, FIELD SETTINGS, AND LEADER/TRAILER
BEGG, .-. /HISTORICAL NAME
BEGG1, JMS BNREAD /GET A FRAME
TAD BNHLT /TEST FOR A
SPA SNA CLA /SKIP IF YES
BNLINE, JMP BGOOD /JUMP IF NO
TAD BNLINE /GET CURRENT INSTRUCTION
CIA /INVERT
TAD BMAGIC /ADD ON SUM OF BOTH
DCA BNLINE /STORE IT BACK
JMP BEGG1 /GET MORE CHARACTERS
BGOOD, TAD BCHAR /\
AND BN300/(300) / \
TAD BN7600/(-200) / >CHECK FOR DATA OR ORIGIN, INCREMENT RETURN IF SO
SPA / /
ISZ BEGG //
SPA SNA CLA /RETURN IF NOT FIELD SETTING
JMP I BEGG /RETURN IF LEADER/TRAILER, SKIP RETURN IF DATA OR ORIGIN
TAD BCHAR /\
BN300, AND BFMASK/(70) / \
TAD BNCDF/(CDF) / >PROCESS FIELD SETTINGS
DCA BMTEM / /
JMP BEGG1 //
BNREAD, .-. /INPUT ROUTINE
KSFIOT /**** /F **** RSF
JMP .-1 /WAIT FOR INPUT
KRBIOT /**** /F **** RFC RRB
DCA BCHAR /SAVE FRAME
TAD BCHAR /GET IT BACK
JMP I BNREAD /RETURN
IFNZRO .&177-100
BFMASK, 70 /HARMLESS AND
BNCDF, CDF 00 /CDF CONSTANT
BEND, JMS BASEMB /TRAILER FOUND, ASSEMBLE LAST WORD
CIA /INVERT FOR CHECKSUM COMPARISON
BIPZP1, TAD BCHKSM /**** /P AND FILES **** JMP I [BINEND]
BNHLT, HLT /AC EQUALS ZERO IF NO ERRORS
BBEGIN, KCCIOT /**** /F **** RFC
BN7600, 7600 /CLEAN UP IN CASE HSR:
RDF /\
TAD BNCDF/(CDF) / >SETUP INITIAL LOADING FIELD
DCA BMTEM //
BAUTO, JMS BEGG /GET A FRAME
JMP .-1 /IGNORE LEADER
BEGO, DCA BCHKSM /ZERO CHECKSUM, ADD ON IF RE-ENTERED
TAD BMTEM /SET UP
DCA BLODIT /DESIRED FIELD
TAD BCHAR /SAVE AS
DCA BWORD1 /FIRST FRAME
JMS BNREAD /GET NEXT
DCA BWORD2 /SAVE AS SECOND FRAME
JMS BEGG /GET NEXT FRAME
JMP BEND /TRAILER, GO FINISH UP
BIPZP2, JMS BASEMB /**** /P AND FILES **** JMP I [BININT]
BLODIT, HLT /CDF INTO LOADING FIELD
SNL /SKIP IF ORIGIN SETTING
DCA I RORG /STORE THE WORD IF DATA
ISZ RORG /PUSH POINTER
SZL /NO NOP NEEDED; SKIP IF ORIGIN
DCA RORG /SAVE ORIGIN
BCHEX, TAD BWORD1 /NOT RICE, CORN OR WHEAT
TAD BWORD2 /ADD LATEST WORDS
TAD BCHKSM /AND CHECKSUM
JMP BEGO /ACCUMULATE AND DO NEXT
BASEMB, .-. /ASSEMBLE A WORD FROM 2 FRAMES
TAD BWORD1 /GET FIRST FRAME
CLL RTL /\
RTL / >SHIFT LEFT 6
RTL //
TAD BWORD2 /ADD ON SECOND FRAME
JMP I BASEMB /RETURN
BCHAR, .-. /INPUT BUFFER
BMTEM, .-. /FIELD TEMPORARY
BCHKSM, .-. /CHECKSUM
BMAGIC, BGOOD&177+BEGG1-SBOOT+JMPC+JMPC /SUM OF FLIP-FLOPPING INSTRUCTIONS
BWORD1, .-. /FRAME 1 TEMPORARY
BWORD2, JMS I [BFLDCHK] /FRAME 2 TEMPORARY; INITIALIZED FOR
/RIM LOADER FIELD CHECK IF INTERCEPTING
/RIM INPUT AND OUTPUTTING TO FILES
/ THE RIM LOADER FOLLOWS.
/ LOW OR HIGH-SPEED RIM LOADER.
RIMBEG, KCCIOT /**** /F **** RFC
RIMBG1, KSFIOT /**** /F **** RSF
JMP RIMBG1 /WAIT FOR DEVICE
KRBIOT /**** /F **** RFC RRB
CLL RTL /MOVE HIGH-ORDER OF FRAME
RTL /INTO HIGH-ORDER BITS
SPA /SKIP IF NOT LEADER/TRAILER
RIMZP2, JMP RIMCLR /**** /P /AND /R AND FILES **** JMP I [RIMLED]
RTL /MOVE FRAME INTO HIGH-ORDER SIX BITS
KSFIOT /**** /F **** RSF
JMP .-1 /WAIT FOR DEVICE
KRSIOT /**** /F **** RRB
RIMZP1, SNL /**** /P AND /R AND FILES **** JMP I [RIMINT]
DCA I RORG /LOAD A WORD
RIMCLR, DCA RORG /SET UP ORIGIN SETTING
RIMRET, JMP RIMBEG /GO BACK FOR MORE
RORG, .-. /LOCATION COUNTER FOR RIM
JMP BBEGIN /START BINARY LOADER
RELOC .-BEGG+BHERE /RESTORE OUR ORIGIN
/ RIM LOADER COMES HERE IF ZAPPED FOR RIM TO P?S/8 CONVERSION.
RIMINT, DCA RNEWLOC /SAVE LATEST DATA WORD
DCA RLDRZP /PROVE WE'VE BEEN HERE BEFORE
SNL /LINK=1 IF ORIGIN SETTING
JMP RDATA /DATA WORD TO BE LOADED
TAD ROLDLOC /\
CMA / >IS NEW ORIGIN ONE MORE THAN OLD ORIGIN?
TAD RNEWLOC //
SNA CLA /SKIP IF NOT
JMP RNXTORG /JUMP IF IT IS
TAD RNEWLOC /SET UP NEXT
DCA ROLDLOC /ORIGIN COMPARISON
JMS I [DANGIT] /CHECK FOR END OF ROOM
STL /INDICATE ORIGIN
SKP /CHECKED ALREADY BUT LINK IS SET FOR SURE
RDATA, JMS I [DANGIT] /CHECK FOR END OF ROOM
TAD RNEWLOC /LINK IS CLEAR IF DATA, SET IF ORIGIN
JMS I [BINOUT] /PUT IN A GOOD WORD
JMP I RRMRET /RETURN TO RIM LOADER
RNXTORG,TAD RNEWLOC /SET UP NEXT
DCA ROLDLOC /ORIGIN COMPARISON
RIMBAK, JMP I RRMRET /RETURN TO RIM LOADER
/ RIM LOADER COMES HERE ON LEADER/TRAILER IF RIM TO P?S/8 MODE.
RIMLED, CLA /THROW AWAY LEADER
RLDRZP, JMP I RRMRET /**** LEADER AND OTHER DATA FOUND **** 0000
TAD RIMBAK /RESTORE
DCA RLDRZP /INSTRUCTION
JMP RFLCLS /FINISH UP
/ BIN LOADER COMES HERE IF ZAPPED FOR BIN TO P?S/8 CONVERSION.
BININT, JMS I [BFLDCHK] /ONCE ONLY
DCA BININT /DESTROY CALL
JMS I [DANGIT] /CHECK FOR END OF ROOM
JMS I (BASEMB+BPOFF) /ASSEMBLE THE WORD
JMS I [BINOUT] /PUNCH OUT THE WORD
JMS I [BFLDCHK] /CHECK FOR NEW FIELD SETTING
JMP I (BCHEX+BPOFF) /GO BACK FOR MORE
BINEND, TAD I (BCHKSM+BPOFF) /ADD ON ACCUMULATED COUNT
SZA CLA /SKIP COMPLAINT ON ZERO CHECKSUM
JMP BADSUM /BAD CHECKSUM
RFLCLS, JMS I [BSCRIBE] /TELL ALL THE PEOPLE THAT YOU SEE
TEXT "DISABLE READER!"
JMS I [BSCRIBE] /FOLLOW ME, FOLLOW ME DOWN
TEXT "MORE TAPES?"
WAITIN, JMS I [CHKUP+VOFF2] /GET A CHARACTER
TAD I (INCHAR+VOFF2) /GET THE INPUTTED VALUE
TAD (-"Y!200) /COMPARE TO "Y"
SZA /SKIP IF YES
JMP BTRYNO /MAYBE NO
JMS I [BSCRIBE] /SAY "YES"
TEXT "YES" /YES
JMP I (RDINIT) /RESTART BIN OR RIM
BTRYNO, TAD (-"N+"Y) /TRY "N"
SZA CLA /SKIP IF NO
JMP WAITIN /TRY YES AGAIN
JMS I [BSCRIBE] /SAY "NO!"
TEXT "NO!" /NO!
CLA CLL IAC /END OF FILE
DCA EOFBIT /TO FLAG
JMS I [BINOUT] /\
ISZ DANGER / >WRITE OUT A FILE
JMP .-2 //
JMS I [BSCRIBE] /TELL HOW MANY FILES
BFLNUM, TEXT " 0 FILES CREATED."
BTESTG, TAD I [SWAL] /\
AND [40] / \GO FURTHER
SNA CLA / /IF /G OPTION SET
JMP I [SBOOT] //
TAD I [SWMX] /\
AND (-400-1) / >DESTROY PAPER TAPE SWITCH /P
DCA I [SWMX] //
DCA I [SOUTFLS] /DESTROY OUTPUT FILES SO THEY ARE INPUT FILES
ISZ BFPTR /BUMP PAST LAST FILE USED
DCA I BFPTR /CREATE END OF LIST
TAD BFPTR /GET THE POINTER
SMA SZA CLA /SKIP IF USING PASSED FILES
TAD (BFILE1-SFILES) /ELSE USE DEFAULT LIST
TAD [SFILES-1] /USE FILE LIST ADDRESS
DCA BFPTR /SETUP THE INPUT POINTER
TAD [SFILES-1] /SETUP THE
DCA BXR /OUTPUT POINTER
BGLOOP, ISZ BFPTR /BUMP TO NEXT FILE
TAD I BFPTR /GET A FILE ARGUMENT
SNA /END OF LIST?
JMP BGEND /YES, FINISH UP
DCA I BXR /NO, STASH IT IN NEW LIST
JMP BGLOOP /KEEP GOING
BGEND, DCA I BXR /CREATE FINAL END OF LIST
JMP I [SLOAD] /BACK TO THE SYSTEM LOADER
BADSUM, JMS I [BSCRIBE] /COMPLAIN OF
TEXT "CHECKSUM ERROR!" /CHECKSUM ERROR
JMP I [SBOOT] /BOOTSTRAP
ROLDLOC,.-. /RIM LOADER OLD LOCATION COUNTER
PAGE
BINOUT, .-. /BINARY OUTPUT OF P?S FILES
DCA BZIP /SAVE PASSED ARGUMENT
TAD EOFBIT /CHECK FOR FIELD OR ORIGIN
BS1, SZA CLA /SKIP IF ORIGIN
JMP BNCOMN /FIELD SETTING
TAD BZIP /UPDATE TO
SZL /SKIP IF NOT ORIGIN
DCA CURORG /NEW ORIGIN
SNL CLA /SKIP IF ORIGIN
ISZ CURORG /INCREMENT ORIGIN FOR NEW DATA
BC1, "E-300^100+" -200 /HARMLESS AND JUST IN CASE IT SKIPS
BNCOMN, TAD BZIP /GET BACK ARGUMENT
DCA I BXR /PUT INTO BUFFER
TAD FLAGS /\
RTL / \UPDATE FLAGS
TAD EOFBIT / /ACCORDINGLY
DCA FLAGS //
SNL /DONE SIX YET?
JMP BNOXIT /NO, JUST RETURN
TAD BXR /\
TAD (7772) / \
DCA BZIP / >PUT AWAY COMPLETE FLAG WORD
TAD FLAGS / /
DCA I BZIP //
ISZ BXR /BUMP PAST NEXT FLAG WORD
ISZ GRPCNT /DONE A WHOLE BLOCK (22 GROUPS) YET?
JMP NEWFLG /NO
ISZ BXR /BUMP PAST
ISZ BXR /TWO DUMMY WORDS
TAD [-22] /RESET
DCA GRPCNT /GROUP COUNT
ISZ BLKCNT /DONE A WHOLE FILE (20 BLOCKS) YET?
JMP NEWFLG /NO
ISZ BFPTR /BUMP TO NEXT FILE
TAD I BFPTR /GET IT
AND (7770) /JUST BLOCK BITS
SNA /
JMP TOMANY /YES, COMPLAIN
DCA BBLOCK /SAVE IN-LINE
TAD I BFPTR /GET UNIT BITS
AND [7] /MASK 'EM OFF
TAD (20^100+WRITE) /ADD ON WRITE 20 BLOCKS
DCA BWRFUN /PUT IN CALL
JMS I BS1/(SYSIO) /\
BFLSPC, FILBEG / \WRITE
BWRFUN, 20^100+WRITE+.-. / /1 FILE
BBLOCK, BINADR //
ISZ BNMFLS /SKIP IF FIRST FILE
TAD ("S-" -100) /ELSE ADD ON "S"
TAD BC1 /TO BLURB
DCA I (BFLNUM+3) /PUT IN NICE MESSAGE
ISZ I (BFLNUM) /\
TAD I (BFLNUM) / \
AND [12] / \
TAD (-12) / \UPDATE NUMBER
SNA CLA / /OF OUTPUTTED FILES
TAD (2066) / /
TAD I (BFLNUM) / /
DCA I (BFLNUM) //
NEWFLG, NL0001 /RESET FLAGS
DCA FLAGS /IRRELEVANT IF JUST WRITING OUT FILE
BNOXIT, TAD I [CBPLIST] /GET POSSIBLY ZAPPED VALUE
SNA CLA /SKIP IF NOT ZAPPED
JMS I [CHKUP+VOFF2] /WE CAN CHECK FOR <^C>, ETC.
JMP I BINOUT /RETURN
TOMANY, JMS I [BSCRIBE] /COMPLAIN OF
TEXT "TOO BIG" /BINARY OVERFLOW
JMP I [SBOOT] /BOOTSTRAP
DANGIT, .-. /ROUTINE TO CHECK FOR IMPENDING DISASTER
ISZ DANGER /IS DANGER AT THE DOOR?
JMP I DANGIT /NO, JUST RETURN
CLA CLL IAC /SET BIT
DCA EOFBIT /INTO FLAG
JMS BINOUT /PUNCH FINAL WORD AS
JMS BCLEAR /SETUP FOR NEXT FILE
JMP DANGIT+1 /TRY AGAIN
BCLEAR, .-. /CLEAR ROUTINE TO INITALIZE FILES
DCA EOFBIT /ZERO FLAG
TAD BFLSPC /RESET INDEX
DCA BXR /REGISTER AGAIN
TAD (200) /PUT IN
DCA I BXR /*200
TAD CURFLD /PUT IN
DCA I BXR /FIELD (UPDATED FROM PREVIOUS FILE)
TAD CURORG /PUT OUT THE
DCA I BXR /NEW-OLD ORIGIN
TAD (-20) /RESET
DCA BLKCNT /BLOCK COUNT
TAD [-22] /RESET
DCA GRPCNT /GROUP COUNT
TAD (4503) /RESET
DCA DANGER /DANGEROUS COUNT
TAD (0156) /INDICATE BINARY
DCA FLAGS /WORDS SO FAR
JMP I BCLEAR /RETURN
/ LOAD UNIT FIXUP LIST FOR VIRTUAL LOADER.
VUNLST, VMFUN+VSOFF /RELOAD SCRATCH AREA
VWDCNT+VOFF1 /INITIALIZE SCRATCH AREA TO 0000 OR 7402
BLKCNT, VBFUN+VOFF2 /VIRTUAL WRITE ROUTINE
GRPCNT, VBFUN2+VOFF2 /VIRTUAL READ ROUTINE
BNMFLS, -1 /FILE COUNT; THIS ENDS THE LIST
VSLOAD, PAGE /END OF PAGE FOR NOW
/ VIRTUAL LOADER RELOAD ARGUMENTS.
*VSLOAD /RESET ORIGIN
VSLOAD, RELOC SWAL /WHERE THIS GOES LATER
SWAL, VSOFF= VSLOAD-SWAL /RELOCATION DEFINITION
VMCORE, VOUTBF /READ INTO HERE
VMFUN, SBOOT-VOUTBF%200^100+.-./UNIT BITS WILL BE FILLED IN
VMBLOCK,.-./BINBLK+BINLEN /WILL BE FIRST VIRTUAL BLOCK
JMP VST /GO FINISH IT THERE
RELOC VSOFF+. /RESTORE OUR ORIGIN
/ SYSTEM LOADER IMAGE.
SLVRES, RELOC SLOAD /IMAGE OF SYSTEM LOADER
SLOAD, JMS SYSIO /CALL I/O ROUTINES
SCORE, 0000 /TRANSFER ADDRESS
SFUN, WRITE+.-. /UNIT BITS WILL BE FILLED IN
SBLOCK, BINADR /WRITE INTO BINARY SCRATCH AREA
JMP I SYSTART /GO START IT UP
SYSTART,SBOOT /THROUGH HERE
RELOC .-SLOAD+SLVRES /RESTORE OUR ORIGIN
PAGE
/ /V OPTION CORE IMAGE BINARY LOADER.
/ THE /V OPTION ALLOWS DEVICE-INDEPENDENT BINARY LOADING BY CREATING A CORE
/ IMAGE ON THE MASS-STORAGE DEVICE OF THE CODE CORRESPONDING TO THE AREAS OF
/ MEMORY FORBIDDEN TO DIRECT LOADING DUE TO BOOTSTRAP CONVENTIONS AND THE
/ LOADER ITSELF; ALL OTHER LOCATIONS ARE DIRECTLY LOADABLE INCLUDING ALL OF
/ FIELDS 1-7.
/ VIRTUAL LOADER RESTRICTIONS.
/ THE LOADER DOES NOT CHECK IN EXTENDED MEMORY FOR OVERLAYS, EXTENDED HANDLERS,
/ ETC., SO THE USER MUST PREVENT ACCIDENTAL LOADING OVER THESE AREAS. LOCATIONS
/ 007600-007777 ARE NOT LOADED DIRECTLY. HOWEVER, THAT DATA IS AVAILABLE ON THE
/ MASS STORAGE DEVICE (AT BLOCK "BINBLK+BINLEN+12"). THE FOLLOWING CODE IS AN
/ EXAMPLE OF A WAY TO RETRIEVE IT:
VPAGE, NOPUNCH /FOOL THE ASSEMBLER
*6000 /ARBITRARY STARTING ADDRESS
COUNT, SBOOT /CLEANS UP AC, ALSO USED AS A COUNTER/POINTER
TAD I (SWMX) /GET SYSTEM LOAD FUNCTION WORD
AND (7) /JUST UNIT BITS
TAD (1^100+UFLD) /MAKE INTO ONE PAGE READ INTO FIELD ZERO
DCA UFUN /STORE IN-LINE
TAD I (SWY9) /GET SYSTEM LOAD BLOCK NUMBER
TAD (SBOOT-VOUTBF%200) /ADD ON OFFSET
DCA UBLK /STORE IN-LINE
JMS I (SYSIO) /CALL I/O ROUTINES
UCORE, UBUFF /PASS BUFFER ADDRESS
UFUN, 1^100+UFLD+.-. /UNIT BITS FILLED IN
UBLK, .-. /BLOCK FILLED IN
UMOVE, CDF UFLD /GOTO BUFFER FIELD
TAD I UCORE /GET A WORD
CDF 00 /BACK TO OUR FIELD
DCA I COUNT /PUT A WORD
ISZ UCORE /BUMP TO NEXT
ISZ COUNT /DONE ALL YET?
JMP UMOVE /NO, GO BACK
/ 007600-007777 NOW CONTAINS USER CODE; SYSTEM I/O ROUTINES ARE DESTROYED!
UBUFF= 7000 /ARBITRARY USER BUFFER ADDRESS
UFLD= 0070 /ARBITARY USER FIELD
PAGE /DUMP LITERALS NOW
/ THIS COMPLETES LOADING OF 007600-007777. NOTICE THAT THIS REQUIRES A ONE
/ PAGE BUFFER SUPPLIED BY THE USER. THE SYSTEM I/O ROUTINES ARE DESTROYED
/ IN THE PROCESS AS THEY ARE THE FORMER OCCUPANTS OF 007600-007777!
/ NOTE: IT IS POSSIBLE TO OVERLAY THE SYSTEM I/O ROUTINES DIRECTLY, BUT THIS
/ IS TO BE DISCOURAGED BY ANYONE OTHER THAN A P?S/8 SYSTEMS PROGRAMMER
/ THOROUGHLY FAMILIAR WITH THE PARTICULAR COPY OF THE SYSTEM I/O ROUTINES
/ IN USE AT THE TIME, AS ANY OTHER ATTEMPT TO DO THIS WILL MOST CERTAINLY
/ FAIL (THIS DOES NOT IMPLY THAT A P?S/8 SYSTEMS PROGRAMMER WILL NECESSARILY
/ SUCCEED (MARIO DENOBILI)!)
/ VIRTUAL LOADER CORE LAYOUT FOR FIELD ZERO.
/ 000000-005177 ------------------------ FREE FOR NORMAL LOADING
/ 005200-005377 BLOCK BINBLK+BINLEN+00 OUTPUT BUFFER
/ 005400-005577 BLOCK BINBLK+BINLEN+01 OUTPUT BUFFER
/ 005600-005777 BLOCK BINBLK+BINLEN+02 OUTPUT BUFFER
/ 006000-006177 BLOCK BINBLK+BINLEN+03 OUTPUT BUFFER
/ 006200-006377 BLOCK BINBLK+BINLEN+04 INPUT BUFFER
/ 006400-006577 BLOCK BINBLK+BINLEN+05 INPUT BUFFER
/ 006600-006777 BLOCK BINBLK+BINLEN+06 INPUT BUFFER
/ 007000-007177 BLOCK BINBLK+BINLEN+07 INPUT BUFFER
/ 007200-007377 BLOCK BINBLK+BINLEN+10 FIRST PAGE OF /V LOADER
/ 007400-007577 BLOCK BINBLK+BINLEN+11 SECOND PAGE OF /V LOADER
/ 007600-007777 BLOCK BINBLK+BINLEN+12 SYSTEM I/O ROUTINES
/ ------------- BLOCK BINBLK+BINLEN+13 SYSTEM RELICS
/ BLOCK NUMBERS REFER TO THE BLOCK WHERE THE CORE IMAGE FOR THAT PART OF
/ CORE WILL BE STORED UNTIL LATER CORE IMAGE LOADING.
/ IMPLEMENTATION NOTE:
/ THE /V CODE CONTAINS CONSOLE INPUT AND OUTPUT ROUTINES ACCESSED BY
/ SEVERAL PARTS OF THE UTILITY. THESE ROUTINES CAN BE USED IN THEIR
/ LOADED (NOT RELOCATED) POSITIONS AS WELL AS THEIR RELOCATED POSITIONS
/ WHEN THE /V CODE IS MOVED TO ITS ASSEMBLED ADDRESS.
*VPAGE /RESTORE OUR ORIGIN
ENPUNCH /RESTORE BINARY OUTPUT
VPAGE, RELOC 4^200+VINBUF /WHERE THIS EXECUTES
VLOAD, VOFF1= VPAGE-VLOAD /RELOCATION DEFINITION
/ IF /H OR /Z IS IN EFFECT, THE SCRATCH AREA PAST "BIN" WILL BE INITIALIZED.
IFNZRO .&177
IFNZRO CLA-.
VLOAD, JMP VNXTWD /**** /H OR /Z **** 0000
VRECCT, JMS I VSYSIO/(SYSIO) /RECORD COUNT
VGRPCT, 0000 /GROUP COUNT
VWDCNT, 14^100+WRITE+.-. /WORD COUNTER
VLOC, .-. /LOCATION COUNTER
VNWLOC, DCA VLOC /SAVE NEW ORIGIN
VNXTWD, JMS VGIMME /GIMME A WORD
JMP VEOF / OR FIELD SETTING
SZL /ORIGIN?
JMP VNWLOC /YES
VCDF, JMP VCHECK /OR CDF N (N=10-70)
VOK, DCA I VLOC /LOAD THE WORD
VOK2, CDF 00 /BACK TO FIELD ZERO
ISZ VLOC /BUMP TO NEXT LOCATION
VV7000, 7000 /CONSTANT 7000; HERE IN CASE IT SKIPS
JMP VNXTWD /GO GET ANOTHER
VEOF, SNL /?
JMP VEOLOD /YES, GO FINISH UP
AND (70) /AND OFF FIELD BITS
SNA /FIELD ZERO?
TAD (VCHECK&177+JMPC-CDF) /YES, MAKE IT CHECK
TAD VOK2/(CDF) /ADD ON CDF INSTRUCTION
DCA VCDF /PUT INLINE
JMP VNXTWD /GET ANOTHER WORD
VEOLOD, DCA I (VZONK) /MAKE IT FINISH THE LOAD
JMP I (VWRITE) /GO WRITE THE LAST BUFFER
VCHECK, DCA VGETWD /SAVE WORD
TAD VLOC /CHECK LOCATION COUNTER
TAD (-VOUTBF) /AGAINST LIMIT
SZL CLA /OK?
JMP VFIXIT /NO, FIXUP
TAD VGETWD /RESTORE THE WORD
JMP VOK /CONTINUE THERE
/ IF THE ADDRESS IS IN THE PROTECTED AREA, A CALCULATION IS MADE TO
/ DETERMINE IF THE WORD FALLS INTO THE CURRENT VIRTUAL BUFFER:
/ 5200-6177, 6200-7177, 7200-7777.
/ IF THE ADDRESS FALLS INTO THE CURRENT BUFFER, IT IS ADJUSTED TO THE PROPER
/ RELATIVE VALUE AND THE WORD IS LOADED. IF IT BELONGS WITH A DIFFERENT
/ BUFFER, THE CURRENT BUFFER MUST BE WRITTEN AND THE NEW BUFFER READ IN. THIS
/ WILL THEN ALLOW THE WORD TO BE LOADED.
VFIXIT, TAD I (VLOW) /GET CURRENT LIMIT
CIA /INVERT IT
TAD VLOC /ADD ON PROBLEMATIC LOCATION
STL /SET LINK FOR TEST
TAD VV7000/(-1000) /ADD ON RANGE
SNL /IS IT WITHIN LIMITS?
JMP I (VWRITE) /NO, GO FIX IT
TAD (VOUTBF+1000) /CALCULATE BUFFER ADDRESS
DCA VGIMME /STASH IT
TAD VGETWD /GET THE DATA WORD
DCA I VGIMME /STORE IT IN BUFFER
JMP VOK2 /CONTINUE THERE
VGIMME, .-. /GET ME A WORD ROUTINE
ISZ VWDCNT /BUMP WORD COUNTER
JMP VGRPLP /GET NEXT WORD
ISZ VGRPCT /BUMP GROUP COUNT
JMP VNWGRP /GET NEXT GROUP
ISZ VLOAD /THROW AWAY
ISZ VLOAD /TWO WORDS
ISZ VRECCT /DONE FOUR BLOCKS YET?
JMP VNWREC /NO, GET ANOTHER ONE
VNWBUF, JMS I (CHKUP) /CHECK FOR <^C> PERIODICALLY
JMS I VSYSIO/(SYSIO) /READ SOME BLOCKS
VBUFF, VINBUF /INTO INPUT BUFFER
VFUN, 4^100+.-. /4 BLOCKS WORTH
VBLOCK, .-. /BLOCK NUMBER
VZAP, SKP /NORMALLY CHECK
JMP VFILOK /DON'T CHECK IF WE GET HERE
DCA VZAP /PREVENT CHECKING NEXT TIME
TAD I VOK2/(VINBUF+1) /GET DEFAULT ORIGIN
TAD (-200) /COMPARE TO CORRECT VALUE
VSYSIO, SZA CLA /SKIP IF OK
JMP I (VBDPRT) /JUMP IF NOT
VFILOK, TAD VBLOCK /UP THE BLOCK
TAD (4) /NUMBER BY 4
DCA VBLOCK /AND RESTORE IT
TAD (-4) /GET A MINUS 4
DCA VRECCT /INTO RECORD COUNT
TAD VBUFF /RESET
DCA VLOAD /BUFFER POINTER
VNWREC, TAD (-22) /RESET
DCA VGRPCT /GROUP COUNT
VNWGRP, TAD (-6) /RESET
DCA VWDCNT /WORD COUNTER
JMS VGETWD /GET A WORD
CLL RAR /FIXUP FOR FIRST TIME
VSKP, SKP /DON'T GET IT AGAIN
VGRPLP, TAD VRLBTS /GET FLAG WORD
RTL /ROL IT AROUND
DCA VRLBTS /SAVE IT
TAD VRLBTS /GET IT AGAIN
SPA CLA / OR FIELD?
JMP VEOFLD /YES
ISZ VGIMME /BUMP RETURN ADDRESS
VFELD, JMS VGETWD /GET THE WORD
JMP I VGIMME /RETURN
VEOFLD, SZL /?
JMP VFELD /NO, GET A FIELD SETTING
ISZ VILPTR /BUMP TO NEXT FILE
TAD I VILPTR /GET NEXT FILE ARGUMENT
SNA /?
JMP I VGIMME /RETURN WITH LINK CLEAR TO INDICATE
AND (7) /JUST UNIT BITS
TAD (4^100) /ADD ON READ OF 4 BLOCKS
DCA VFUN /PUT INTO CALL
TAD I VILPTR /GET FILE ARGUMENT AGAIN
AND (7770) /JUST BLOCK BITS
DCA VBLOCK /SAVE AS BLOCK NUMBER
TAD VSKP/(SKP) /FORCE THE
DCA VZAP /VALIDITY CHECK
JMP VNWBUF /GO READ IT IN
VGETWD, .-. /GET A WORD FROM THE BUFFER
TAD I VLOAD /ONE WORD, PLEASE
ISZ VLOAD /BUMP POINTER FOR NEXT TIME
JMP I VGETWD /RETURN
VRLBTS, 1000 /FLAG BITS; INITIALIZED FOR NEW FILE
VILPTR, SFILES-1 /FILE POINTER
IFNZRO VINBUF+1-CDF 00
PAGE
VLOAD2, RELOC .+VOFF1 /RESTORE OUR ORIGIN
VPAGE2, RELOC VLOAD2 /WHERE THIS EXECUTES
VLOAD2, VOFF2= VPAGE2-VLOAD2 /RELOCATION DEFINITION
IFNZRO .&177
V7000, -4^200 /CONSTANT 7000
/ COMES HERE TO DUMP A VIRTUAL BUFFER AND READ IN A NEW ONE.
VWRITE, JMS I VVSYSIO/(SYSIO) /CALL I/O ROUTINES
VOUTBF /WRITE THE OUTPUT BUFFER
VBFUN, 4^100+WRITE+.-. /UNIT BITS WILL BE FILLED IN
VBLOC, .-. /SCRATCH BLOCK WILL BE FILLED IN
JMS CHKUP /CHECK FOR <^C>, ETC.
VZONK, SKP /**** END OF LOAD **** 0000
JMP VEOL2 /CONTINUE THERE AT END OF LOAD
TAD I VVLOC/(VLOC) /GET LOCATION COUNTER
TAD VV7600/(-200) /BACKUP ONE PAGE
VV200, AND V7000/(7000) /JUST MAJOR PAGE BITS
TAD VV200 /ADD ON ONE PAGE
DCA VLOW /SAVE NEW LOWER LIMIT
TAD VLOW /GET IT BACK
CLL RTL;RTL;RTL /%200
TAD VBASE /ADD ON BASE BLOCK
DCA VBLOC /STORE IN WRITE CALLER
TAD VBLOC /GET IT BACK
DCA VBLOC2 /STORE IN READ CALLER
JMS I VVSYSIO/(SYSIO) /CALL I/O ROUTINES
VOUTBF /READ INTO OUTPUT BUFFER
VBFUN2, 4^100+.-. /UNIT BITS WILL BE FILLED IN
VBLOC2, .-. /SCRATCH BLOCK WILL BE FILLED IN
JMS CHKUP /CHECK FOR <^C>, ETC.
JMP I VVFIXIT/(VFIXIT)/CONTINUE THERE
/ COMES HERE AFTER WRITING OUT LAST BUFFER.
VEOL2, TAD VCIF /GET A WORD
DCA I VDOPTR /PUT A WORD
ISZ VEOL2 /BUMP GET INSTRUCTION
ISZ VDOPTR /DONE YET?
JMP VEOL2 /NO, KEEP GOING
TAD VSWAL/(SWAL) /GET PHONEY CALLING LOCATION
DCA I VVSYSIO/(SYSIO) /STORE IN I/O HEADER
JMP I VVSYS1/(SYSIO+1)/GO START IT UP
/ THESE WORDS ARE MOVED TO 007774-007777 AT END OF LOAD.
VCIF, RELOC VST /WHERE THEY GO
VST, CIF CDF 00+.-. /STARTING FIELD BITS WILL BE FILLED IN
JMP I SPARM /START THROUGH EQUALS PARAMETER
BISTRT, HLT /DEFAULT STARTING ADDRESS
JMP BISTRT /JUST IN CASE
RELOC .+VCIF-VST /RESET OUR ORIGIN
CHKUP, .-. /<^C>, ETC. CHECKUP ROUTINE
JMS CTLCTST /CHECK FOR <^C>, ETC.
SZA /SKIP IF NOTHING CAME IN
TAD V7757/(-"Q!300) /ELSE COMPARE TO <^Q>
SNA /SKIP IF SOMETHING ELSE
JMP CHKCLR /ELSE IGNORE IT
TAD V7776/(-"S+"Q) /IS IT <^S>?
CTLZP1, SZA CLA /**** DISABLED **** CLA!400
JMP I CHKUP /RETURN IF NOT
JMS CTLCTST /GET ANOTHER CHARACTER
TAD V7757/(-"Q!300) /IS IT <^Q>?
VVSYSIO,SZA CLA /SKIP IF SO
JMP .-3 /JUMP IF NOT
CHKCLR, DCA INCHAR /OBLITERATE <^Q>
JMP I CHKUP /RETURN
CTLCTST,.-. /CHECK FOR <^C>, ETC.
VV7600, CLA!400 /CLEAN UP
CHKKSF, KSFIOT /**** CONSOLE **** CIF MCS+10
CHKJMP, JMP I CTLCTST /**** CONSOLE **** JMS INCON
CHKKRS, KRSIOT/OR KRBIOT /**** CONSOLE **** JMP I CTLCTST
AND V177/(177) /JUST SEVEN BITS
DCA INCHAR /STASH IT
CTLZP2, NL7775 /**** DISABLED **** JMP CTLXIT
TAD INCHAR /COMPARE TO LATEST CHARACTER
SNA /SKIP IF NOT <^C>
ISZ I VSCRSIZE/(SCRSIZE) /ELSE INDICATE <^C> HIT
SPA SNA CLA /SKIP IF NOT <^C> OR LESS
JMP I VV7600/(SBOOT) /ELSE GO TO THE MONITOR
CHKKCC, KCCIOT/OR 0000 /**** CONSOLE **** 0000
CTLXIT, TAD INCHAR /GET THE CHARACTER
JMP I CTLCTST /RETURN
P7CH, .-. /SEVEN-BIT OUTPUT ROUTINE
DCA VBLOC2 /SAVE PASSED VALUE
P7AGN, JMS CHKUP /CHECK FOR <^C>, ETC.
TAD VBLOC2 /GET THE VALUE BACK
P7TSF, TSFIOT /**** CONSOLE **** CIF MCS+10
P7JMP, JMP P7AGN /**** CONSOLE **** JMS OUTCON
P7TLS, TLSIOT /**** CONSOLE **** JMP P7AGN
JMS CHKUP /CHECK FOR <^C>, ETC.
JMP I P7CH /RETURN
VBDPRT, TAD VBDMSG /GET A CHARACTER
SPA /PART OF MESSAGE?
JMP I VV7600/(SBOOT) /NO, BYE, BYE!
JMS P7CH /YES, PRINT IT
ISZ VBDPRT /BUMP TO NEXT
JMP VBDPRT /GO DO ANOTHER ONE
INCHAR, .-. /INPUT BUFFER
VBASE, .-./BINBLK+13-25 /THIS WILL BE FILLED IN!
VDOPTR, VST /WHERE TO PUT THE STARTUP CODE
VLOW, VOUTBF /LOWER LIMIT VALUE
VSCRSIZ,SCRSIZE /POINTER TO CORE SIZE WORD
VSWAL, SWAL /WHERE SYSIO THINKS IT GOT CALLED FROM!
VVFIXIT,VFIXIT /POINTER TO VFIXIT ROUTINE
VVLOC, VLOC /POINTER TO LOCATION COUNTER
VVSYS1, SYSIO+1 /POINTER TO FIRST WORD OF SYSTEM I/O ROUTINES
V177, 177 /CONSTANT 0177
V7757, 7757 /CONSTANT 7757
VBDMSG, "I&177 /INVALID FILE MESSAGE
"N&177+40
"V&177+40
"A&177+40
"L&177+40
"I&177+40
"D&177+40
" &177
"I&177
"N&177+40
"P&177+40
"U&177+40
"T&177+40
" &177
"F&177
"I&177+40
"L&177+40
"E&177+40
"!&177
V7776, 7776 /CONSTANT 7776; THIS ENDS THE MESSAGE
VEND= . /END OF /V LOADER TO BE RELOCATED
/MUST BE 7565 OR LESS TO AVOID CONFLICT
/WITH /H, /Z ROUTINE
IFNZRO BFILL-VEND&4000
RELOC .-VLOAD2+VPAGE2 /RESTORE OUR ORIGIN
PAGE
/ SLURP LOADER READ IN HERE.
SLUPAGE,IFNZRO .%200-BINLEN
NOPUNCH
SLUPAGE,RELOC SBOOT /WHERE THIS EXECUTES
SBOOT, ZBLOCK BBLEN /BOOTSTRAP PORTION OF SLURP LOADER
ZBLOCK BCIF-. /REST OF SLURP LOADER
BCIF, .-. /CIF CDF STARTUP FIELD GOES HERE
ZBLOCK SPARM-. /REST OF SLURP LOADER
SPARM, BERR /DEFAULT STARTING ADDRESS
SFILES, RELOC BINIT2 /WHERE THIS EXECUTES
BINIT2, ZBLOCK BINITLN /BOOTSTRAP UNIT INITIALIZATION CODE
RELOC SFILES+BINITLN /RESTORE ORIGIN
SLPSA, BREAD /SLURP LOADER STARTING ADDRESS; ZERO MEANS NO LOADER
/ TYPICAL VALUES.
BERR= 7742 /DEFAULT SAFE STARTING ADDRESS
BREAD= 7665 /STARTING ADDRESS OF LOADER
RELOC .+SLUPAGE-SBOOT /RESET OUR ORIGIN
ENPUNCH
FIELD 0 /DUMP PAGE ZERO LITERALS NOW
RELOC /TURN OFF RELOCATION
$ /THAT'S ALL FOLK!