1 /LIBRA: F4 LIBRARIAN, V24A
14 /COPYRIGHT (C) 1974, 1975
15 /DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
19 /THIS SOFTWARE IS FURNISHED UNDER A LICENSE FOR USE ONLY ON A
20 /SINGLE COMPUTER SYSTEM AND MAY BE COPIED ONLY WITH THE INCLU-
21 /SION OF THE ABOVE COPYRIGHT NOTICE. THIS SOFTWARE, OR ANT OTHER
22 /COPIES THEREOF, MAY NOT BR PROVIDED OR OTHERWISE MADE AVAILABLE
23 /TO ANY OTHER PERSON EXCEPT FOR USE ON SUCH SYSTEM AND TO ONE WHO
24 /AGREES TO THESE LICENSE TERMS. TITLE TO AND OWNERSHIP OF THE
25 /SOFTWARE SHALL AT ALL TIMES REMAIN IN DEC.
28 /THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT
29 /NOTICE AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
30 /EQUIPMRNT COROPATION.
32 /DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS
33 /SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.
40 \f/LIBRA: FORTRAN IV LIBRARIAN
43 / BORN OF JUD LEONARD, UNDER THE
44 / SIGN FOR WHICH IT IS NAMED.
48 / .PRINT VERSION NUMBER
49 / .ACCEPT INPUT FROM CONSOLES WITHOUT PARITY
52 / CHANGES FOR OS/8 V3D BY PAULA TIRAK
53 / .CHANGED VERSION NUMBER TO 24A
54 / .PUT IN NEW DATE ALGORITHM
55 / .NO LONGER MISNAMES THE SECOND OUTPUT FILE
73 OUTF2=7605 /CATALOG LISTING
82 DHRES=7647 /HANDLER RESIDENCY TABLE
83 SYSDAT=7666 /SYSTEM DATE
84 DCTLW=7760 /DEVICE CONTROL WORD TABLE
85 / DEVICE CONTROL WORDS HAVE THE FORM:
86 / BIT 0 FILE STRUCTURED
89 / BITS 3-8 DEVICE TYPE
90 / BITS 9-11 DIR BLOCK OF CURRENT TENTATIVE FILE
92 / INTERNAL DEFINITIONS:
95 CATBUF=2000 /IN FIELD 1
96 CBUFS=1 /NUMBER OF BUFFERS FOR CATALOG
98 MBUFS=12 /BUFFERS FOR MODULE
99 ODEVH=7200 /OUTPUT DEVICE HANDLER (ROOM FOR 2-PAGE)
100 IDEVH=6600 /INPUT DEVICE HANDLER
120 USR, 200 /CURRENT USR CALL ADDRESS
121 /LIBRA ASSUMES USR ALWAYS PRESENT
122 LIBDVH, ODEVH /ADDRESS OF LIBRARY DEVICE HANDLER
123 LIBU, 1 /UNIT CONTAINING LIBRARY; INITIALLY SYS:
124 CATLEN, 0 /LENGTH OF CATALOG
125 CATBLK, 0 /CURRENT CATALOG BLOCK IN CORE
126 LAVAIL, 0 /NEXT AVAILABLE LIBRARY BLOCK
127 LIBNAM, TEXT "FORLIBRL"
129 INFP, INF /CURRENT PLACE IN INPUT FILE LIST
130 MODU, 0 /UNIT CONTAINING CURRENT MODULE
131 MODDVH, IDEVH /INPUT DEVICE HANDLER ADDRESS
132 MODLEN, 0 /LENGTH OF THIS MODULE
133 MODBLK, 0 /FIRST BLOCK OF MODULE
134 INLSW, 0 /NON-ZERO IF IN LIBRARY INPUT
135 INFST, 0 /FIRST BLOCK OF INPUT FILE
136 INBLK, 0 /NEXT INPUT BLOCK NUMBER
137 THSBLK, 0 /READIN CONTROL
138 FULFLG, 0 /-1 IF CAT FULL
140 ENAM2, 0 /HOLDER FOR ESD NAMES
142 0 /TEXT STOPPER FOR ENAME
144 PCAT, CATBUF /POINTER TO CURRENT CATALOG BLOCK
145 INCLUD, -1 /SW FOR NAME INCLUDED IN CATALOG
146 CHANGD, 1 /0 IF CAT BLOCK MODIFIED
147 PMOD, MODBUF /POINTER TO CURRENT MODULE BLOCK
149 TTFLAG, 0 /NON-ZERO WHEN TTY HAS INITIALIZED
150 PCHR, TTO /OUTPUT ROUTINE
151 TTPOS, 0 /TTY POSITION COUNTER
154 7421 /ERROR CODE TO MQ
157 \f/ LIBRA MAIN CONTROL
159 *177 /MAKES IT EASY TO CALL START
161 JMS TTWAIT /ALLOW TTY TO COMPLETE
165 TXTRL, 2214 /RL DEFAULT EXT
166 TAD (INF /RESET INPUT FILE POINTER
168 TAD (TTO /AND IO DEVICE
173 SNA /NEW LIBRARY SPECIFIED?
174 JMP LASTLB /NO, USE LAST ONE
175 DCA LIBU /GET LIBRARY UNIT
186 TAD TXTRL /IF NO EXT, FORCE .RL
188 LASTLB, TAD LIBU /REGET UNIT
190 TAD (DCTLW-1 /ADDRESS DEV CTL TABLE
194 SMA CLA /IS DEVICE FILE-STRUCTURED?
197 DCA OHADDR /ALLOW 2-PAGE HANDLER
201 JMS I USR /GET THE HANDLER
204 JMS IOERR /YOU'RE KIDDING
205 TAD OHADDR /NOW THE REAL ADDRESS
215 DCA PCHR /ENSURE IT COMES OUT ON TTY
221 \fZTEST, CDF F1 /FIND OR CREATE LIB.
222 TAD I (SWYTO9 /GET SWITCH WORD
223 AND (2000 /TEST FOR /Z
226 JMP NEWLIB /YES, ENTER NEW ONE
227 OLDLIB, JMS FNDLIB /LOOKUP THE LIBRARY
229 JMP NEWLIB /COULDN'T FIND IT
231 TAD LIBBLK /FIRST BLOCK OF LIBRARY
233 TAD (CBUFS+MBUFS^200!F1
234 DCA ZCATC /READ ALL YOU CAN
235 JMS ZCAT /DO THE READ
237 TAD I (CATBUF /LOOK AT CONTROL WORD
239 SZA CLA /IS IT A LIBRARY?
240 JMP NOTLIB /NO, ERROR
243 DCA CATLEN /LENGTH IN BLOCKS
245 DCA LAVAIL /WILL BE UPDATED DURING SCAN
247 DCA CATBLK /CURRENT BLOCK IN BUFFER
251 CSLOOP, TAD (CBUFS+MBUFS
253 SMA /WILL THE REST FIT IN BUFFER?
256 TAD (-CBUFS-MBUFS^100
257 DCA TMP1 /ENTRIES NOW IN CORE
258 JMS SCAT /SCAN CATALOG
259 TAD ZCATB /NEXT BLOCK WE'LL READ
263 \fCSLAST, CIA /NO OF BLOCKS WE DON'T NEED
265 JMS R6L /NO OF ENTRIES WE CAN LOOK AT
268 JMS SCAT /LOOK FOR END
269 FULCAT, JMS TTOTXT /RAN OFF THE END
281 JMP GETINF /THAT'S IT
283 ISZ X0 /IGNORE REST OF NAME
285 TAD LAVAIL /ADD TO ST BLOCK OF FREE AREA
290 JMP I SCAT /GO FOR NEXT BUFFER LOAD
292 NOTLIB, JMS PRLBNM /PRINT LIBRARY NAME
305 SNA /DID HE GIVE A LENGTH?
309 TAD I (EQLO /HOW MANY EXTRA BLOCKS WANTED
311 TAD CATLEN /PLUS CATALOG REQUIREMENT
313 TAD LIBLEN /MINUS AVAILABLE LENGTH
314 SZL CLA /CHECK FOR ENUF ROOM
315 JMP LSZERR /NO ROOM, GIVE MESSAGE
317 / WRITE EMPTY CATALOG
321 TAD (-MBUFS-CBUFS^400
327 TAD (CATBUF-1 /RESET FOR LATER USE
331 SPA SNA /MORE THAN ONE?
334 ISZ ZCATB /START WITH SECOND CAT BLOCK
344 DCA ZCATC /SET CONTROL
348 JMP ZCLOOP /MORE TO GO
350 CLA IAC /1 IS LIBRARY CODE
353 DCA I X0 /MARK LIBRA VERSION #
354 TAD LIBLEN /JUST A GUESS
359 CLA CMA /END OF CAT INDICATOR
360 DCA I X0 /MARKS FIRST AVAIL SLOT
362 DCA CHANGD /FORCE A WRITE ON THIS ONE
365 TAD LIBBLK /LIBRARY START BLOCK
366 DCA CATBLK /IS CURRENTLY IN BUFFER
371 JMS CCHK /LOOKOUT FOR CONTROL C
382 ISZ CHANGD /SET UNMODIFIED SW
398 LIBLEN, 0 /NEG, REMEMBER
399 JMP I FNDLIB /COULD'T DO IT
400 TAD LIBBLK /FIRST BLOCK
401 DCA ZCATB /OF CATALOG
407 JMP START /GO FOR MORE
410 / SETUP POINTERS AND THINGS FOR NEXT INPUT MODULE
413 DCA INCLUD /SET NO-NAME-INCLUDED SW
414 TAD INLSW /ARE WE GETTING INPUT FROM A LIBR?
416 JMP INLIB /YES-GET NEXT MODULE THEREIN
418 TAD I INFP /UNIT AND LEN OF NEXT IN FILE
422 AND (1000 /TEST FOR /C
426 JMS SAVRES /PRESERVE DEV HANDLER RESIDENCY
427 JMS TTWAIT /FINISH ANY TYPING
429 JMS I USR /NEW LINE CONTINUES OLD
432 0 /DO NOT DELETE TENTATIVE FILES
433 JMS RSTRES /RESTORE RESIDENCY TABLE
435 DCA INFP /RESET INPUT FILE POINTER
436 JMP NXTINF /TRY AGAIN
437 \fFTCHIN, DCA MODU /UNIT CONTAINING INPUT MOD
440 DCA INFST /START OF INPUT FILE
443 DCA MODBLK /IN THIS CASE, FILE=MODULE
451 DCA INDVH /TENTATIVE HANDLER ADDR
458 INDVH, IDEVH!1 /TENTATIVE INPUT HANDLER ADDR
459 JMS IOERR /DON'T GIVE ME THAT
461 DCA MODDVH /DEVICE HANDLER ADDRESS
462 DCA THSBLK /FORCE READIN TO READ
463 LUKMOD, TAD MODBLK /FIRST BLOCK OF MODULE
464 DCA INBLK /INITIALIZE READIN
465 JMS READIN /GET FIRST BLOCK
468 TAD I PMOD /LOOK AT IDENTIFIER
471 JMP GOTLIB /ITS A LIBRARY
473 SZA CLA /IS IT A MODULE
474 JMP BADINF /BAD INPUT
475 TAD LIBBLK /MAKE SURE
477 TAD LIBLEN /THAT MODULE
478 TAD LAVAIL /FITS IN LIBRARY
480 SNA /CHECK FOR TOO LONG HERE TOO**
481 JMP OVFLO /IT IS TOO LONG
484 JMP NXTEBK /GO GETTUM
496 JMP LB2BIG /CAN'T DO A LOOKUP IF G. T. 255
497 ISZ INLSW /SET IN-LIBRARY SWITCH
504 \f/ GET NEXT MODULE FROM LIBRARY
506 INLIB, TAD INFST /START OF INPUT FILE
507 DCA INBLK /IS WHAT WE WANT
508 JMS READIN /BRING CATALOG INTO MODULE BUFFER
513 TAD I TMP1 /GET CATALOG LEN
515 DCA TMP1 /HOLD COUNTER IN CASE OF FULL CATALOG
517 DCA INBLK /WE WANT THE SAME ONE AGAIN
519 DCA TMP3 /INIT ACCUMULATED MODULE START BLOCK
520 DCA MODLEN /INITAIL MOD LEN IS ZERO
521 INLSC1, JMS READIN /GET CATALOG BLOCK
523 DCA TMP2 /COUNT ENTRIES IN CAT BLOCK
525 TAD I PMOD /LOOK FOR END-OF-CATALOG WORD
528 JMP NDLSC /END OF SCAN
530 TAD PMOD /POINT TO LENGTH
533 SNA CLA /FIRST ENTRY FOR A MODULE?
534 JMP NOLEN /NO, DO NOT UPDATE
536 TAD TMP3 /UPDATE MODULE STARTING BLOCK
538 TAD I TMP5 /GET THIS LENGTH
539 DCA MODLEN /FOR THIS MODULE
540 NOLEN, TAD MODBLK /COMPARE LAST MODULE STARTING BLOCK
542 TAD TMP3 /TO ACCUMULATED START BLOCK
543 SNL CLA /INTERESTING?
545 TAD I PMOD /YES; WAS NAME DELETED?
547 JMP GLMOD /NO, WE'VE GOT A GOOD MODULE
549 TAD PMOD /POINT TO NEXT NAME
551 ISZ TMP2 /END OF CAT BLOCK?
553 ISZ TMP1 /YES; END OF CATALOG?
554 JMP INLSC1 /NO, GET NEW BLOCK
555 NDLSC, DCA INLSW /YES, NO LONGER IN A LIBRARY
556 JMP NXTINF /GET ANOTHER FILE
557 \fGLMOD, TAD TMP3 /GET STARTING BLOCK
558 DCA MODBLK /OF MODULE
559 JMP LUKMOD /AND GO GET THE MODULE
560 L2BMSG, TEXT "INPUT LIBRARY TOO BIG";0
562 \f/ PROCESS LOOP FOR ONE MODULE
565 TAD PMOD /ADDR OF FIRST ESD-1
566 DCA X0 /RESET POINTER TO NAMES
567 TAD (-52 /PER BLOCK COUNT
578 TAD (ESDTAB /DISPATCH FROM TBL
581 ESDTAB, JMP ESDEND /0=END OF ESD TABLE
582 JMP DUPLUK /1=ENTRY=LOOK FOR
584 JMP ESDLND /2=EXTERN=IGNORE NAME
585 JMP ESDLND /3=FORT COMMON=IGNORE
586 JMP DUPLUK /4=PROG SECTION
587 HLT /5=MUL ENTRY=DOESN'T
589 HLT /6=MUL SECTION=DITTO
592 JMP DUPLUK /11=FIELD1
594 / LOOK FOR DUPLICATION OF THIS ESD SYMBOL
598 DCA TMP1 /COUNT LENGTH OF CAT
601 TAD LIBBLK /ARE WE AT FIRST BLOCK?
603 JMS CHGCHK /CHECK FOR BLOCK MODIFIED
605 DCA NXTCAT /SETUP FOR FIRST BLOCK OF CAT
609 GETCB, JMS GCATB /GET IT
612 TAD (-100 /COUNT ENTRIES/BLOCK
615 CBSRCH, TAD I X1 /LOOK AT NAME
618 JMP CHKI /END OF CATALOG-LOOK FOR /I
619 IAC /COMPLETE THE CIA
628 TAD I X1 /LAST CHANCE
639 JMS CHGCHK /CHECK FOR MODIFIED BLOCK
640 ISZ TMP1 /END OF CATALOG?
641 JMP GETCB /NO, GET NEXT
647 JMP ESDEND /PUT THAT, IF POSSIBLE
650 ENAM1-1 /PRINT THE NAME
652 NDUP-1 /WHICH TO KEEP?
658 JMP CHKR /NO, LOOK FOR /R
662 JMP ESDLND /DEFAULT TO THE OLD ONE
669 JMP DELTO /DELETE THE OLD
676 JMP ESDLND /DEFAULT:KEEP THE OLD ONE
686 ISZ X1 /SKIP OVER LENGTH
687 DCA CHANGD /BLOCK HAS BEEN MODIFIED
688 JMP NXTE /ENTER AT END OF LOOP
690 TAD I X1 /LOOK AT NEXT
693 JMP ENDCAT /NOW WE'RE THERE
695 TAD (3 /BUMP TO NEXT NAME
699 JMS CHGCHK /LOOK OUT FOR CHANGES
700 ISZ CATCNT /END OF CAT ?
702 JMP FULCAT /NO MORE PUSSY
709 \fCHKI, TAD I (SWATOL /LOOK AT /I SW
714 ENAM1-1 /TYPE ESD NAME
718 JMP ENDCAT /DEFAULT TO INCLUDE
721 JMP ENDCAT /YES, INCLUDE
724 JMP IANS /NO, TRY AGAIN
726 ENDCAT, TAD X1 /POINT TO EMPTY SLOT
733 \f/ THIS ESD GOES IN THE CATALOG
742 ISZ INCLUD /IS THIS THE FIRST?
744 TAD MODLEN /YES, GET THE LENGTH
745 DCA I X1 /AND STORE 4TH WORD
746 DCA CHANGD /SET CAT MODIFIED SW
748 TAD X1 /CHECK FOR END OF BLOCK
751 JMP MARKND /NO, MARK END OF CAT
752 JMS CHGCHK /WRITE THIS BLOCK
755 DCA TMP1 /SET COUNT FOR BLOCK LEN
761 JMP .-2 /CLEAR THE BLOCK
766 DCA I X1 /MARK NEW END OF CAT
768 CLA STL RTL /TWO TO SKIP VALUE
771 ISZ ESDCTR /DONE WITH BLOCK?
772 JMP ESDLUP /NO, GET NEXT
773 JMS READIN /GET NEXT BLOK
774 JMP NXTEBK /RESET POINTERS AND CONTINUE
775 ESDEND, ISZ INCLUD /CHECK FOR ANY NAMES OUT
776 JMP CPYMOD /YES, COPY MODULE INTO LIBRARY
777 JMS TTOTXT /SORRY, DIDN'T MAKE IT
783 \fCPYMOD, TAD MODBLK /GET IN FILE STRT BLOCK
788 TAD LAVAIL /FIRST AVAILABLE BLOCK
790 CPYLUP, JMS READIN /READ BLOCK OF INPUT
793 JMS I LIBDVH /CALL OUTPUT HANDLER
796 NXTOBK, 0 /NEXT OUTPUT BLOCK NUMBER
798 ISZ NXTOBK /BUMP BLOCK NUMBER
799 ISZ TMP1 /CHECK LENGH
802 DCA LAVAIL /UPDATE AVAILABLE POINTER
803 JMP GETINF /GO FOR NEXT
807 TAD CHANGD /HAS BLOCK BEEN MODIFIED?
809 JMP I CHGCHK /NO, NOTHING TO DO
811 DCA ZCATB /WRITE THE BLOCK
822 TAD CATBLK /IS IT IN CORE?
824 JMP SOEZ /YES, ITS EZ
829 SPA SNA CLA /CHECK FOR INTERNAL ERROR
833 TAD (200!F1 /SET FOR READ
836 TAD NXTCAT /NEXT BLOCK
837 DCA CATBLK /IS IN CORE
844 TAD (-ENTER /DID WE ENTER A NEW FILE?
846 JMP CATLST /NO, GO LIST CATALOG
850 TAD I (EQLO /GET USER EXTENSION REQUEST
852 TAD LAVAIL /PLUS CURRENT END
856 TAD LIBLEN /CHECK FOR POSSIBLE
859 TAD LIBLEN /CAN'T GIVE ALL HE WANTS
863 DCA LCLEN /SET CLOSE LENGTH
866 TAD LCLEN /COMPARE CAT LEN TO LIB LEN
868 JMP NOLIB /THERE'S NO POINT
869 TAD LIBBLK /GET FIRST BLOCK
873 TAD LCLEN /ACTUAL LIBRARY LENGTH
886 JMP CATLST /GO LIST THE CATALOG
895 CATLST, JMS OOPEN /OPEN LISTING FILE
896 JMP START /NONE DESIRED
897 TAD (OCHAR /SETUP FOR DEVICE-INDEPENDENT
899 TAD (214 /AT TOP OF PAGE
906 JMS PRLBNM /PRINT THE NAME
911 JMP NODATE /DON'T KNOW THE DATE
915 CLA /THE FOLLOWING CODE GETS THE DAY
917 TAD TMP1 /GET THE DATE
918 RTR /ROTATE THREE RIGHT AND MASK
919 RAR /TO GET THE DAY IN OCTAL
921 JMS MAK8BT /MAKE IT 8-BIT AND PRINT
923 TAD TMP1 /GET THE DATE BACK
924 AND (7400 /MASK TO GET THE MONTH BITS
925 JMS R6R /MONTH*4 (IN OCTAL)
926 DCA TMP2 /PUT IN TEMP. VARIABLE TO SAVE IT
927 TAD TMP2 /GET IT BACK
931 DCA .+2 /ADDRESS OF MONTH FROM TABLE
932 JMS TTOTXT /PUT IT IN THE TEXT LINE
934 TAD TMP1 /GET THE DATE---TO FIND THE YEAR
935 AND (7 /MASK TO GET THE YEAR OFFSET BITS
938 TAD I (7777 /GET THE DATE EXTENSION BITS
940 CLL RTR /ROTATE TO GET THEM INTO BIT
941 RTR /POSITIONS 7 AND 8
942 TAD (106 /ADD 70(ORIGINAL BASE YEAR)
943 TAD TMP4 /ADD IN THE YEAR OFFSET BITS
944 JMS MAK8BT /MAKE 8-BIT AND PRINT
946 JMP PRCAT /TITLE IS DONE, PRINT CAT
947 MAK8BT, 0 /ROUTINE TO CONVERT TO 8-BIT AND PRINT
948 CLL /FIRST CONVERT TO DECIMAL
949 CONVYR, TAD (-12 /KEEP SUBTRACTING 12
952 ISZ TMP2 /HOLDS THE FIRST DIGIT OF YEAR
954 GETDG1, TAD (12 /GET THE SECOND DIGIT
956 TAD TMP2 /GET THE FIRST DIGIT
957 SNA /FIRST DIGIT IS A ZERO
958 JMP PRDIG2 /PRINT THE SECOND DIGIT
959 TAD (260 /MAKE FIRST DIGIT OF YEAR 8-BIT
961 PRDIG2, TAD TMP3 /GET THE SECOND DIGIT
962 TAD (260 /MAKE SECOND DIGIT OF YEAR 8-BIT
966 \f/ LIST ALL ENTRIES IN THE CATALOG
974 DCA TMP3 /SET LINE COUNTER
981 TAD I X0 /GET FIRST WORD OF NAME
983 JMP EMPTY /NOT AN ESD NAME
986 JMP NDCATL /END OF CATALOG
987 CMA /RESTORE FIRST WORD
989 JMP NDNAM /A SHORT NAME
998 NDNAM, ISZ TMP3 /MORE ROOM ON THIS LINE?
1001 TAD (-10 /SETUP FOR 8 PER LINE
1004 SAMLIN, JMS TAB /SPACE OVER TO NEXT NAME
1008 DCA X0 /POINT TO NEXT
1010 JMP CATLP2 /GO FOR NEXT
1011 ISZ TMP1 /MORE BLOCKS?
1017 TAD (214 /EJECT PAGE
1019 JMS OCLOSE /CLOSE THE FILE
1022 \f/ USEFUL OUTPUT THINGS
1029 TAD (-217 /CRTL/O CHECK
1043 JMS CCHK /BEWARE OF CTRL/C
1045 JMP .-2 /WAIT TILL DONE
1046 DCA TTFLAG /CLEAR BUSY FLAG
1050 JMP I CCHK /NOTHING TO WORRY ABOUT
1054 SNA CLA /WAS IT CONTROL C?
1075 ISZ TTPOS /BUMP POSITION COUNT
1091 ISZ TTOTXT /BUMP PAST POINTER
1097 DCA TTPOS /RESET POSITION
1103 TAB, 0 /PSEUDO-TAB GENERATOR
1109 SNA CLA /IS POSITION A MULTIPLE OF 8
1111 JMP TAB+1 /NO, TRY MORE
1117 WREP, JMS TTI /WAIT FOR REPLY
1121 TAD (215-240 /PRINTING?
1123 JMP WREP /NO, TRY AGIAN
1132 TAD (215-377 /LOOKOUT FOR RUBOUT!
1139 GOTREP, ISZ WAITOP /GOT A REAL ANSWER
1149 AND (177 /TAKE CARE OF PARITY
1153 TAD (203 /GET ORGINIAL CHAR BACK
1157 / INPUT BUFFERRER AND STUFF
1162 TAD THSBLK /-FIRST BLOCK FOLLOWING BUFFER CONTENTS
1166 JMP MUSTRD /NO, WE HAVE TO DO A READ
1170 SETP, TAD (MODBUF /PLUSS BUFFER ADDR
1171 DCA PMOD /POINTS TO BLOCK
1172 ISZ INBLK /READY FOR NEXT
1174 MUSTRD, CLA /THIS ONE'S HARDER
1187 \f/ ROUTINES TO SAVE AND RESTORE
1188 / DEVICE HANDLER RESIDENCY TABLE
1215 \f/ PRINT THE LIBRARY NAME
1219 JMS TTO2 /FIRST 2 CHARS
1234 \f/ OUTPUT HANDLERS STOLEN FROM PIP
1236 OUCTL=MBUFS^200!4000!F1
1239 / INITIALIZE FOR OUTPUT
1242 TAD (OUCTL&3700 /BUFFER SIZE IN DBL WORDS
1243 CIA /NEGATE IT (PAL10 BLOWS)
1246 DCA OUPTR /INITIALIZE WORD POINTER
1248 DCA OUJMP /INITIALIZE 3-WAY CHARACTER SWITCH
1251 / STORE CHARACTERS IN OUTPUT BUFFER
1252 / IN PS8 FORMAT (YOU KNOW, 3 CHARS
1253 / IN 2 WORDS THE WRONG WAY)
1258 CDF OUFLD /SET DATA FIELD TO BUFFER'S FIELD
1259 ISZ OUJMP /BUMP THE CHARACTER SWITCH
1260 OUJMP, HLT /THREE WAY CHARACTER SWITCH
1268 DCA I OUPOLD /UPDATE FIRST WORD OF TWO WITH HIGH
1269 /ORDER 4 BITS OF THIRD CHAR
1276 DCA I OUPTR /UPDATE 2ND WORD FROM LO 4 BITS
1278 DCA OUJMP /RESET SWITCH
1280 ISZ OUDWCT /BUMP COUNTER EVERY 3 CHARS
1282 TAD (OUCTL /LOAD CONTROL WORD FOR A FULL WRITE
1283 JMS I (OUTDMP /DUMP THE BUFFER
1284 JMS OUSETP /RE-INITIALIZE THE POINTERS
1287 DCA OUPOLD /SAVE POINTER TO FIRST WORD OF TWO
1288 ISZ OUPTR /BUMP WORD POINTER TO SECOND WORD
1299 / MOVE OUTPUT FILE NAME TO FIELD 0
1303 DCA X0 /NAME OF CAT LIST FILE
1306 DCA OUFNAM /FIRST 2 CHARS
1313 TAD TXTCA /DEFAULT CAT EXT
1315 CDF F0 /RESTORE FIELD
1322 TAD I (OUTF2 /GET DEVICE CODE, LEN
1323 DCA OUELEN /HOLD IT A MO
1324 JMS I (OFNAME /GET FILE NAME INTO FIELD 0
1325 TAD OUELEN /CHECK FOR NULL FILE
1327 JMP I OOPEN /NOTHING TO OPEN
1328 TAD OUNAME /RESET ENTER CALL
1332 TAD OUELEN /THE UNIT
1335 FETCH /ASSIGN, FETCH HANDLER
1336 OUHNDL, 0 /OUTPUT DEVICE HANDLER ENTRY
1338 TAD OUELEN /UNIT AGAIN
1341 ENTER /ENTER OUTPUT FILE
1342 OUBLK, OUFNAM /REPLACED WITH STARTING BLOCK
1343 OUELEN, 0 /REPLACED WITH LENGTH OF HOLE
1344 JMS IOERR /YOU BLEW IT!!!
1350 DCA OUCTLW /STORE THE CONTROL WORD
1355 DCA OUREC /COMPUTE STARTING BLOCK
1358 AND (17 /COMPUTE THE NUMBER OF RECORDS
1359 TAD OUCCNT /UPDATE SIZE OF FILE
1364 SNL SZA CLA /EXCEED GIVEN LENGTH ?
1365 JMS IOERR /YES - ERROR
1374 TAD (232 /OUTPUT A CTRL/Z
1379 SZA CLA /UP TO THE BOUNDARY YET?
1380 JMP FILLLP /NO - FILL WITH ZEROS
1381 TAD I (OUDWCT /GET DOUBLEWORD COUNT LEFT
1383 SNA /A FULL WRITE LEFT?
1384 JMP NODUMP /YES DON'T DO IT
1385 TAD (4000!OUFLD /PUT IN FIELD AND WRITE BITS
1391 CLOSE /CLOSE THE OUTPUT FILE
1392 OUNAME, OUFNAM /POINTER TO OUTPUT FILE NAME
1394 JMS IOERR /ERROR WHILE CLOSING - BAD!!
1395 JMP I OCLOSE /ALL DONE
1399 LBV, TEXT "LIBRA V "
1401 VMESG, VERS&70^7+VERS+6060
1404 NONEIN, TEXT "MODULE NOT INCLUDED";0
1405 FLSTR, TEXT "LIBRARY MUST BE ON A FILE-STRUCTURED DEVICE";0
1406 SMALL, TEXT "INSUFFICIENT SPACE FOR LIBRARY";0
1407 NOTMOD, TEXT "INPUT NOT A MODULE";0
1408 TOOBIG, TEXT "INPUT TOO BIG FOR LIBRARY";0
1409 UNLIB, TEXT " IS NOT A LIBRARY";0
1410 NDUP, TEXT " IS DUPLICATE NAME";0
1411 KEEP, TEXT "; KEEP OLD OR NEW";0
1412 CATFUL, TEXT "CATALOG IS FULL";0
1413 NCLUD, TEXT ": INCLUDE";0
1414 WHYCLS, TEXT "LIBRARY TOO SMALL FOR USE; START OVER";0
1415 IOMSG, TEXT "I/O ERROR";0
1416 CATOF, TEXT "CATALOG OF ";0
1418 CS197, TEXT ", 197";0
1419 MONTHS, TEXT "-JAN-@@@@@-FEB-@@@@@-MAR-@@@@"
1420 TEXT "-APR-@@@@@-MAY-@@@@@-JUN-@@@@"
1421 TEXT "-JUL-@@@@@-AUG-@@@@@-SEP-@@@@"
1422 TEXT "-OCT-@@@@@-NOV-@@@@@-DEC-@@@@"