/MAIN DIRECTORY PRINTING LOOP *4200 NXTDIR, JMS I (ICHAR /FAKE, FAKE JMP I (DEND CLA  /WE DON'T WANT THE CHARACTER DCA ECOUNT TAD (INBUF-1 /WE WANT THE BUFFER! NEWSEG, DCA XR CDF 0 TAD I XR DCA DCOUNT /NUMBER OF ENTRIES TAD DCOUNT CLL TAD (100 SNL CLA JMS I (PIPERR 11 TAD I XR DCA BLOKNO /FIRST BLOCK OF FILE STORAGE TAD I XR DCA DLINK /LINK TO NEXT SEGMENT ISZ XR  /BUMP XR PAST FLAG WORD TAD I XR DCA WASTE NAMELP, CDF 0 TAD I XR SNA  /WHAT TYPE OF ENTRY IS IT? JMP DEMPTY /A FREE FILE DCA NAME1 /A PERMENANT OR TENTATIVE FILE TAD I XR DCA NAME2 TAD I XR DCA NAME3 TAD I XR DCA NAME4 TAD I XR DCA DDATE TAD WASTE /COMPENSATE FOR THE DATE INCREMENT CMA  /AND THE WASTE WORDS TAD XR DCA XR TAD I XR SNA  /IS IT A TENTATIVE FILE? JMP ADDLEN+1 /YES - TENTATIVE FILES ARE ALWAYS IGNORED CIA DCA FLENGT /NO - STORE THE LENGTH CDF 10 TAD I CHAR /GET THE STARTING FILE FOR THIS LISTING CIA CLL TAD BLOKNO SNL CLA  /ARE WE THERE YET? JMP ADDLEN /NO - KEEP GOING CLA CLL CMA RTL JMS I (PRWD /PRINT THREE WORDS NAME1, 0 NAME2, 0 NAME3, 0 TAD NAME4 SNA CLA  /IS THERE AN EXTENSION? TAD (-16 /NO - PRINT A BLANK TAD (56  /YES - PRINT A PERIOD JMS I (PR6BIT JMS I (PRWD NAME4, 0  /ZERO PRINTS AS TWO MORE BLANKS PRLNGT, TAD DTYPE AND (100 SZA CLA  /WAS THE LISTING SWITCH /F? JMP PRTCRL /YES - DON'T PRINT LENGTH TAD FLENGT JMS I (PRNUM TAD WASTE SZA CLA TAD DDATE JMS I (PDATE /PRINT THE CREATION DATE OF THE FILE PRTCRL, JMS I (PCRLF ADDLEN, TAD FLENGT TAD BLOKNO DCA BLOKNO /UPDATE BLOCK NUMBER ISZ DCOUNT JMP NAMELP /LOOP UNTIL ALL FILES ARE PROCESSED TAD DLINK SNA CLA  /MULTI-SEGMENT DIRECTORY? JMP EEDDIR /NO - FINISH UP TAD XR AND (7400 TAD (377 /BUMP XR TO NEXT BLOCK JMP NEWSEG /PROCESS NEXT LINK DEMPTY, TAD I XR CIA DCA FLENGT /STORE LENGTH OF FREE ENTRY CDF 10 TAD FLENGT TAD ECOUNT DCA ECOUNT /BUMP COUNT OF FREE BLOCKS TAD DTYPE AND (200 SNA CLA  /IS THE /E SWITCH ON? JMP ADDLEN /NO - DON'T LIST FREE FILES TAD (-4 JMS I (PRWD TEXT // JMS I (PR6BIT TAD FLENGT JMS I (PRNUM JMP PRTCRL ENDDIR, ISZ CHAR /BUMP TEMP ARRAY TO NEXT ENTRY TAD ECOUNT JMS I (ENDFUJ JMP NXTDIR FLENGT=24 BLOKNO=25 ECOUNT=26 DTYPE=27 DCOUNT=30 DLINK=31 WASTE=32 DDATE=33 *4400  /BINARY MODE PROCESSOR FOR PIP BIN360, 360 BINARY, JMS I (FIXLEN JMS I (OUTOPN JMS I (EMM /CHECK 'M' AND 'W' OPTIONS. JMS I (IOPEN JMS LTCODE NEWTAP, JMS I (ICHAR JMP BEOF  /END OF FILE ON INPUT SNA JMP NEWTAP /BLANK TAPE - KEEP GOING TAD BN7600 SZA CLA JMP NEWTAP JMS I (ICHAR JMP BEOF TAD BN7600 SNA JMP .-4 TAD BIN200 DCA CHAR TAD CHAR BIN200, AND BIN360 TAD (-240 /CHECK TYPE OF BINARY TAPE SNA JMP RELBIN /RELOCATABLE BINARY TAPE TAD (140 AND (7700 SZA CLA  /IS THE FRAME AN ORIGIN? JMP NEWTAP /IT AINT NUTHIN - CONTINUE CLA CMA JMS LTCODE /ABSOLUTE TAPE - PUT OUT SHORT LEADER/TRAILER ABSBIN, JMS RCOPY1 /COPY THIS FRAME AND READ NEXT TAD BN7600 BNM140, SZA CLA  /IS IT TRAILER? JMP ABSBIN /NO - KEEP GOING BEOT, CLA CMA  /END OF TAPE JMS LTCODE /PUT OUT SHORT LEADER/TRAILER JMP NEWTAP /GET NEXT TAPE LTCODE, 0  /SUBROUTINE TO PUNCH 200 CODE SMA  /SHORT LEADER/TRAILER? JMS I (OTYPE SPA CLA  /DIRECTORY DEVICE? TAD (70 /YES TAD (-100 DCA TEMP LTLOOP, TAD BIN200 JMS I (OCHAR /OUTPUT 64 OR 8 FRAMES OF L/T CODE JMP I (AOUERR ISZ TEMP JMP LTLOOP JMP I LTCODE RELBIN, TAD (SKP DCA I (INCTZF /DISABLE CONTROL-Z CHECKING ON INPUT CLA CMA JMS LTCODE /PUT OUT SHORT LEADER/TRAILER RELLP, TAD CHAR RTR RTR AND (17 TAD (RELTBL DCA TEMP TAD I TEMP /GET DATA WORD FOR THIS FRAME SMA SZA  /POSITIVE MEANS SPECIAL OR ERROR JMP RELERR RELSNA, SNA JMP RELEND /ZERO MEANS CHECKSUM FRAME DCA TEMP /NEGATIVE MEANS COUNT OF NUMBER OF SLAVE FRAMES JMS RCOPY1 BN7600, 7600 ISZ TEMP JMP .-3 /COPY THIS FRAME AND ALL SLAVE FRAMES JMP RELLP /GET NEXT CONTROL FRAME RELEND, JMS RCOPY1 /COPY THE FIRST FRAME OF THE CHECKSUM JMS I (OCHAR JMP I (AOUERR /OUTPUT THE SECOND FRAME JMP BEOT /END TAPE - START NEXT ONE BEOF, JMS LTCODE JMS I (OCLOSE JMP I (AOUERR JMP I (PIP RCOPY1, 0  /ROUTINE TO ADVANCE "CHAR" TO NEXT INPUT CHARACTER TAD CHAR JMS I (OCHAR JMP I (AOUERR JMS I (ICHAR JMP INEFER DCA CHAR TAD CHAR JMP I RCOPY1 INEFER, JMS I (PIPERR 7 RELERR, CLL RAR SZA CLA  /CODE OF 1 MEANS SPECIAL JMS I (PIPERR /ILLEGAL RELOCATABLE INPUT 10 JMS RCOPY1 CLL CML CMA RTL /MULTIPLY NAME COUNT BY -6 (APPROXIMATELY) TAD CHAR CLL CML RAL /(ACTUALLY THIS PRODUCES -6X-1 WHICH IS WHAT WE WANT) JMP RELSNA *4600 ERPRNT, 0  /ERROR MESSAGE PRINTOUT ROUTINE DCA TEMP ERLP, TAD I TEMP RTR RTR RTR JMS ERPCH /PRINT HIGH-ORDER CHARACTER TAD I TEMP JMS ERPCH /PRINT LOW-ORDER CHARACTER ISZ TEMP JMP ERLP ERPCH, 0 AND (77 SNA JMP ERCRLF /0 CHARACTER TERMINATES TAD (-37 SNA JMP FILENR /"_" CHARACTER IS SPECIAL SPA TAD (100 TAD (237 JMS I (TTYOUT JMP I ERPCH FILENR, TAD ("# JMS I (TTYOUT TAD INFPTR /GET PTR TO CURRENT INPUT FILE TAD (321 /MAGIC NUMBER CLL RAR JMP FILENR-2 ERCRLF, TAD (215 JMS I (TTYOUT TAD (212 JMS I (TTYOUT JMP I ERPRNT PDATE, 0  /PRINTS THE DATE SNA JMP I PDATE /NO DATE TO PRINT DCA ERPRNT ISZ I (PBLJMP JMS I (PR6BIT TAD ERPRNT CLL RTL RTL RAL AND (17 JMS I (PRNUM TAD (57 JMS I (PR6BIT TAD ERPRNT RTR RAR AND (37 JMS I (PRNUM TAD (57 JMS I (PR6BIT TAD ERPRNT AND (7 TAD (106 JMS I (PRNUM CLA CMA TAD I (PBLJMP DCA I (PBLJMP /RESET PRNUM TO PRINT LEADING SPACES JMP I PDATE DSKNUM, 0 DCA DSKNAM+1 JMS I (200 12 DSKNAM, 5723 0 0 HLT TAD DSKNAM+1 JMP I DSKNUM RELTBL, -2;-2;2;-10;-2;-2;-2;2;0;2;-2;2;2;2;2;1 ERRTBL, ERR0 ERR1 ERR2 ERR3 ERR4 ERR5 ERR6 ERR7 ERR8 ERR9 ERR10 ERR2, TEXT /OUTPUT ERROR/ *5000  /ERROR MESSAGE TEXT GOES HERE ERR0, TEXT /NO ROOM FOR OUTPUT FILE/ ERR1, TEXT /LINE TOO LONG IN FILE_/ ERR3, TEXT /ERROR DELETING FILE/ ERR4, TEXT /INPUT ERROR, FILE_/ ERR5, TEXT /CAN'T OPEN OUTPUT FILE/ ERR6, TEXT /DEVICE_ NOT A DIRECTORY DEVICE/ ERR7, TEXT /PREMATURE END OF FILE, FILE_/ ERR8, TEXT /ILLEGAL BINARY INPUT, FILE_/ ERR9, TEXT /BAD DIRECTORY ON DEVICE_/ ERR10, TEXT /DIRECTORY ERROR/ *5200  /SQUISH PROCESSOR SQUISH, JMS I (RUSURE /TEST USER'S RESOLUTION! CLA CLL DCA I (OUELEN /INITIALIZE PARAMS TO FAKE OUT "IMTRA" DCA I (OUBLK DCA I (7621 /ZERO SECOND FILE FOR "INNEWF" DCA I (CTCFLG JMS I (IOPEN JMS I (INNEWF JMP I (PIP /NO INPUT TAD (OUDEVH+1 DCA SOHND TAD I (7600 SNA JMP I (PIP /NO OUTPUTEE, NO SQUISHEE JMS I (200 1 SOHND, 0 HLT TAD I (7617 AND (17 TAD (DCB-1 DCA TEMP TAD I TEMP SMA CLA JMS I (PIPERR 6  /NOT A DIRECTORY DEVICE JMS I (OTYPE CLL RTR RAR AND (77 TAD (DEVLEN DCA TEMP TAD I TEMP /GET ENTRY FROM DEVICE LENGTH TABLE DCA OUDLEN /SAVE OUTPUT DEVICE LENGTH TAD I (MPARAM+3 CIA DCA OUWAST TAD SOHND DCA OHNDLR TAD OHNDLR DCA I (OUHNDL TAD I (INHNDL DCA IHNDLR TAD CDIF10 CDF 0 DCA I (7600 TAD (5602 DCA I (7601 TAD (SQCTLC DCA I (7602 CDIF10, CDF CIF 10 JMS I (CTCFLG CIF 0 JMS I IHNDLR 1400 0 P1, 1 JMP I (SQIDER+1 CIF 0 JMS I (7607 5400 0 MTEMP  /MOVE THE INPUT DIRECTORY TO SYS: JMP I (SQIDER+1 CLA IAC DCA I (SQBUF2+2 DCA I (CTCFLG CDF 0 TAD I P1 CDF 10 DCA OUTBLK TAD SOHND CLL TAD (177 SNL CLA JMP .+3 TAD (70  /TRY NOT TO DESTROY THE SYSTEM DEVICE DCA OUTBLK TAD IHNDLR CIA TAD OHNDLR SNA CLA IAC DCA SAME CLA CMA DCA I (SQBUF2 DCA I (OUTSEG JMP I (NEWOUT *5400 NEWIN, TAD (MTEMP-1 DCA INSEG JMS I (CTCFLG CIF 0 JMS I (7607 0210 S7200, SQBUF2 INSEG, 0 JMP I (SQIDER DCA I (CTCFLG TAD I (SQBUF2+1 DCA INBLK TAD (SQBUF2+4 DCA INXR SGETIN, TAD I INXR SNA JMP SEMPTY DCA I OUTXR TAD OUTXR DCA OUSAVE CLA CLL CMA RTL TAD OUWAST DCA TEMP TAD I INXR DCA I OUTXR ISZ TEMP JMP .-3 TAD I (SQBUF2+4 CIA TAD OUWAST TAD INXR DCA INXR TAD I INXR SNA JMP SNULL DCA RECCNT TAD RECCNT CIA CLL TAD OUTBLK TAD OUDLEN SZL CLA JMP SNULER TAD RECCNT DCA I OUTXR CLA CMA TAD I (SQBUF1 DCA I (SQBUF1 TAD INBLK CIA TAD OUTBLK SNA CLA TAD SAME SNA CLA MOVFIL, JMS I (SQTRA /MOVE THE FILE DOWN TAD RECCNT CIA TAD OUTBLK DCA OUTBLK TAD RECCNT DMTX, CIA TAD INBLK DCA INBLK TAD OUTXR CIA TAD OUWAST TAD OUWAST TAD (SQBUF1+365 SMA CLA  /DO WE HAVE ROOM FOR TWO MORE ENTRIES? JMP NEXTIN /DIRECTORY SEGMENT OVERFLOW ON OUTPUT... ISZ I (OUTSEG TAD I (OUTSEG IAC DCA I (SQBUF1+2 /STORE LINK TO NEXT SEGMENT TAD I (SQBUF1+2 TAD (-7 SMA CLA JMP I (SQIDER-1 /TOO MANY SEGMENTS JMS I (OUTDIR /OUTPUT THIS SEGMENT NEWOUT, TAD (SQBUF1-1 DCA OUTXR /INITIALIZE XR FOR NEXT OUTPUT SEGMENT DCA I (OUTINH /ZAP ANY OLD OUTPUT INHIBIT FLAG DCA I OUTXR TAD OUTBLK DCA I OUTXR DCA I OUTXR DCA I OUTXR TAD OUWAST DCA I OUTXR NEXTIN, ISZ I S7200 JMP SGETIN TAD I (SQBUF2+2 SNA  /ANY MORE INPUT SEGMENTS? JMP I (SQOVER JMP NEWIN SNULER, TAD (NOROOM JMS I (ERPRNT SNULL, CLA CMA TAD OUSAVE DCA OUTXR JMP NEXTIN SEMPTY, TAD I INXR JMP DMTX OUSAVE, 0 *5600 SQOVER, DCA I OUTXR TAD OUDLEN TAD OUTBLK SNA JMP CKZERO  DCA I OUTXR CLA CMA TAD I (SQBUF1 DCA I (SQBUF1 CKZERO, TAD I (SQBUF1 SZA CLA JMP ZEROK CLA CLL CML RAR JMS OUTDIR /READ IN LAST DIRECTORY DCA I (SQBUF1+2 /ZERO OUT LINK WORD SKP ZEROK, ISZ OUTSEG JMS OUTDIR ZEROKS, JMS SRSTOR JMP I (PIP DCA I (SQBUF1+2 SQIDER, JMS OUTDIR JMS SRSTOR JMS I (PIPERR 12 OUTDIR, 0 TAD (4210 DCA .+4 JMS CTCFLG CIF 0 JMS I OHNDLR 0 SQBUF1 OUTSEG, 0 JMP SQIDER+1 DCA CTCFLG JMP I OUTDIR SQIOER, TAD (IOMSG JMS I (ERPRNT JMP I (SLGRET SQCTLC, KCC  /JUMPED TO BY CODE AT 07600 TAD SAME SNA CLA JMP ZEROKS TAD (CTCMSG JMS I (ERPRNT TAD CTCFLG SZA CLA JMP I CTCFLG JMP I (MOVFIL SRSTOR, 0 TAD (4207 CDF 0 DCA I (7600 TAD (5000 DCA I (7601 DCA I (7602 CDF 10 JMP I SRSTOR CTCFLG, 0 JMP I CTCFLG CTCMSG, TEXT /SORRY - NO INTERRUPTIONS/ IOMSG, TEXT /I-O ERROR - CONTINUING/ SURE, TEXT /ARE YOU SURE?/ NOROOM, TEXT /NO ROOM - CONTINUING/ PAGE IFNDEF JCA /M AND W OPTION PROCESSOR. /M OPTION PUNCHES LEGIBLE DATE (IF ANY) /W OPTION PUNCHES LEGIBLE MESSAGE CONTAINED IN 1ST /INPUT FILE (IF ANY), AND SIPHONS THE REST OF THE FILES /DOWN, THEN CALLS THE 'LEADER' ROUTINE BEFORE RETURNING. EMM, 0 TAD I (MPARAM+1 /2ND OPTION WORD. SPA CLA  /SKIP IF NO 'M' OPTION JMS DPUNCH TAD I (MPARAM+1 RTR  /'W' INTO LINK SNL CLA  /SKIP IF 'W' OPTION JMP NOTW TAD I (7617 SNA CLA  /SKIP IF ANY INPUT FILES JMP I (PIP JMS I (IOPEN JMS I (ICHAR /GET 1ST CHARACTER  JMP I (PIP /NO INPUT FILE! JMS LPUNCH TAD (NOP DCA I (GETNEW JMS I (ICHAR JMP .+3  /END OF 1ST FILE. JMS LPUNCH JMP .-3 TAD (INNEWX DCA I (GETNEW SIPHON, TAD (7616 DCA 10 TAD (7620 DCA 11 TAD (-22 DCA WCNTR TAD I 11 DCA I 10 /SIPHON FILES. ISZ WCNTR JMP .-3 NOTW, JMS I (LEADER JMP I EMM /DPUNCH PUNCHES THE DATE IN LEGIBLE FORM. WCNTR, DPUNCH, 0 JMS LPUNCH /VERY SHORT LEADER. TAD (LPUNCH DCA I (POCHAR /FAKE OUT PR6BIT. TAD (NOP DCA I (PR6BIT+10 /FAKE OUT ERROR EXIT TAD I (MDATE JMS I (PDATE /PUNCH DATE TAD (5760 /TEMPORARY!!!!!!!!!!!!!!!!!!! DCA I (PR6BIT+10 /RESTORE ERROR EXIT. TAD (OCHAR DCA I (POCHAR /RESTORE PR6BIT. JMS LPUNCH /ANOTHER VERY SHORT LEADER. JMP I DPUNCH /LPUNCH PUNCHES A PAPER-TAPE LEGIBLE CHARACTER /ON THE OUTPUT DEVICE. LPUNCH, 0 TAD (-240 /ASSUME ASCII INPUT. SPA  /SKIP IF PRINTING CHAR. CLA CLL CLL RAL  /*2 TAD (TABLE DCA LPNTR JMS HALF JMS HALF JMS PUNCH JMP I LPUNCH /HALF PUNCHES THE 12-BITS POINTED TO BY LPNTR AS TWO /LINES ON THE PAPER TAPE OUTPUT. /BIT-ORDER IS THE SAME AS FOR THE PDP-12 DSC INSTRUCTION /IN ORDER TO BE ABLE TO USE PREVIOUSLY WORKED OUT /DISPLAY CHARACTERS! HALF, 0 TAD I LPNTR JMS PUNCH TAD I LPNTR CLL RTR;RTR;RTR JMS PUNCH SZ LPNTR JMP I HALF LPNTR, 0 /PUNCH BIT-INVERTS THE LOWER 6 BITS OF THE ACC, AND /PUTS THE RESULTANT CHARACTER INTO THE OUTPUT FILE. PUNCH, 0 AND (77 TAD (100 /ENTER STOP BIT. DCA LTMP DCA LTMP1 PLOOP, TAD LTMP CLL RAR SNA  /NO SKIP WHEN INVERSION THROUGH. JMP PDONE DCA LTMP TAD LTMP1 RAL DCA LTMP1 JMP PLOOP PDONE, TAD LTMP1 JMS I (OCHAR JMP I (AOUERR /WHAT? JMP I PUNCH LTMP, 0 LTMP1, 0 PAGE IFNDEF JCA /DISPLAY CHARACTERS FOR LEGIBLE PUNCHING. THIS TABLE /IS IN SAME FORMAT AS THE PDP-12 DSC INSTRUCTION, SO /THE SAME CODES SHOULD WORK. THESE CODES TAKEN FROM /PDP-12 REFERENCE MANUAL DEC-12-SRZA-D, PAGE 3-34. /THE ORDER IS ASCII-240. TABLE, 0;0 /SPACE 7500;0  /! 7000;70  /" 7777;7777 /# 4731;4275 /$ 3114;0643 /% 5166;0526 /& 3000;1  /' 3600;41  /( 4100;36  /) 2050;50  /* 404;437  /+ 500;6  /, 404;404  /- 1;0  /. 601;4030 // 4136;3641 /0 2101;177 /1 4523;2151 /2 4122;2651 /3 2414;477 /4 5172;651 /5 1506;4225 /6 4443;6050 /7 5126;2651 /8 5122;3651 /9 2200;0  /: 4601;0  /; 2214;41  /< 1212;1212 /= 4100;1422 /> 4020;2055 /? 0;0  /@ 4477;7744 /A 5177;2651 /B 4136;2241 /C 4177;3641 /D 4577;4145 /E 4477;4044 /F 4136;2645 /G 1077;7710 /H 7741;41  /I 4142;4076 /J 1077;4324 /K 177;301  /L 3077;7730 /M 3077;7706 /N 4177;7741 /O 4477;3044 /P 4276;376 /Q 4477;3146 /R 5121;4651 /S 4040;4077 /T 177;7701 /U 176;7402 /V 677;7701 /W 1463;6314 /X 770;7007 /Y 4543;6151 /Z 4177;0  /[ 1060;304 /\ 0;7741  /] 7720;2077 /^ 3614;1455 /_ /PAGE 0 CONTANTS OUTXR=10;INXR=11;IHNDLR=24;OHNDLR=25 SQFLAG=26;OUWAST=27;OUTBLK=30;OUDLEN=31;SAME=32 INBLK=33;RECCNT=34 $$$$$$$$$