/PIP PROPER BEGINS HERE /********************** /IMAGE MODE PROCESSOR FOR PIP *2600 IMAGE, JMS I (FIXLEN JMS I (OUTOPN JMS IMTRA IMCLOS, TAD I (OUTINH SZA CLA /WAS THERE AN OUTPUT FILE? JMP I (PIP /NO - DON'T CLOSE IT TAD I (OUCCNT /GET THE LENGTH OF THE OUTPUT FILE DCA IMCCNT TAD I IM7600 JMS I (200 4 /CLOSE 7601 /FILE NAME IMCCNT, 0 JMP I (AOUERR JMP I (PIP ENDFUJ, 0 /PART OF DIRECTORY PRINTING ROUTINE JMS I (PRNUM TAD (-6 JMS I (PRWD /PRINT SIX WORDS 0006 / F 2205 /RE 0500 /E 0214 /BL 1703 /OC 1323 /KS JMS I (PCRLF JMS I (PCRLF /LEAVE A SPACE BETWEEN DIRECTORIES ISZ INEOF /SIMULATE "END OF FILE" FOR INPUT ROUTINE CLA CMA DCA I (INCHCT /AS WELL AS "END OF BUFFER" JMP I ENDFUJ SQTRA, 0 TAD SQTRA DCA IMTRA /FAKE A CALL TO "IMTRA" TAD RECCNT /SETTING UP THE ARGS TO DO THE SQUISHING FOR US DCA I (INCTR TAD IHNDLR DCA IMHNDL TAD INBLK DCA IMREC TAD OUTBLK DCA I (OUCCNT DCA INEOF JMP IMRCLP IMTRA, 0 JMS I (IOPEN /INITIALIZE INPUT ROUTINE IMFILP, JMS I (INNEWF /SET UP PARAMS FOR NEXT FILE JMP I IMTRA /NO NEXT FILE TAD I (INHNDL DCA IMHNDL /GET DEVICE HANDLER ENTRY TAD I (INREC DCA IMREC /AND STARTING BLOCK NUMBER IMRCLP, TAD I (INCTR CLL TAD (15 SNL /IF LINK IS ON, THERE ARE LESS THAN 16 BLOCKS LEFT DCA I (INCTR SZL ISZ INEOF CLL CML CMA RTR RTR RTR TAD (3201 /FORM A FULL OR PARTIAL READ CONTROL WORD DCA IMCTLW JMS I (CTCTST /CHECK FOR ^C CIF 0 JMS I IMHNDL IMCTLW, 0 OUBUF IMREC, 0 JMS I (SLASHG IMERRX-. TAD IMREC TAD (15 DCA IMREC /UPDATE BLOCK NUMBER CLA CLL CML RAR TAD IMCTLW IMOUT, JMS I (OUTDMP /WRITE OUT WHAT WE JUST READ IN JMP I (AOUERR /WRITE ERROR - BAD! TAD INEOF SZA CLA /KEEP READING? JMP IMFILP /NO - OPEN THE NEXT FILE JMP IMRCLP /YES IMHNDL, 0 IMERRX, ISZ INEOF /SIGNAL EOF OR WORSE SPA CLA /WHICH ONE IS IT? JMP IM7600 TAD (6377 /MARCH DOWN THROUGH CORE IMEFLP, DCA CHAR /LOOKING FOR THE FIRST NON-ZERO WORD CDF 0 TAD I CHAR SZA CLA JMP IMNZRO CLA CMA CLL TAD CHAR SZL /IF WE GO THROUGH THE BUFFER WITHOUT A NON-ZERO WORD JMP IMEFLP IM7600, 7600 JMS I (PIPERR /SOMETHING IS WRONG (HANDLER SHOULD HAVE INSERTED 4 /A ^Z AT LEAST) IMNZRO, CDF 10 TAD CHAR CLL CML RAR AND IM7600 TAD (200 /GET THE LENGTH OF THE USEFUL PART OF THE BUFFER JMP IMOUT /AS AN OUTPUT CONTROL WORD AND GO OUTPUT IT *3000 /COMPATIBILITY WITH EARLY "PIP" PIP, JMP PIPCD /NORMAL ENTRY/RE-ENTRY - CALL CD JMP NOPCD /ENTRY FROM CHAIN COMMAND - ASSUME CD AREA SET UP PIPCD, JMS I (200 /OF COURSE THE MONITOR IS IN CORE! 5 /COMMAND DECODE 0 /NO ASSUMED EXTENSIONS ON INPUT NOPCD, DCA SQFLAG /TURN OFF "SQUISH" FLAG TAD PIPSNA DCA I (INCTZF /RESET INPUT SWITCH TO DETECT "^Z"'S TAD I (MPARAM+1 AND (40 /"S" SWITCH SZA CLA JMP I (SQUISH /IT WAS ON - COMPRESS THE INDICATED DEVICES TAD I (MPARAM+2 RTL SZL CLA /"Z" SWITCH IN THE LINK JMS I (DZERO /ZERO DIRECTORY BEFORE PROCEEDING TAD I (MPARAM AND (400 /"D" SWITCH SZA CLA JMS I (DELETE /DELETE ANY OUPUT FILES BEFORE PROCEEDING TAD I (MPARAM AND (301 /"E","F" AND "L" SWITCHES SZA /ANY ONE OF THEM ON? JMP I (DIR /YES - LIST A DIRECTORY TAD I (7617 SNA CLA JMP PIP /TERMINATE HERE IF NO INPUT SIDE TAD I (MPARAM RTL AND (40 /"I" SWITCH ROTATED TWO LEFT SZA CLA JMP I (IMAGE /IMAGE MODE TRANSFER SZL CLA /NO SKIP IF 'B'. JMP I (BINARY /DEFAULT MODE OF TRANSFER IS ASCII ASCII, TAD I (MPARAM+1 AND (20 DCA COPTSW TAD COPTSW SNA CLA JMS I (FIXLEN /IF WE ARE NOT DOING ANY EDITING THEN /TRY TO APPROXIMATE OUTPUT LENGTH JMS OUTOPN DCA AEOFFG /ZERO THE END-OF-FILE FLAG JMS I (EMM /CHECK 'M' AND 'W' OPTIONS. JMS I (IOPEN /OPEN THE INPUT FILES JMP I (ASCIGO OUTOPN, 0 JMS I (OOPEN /OPEN OUTPUT FILE. SMA CLA /WHAT KIND OF ERROR? JMP I OUTOPN /OPEN OK OR NO FILE TO OPEN / NO DIFFERENCE JMS I (PIPERR 5 /PART OF ASCII PROCESSOR - CLEAN UP AT END OF LINE AND END OF FILE LFEED, TAD CHAR DCA I XR /PUT THE LINE FEED IN THE LINE BUFFER EOL, DCA I XR /MARK THE END OF USEFUL INFO JMS I (CTCTST TAD (ABUF-1 DCA XR /RESET BUFFER POINTER EOLLP, TAD I XR /GET A CHARACTER FROM THE LINE BUFFER PIPSNA, SNA /ZERO MEANS NO MORE CHARS JMP EOFTST JMS I (OCHAR /OUTPUT THE CHARACTER JMP AOUERR JMP EOLLP EOFTST, TAD AEOFFG SNA CLA /END OF INPUT ENCOUNTERED? JMP I (ASCIGO /NO - GET NEXT LINE ACLOSE, JMS I (OCLOSE /YES - CLOSE THE OUTPUT FILE JMP AOUERR /ERROR ON CLOSE JMP PIP AOUERR, SMA CLA /WAS IT A DEVICE ERROR OR ARE WE OUT OF SPACE? JMP BOUERR /OUT OF SPACE JMS I (PIPERR 2 BOUERR, JMS I (PIPERR 0 /ENTRY ON END OF INPUT ASCEOF, SPA CLA /WAS IT END OF INPUT OR AN INPUT ERROR? JMS I (PIPERR /INPUT ERROR 4 ISZ AEOFFG /SET END-OF-INPUT FLAG JMP EOL /PROCESS LAST LINE (IF ANY) AEOFFG, 0 /SUBROUTINE TO OUTPUT RUBOUTS AFTER FORM CONTROL CHARACTERS RUBOUT, 0 /UNLESS OUTPUT IS TO A DIRECTORY DEVICE DCA TEMP /STORE COUNT JMS I (OTYPE /GET TYPE OF OUTPUT DEVICE SPA CLA JMP I RUBOUT /DIRECTORY DEVICE - DON'T BOTHER RBTLP, TAD CHAR TAD (-214 SNA CLA /IS THE FORM CONTROL CHAR A FORM-FEED? IAC /YES - OUTPUT BLANK TAPE INSTEAD TAD (377 DCA I XR /PUT IN BUFFER ISZ TEMP JMP RBTLP /LOOP FOR THE REQUISITE COUNT JMP I RUBOUT COPTSW, 0 DEND, SPA CLA JMP ASCEOF+1 JMP ACLOSE *3200 /ASCII PROCESSOR CONTINUED ASCIGO, TAD (ABUF-2 DCA XR DCA I XR /PROTECT AGAINST NULL LINE WITH "T" OPTION DCA COLCT /ZERO COLUMN COUNTER FOR TAB CONVERSION ACHLP, JMS I (ICHAR /GET A CHARACTER JMP I (ASCEOF /END OF INPUT OR WORSE AND (177 /MASK OUT PARITY BIT SNA JMP ACHLP /IGNORE BLANK TAPE AND LEADER/TRAILER TAD (-177 SNA JMP ACHLP /DITTO RUBOUTS TAD (377 /FORCE COLUMN 8 ON DCA CHAR TAD CHAR TAD (-216 CLL TAD (5 SNL /IS THE CHARACTER A FORM CONTROL CHARACTER? JMP CINSRT /NO TAD ASCJMP /YES - GO TO APPROPRIATE ROUTINE DCA .+1 HLT ASCJMP, JMP I .+1 TAB LFEED VTAB FFEED CARRET CINSRT, CLA TAD CHAR ADCAXR, DCA I XR /STORE THE CHARACTER IN THE LINE BUFFER ISZ COLCT /ALWAYS BUMP THE COLUMN POINTER TESTXR, TAD XR TAD (-ABUF-226 SPA CLA /HAS THE BUFFER OVERFLOWED? JMP ACHLP /NO - GET NEXT CHARACTER JMS I (PIPERR 1 TAB, TAD I (COPTSW SNA CLA /DO WE WANT TO CONVERT? JMP TABRBT /NO TABLP, TAD (240 DCA I XR /OUTPUT A SPACE ISZ COLCT TAD COLCT AND (7 SZA CLA /IS THE COLUMN COUNTER A MULTIPLE OF 8? JMP TABLP /NOT YET JMP TESTXR /YES - CHECK BUFFER OVERFLOW TABRBT, TAD CHAR DCA I XR CLA CMA JMS I (RUBOUT /TWO RUBOUTS FOLLOW A TAB JMP TESTXR /CHECK FOR BUFFER OVERFLOW VTAB, TAD I (COPTSW SZA CLA /SHOULD WE CONVERT? JMP VTLF /YES TAD CHAR DCA I XR TAD (-4 JMS I (RUBOUT /FOUR RUBOUTS AFTER A VERTICAL TAB JMP I (EOL FFLF, TAD (-4 /NINE LINE FEED SIMULATE A FORM FEED VTLF, TAD (-5 /FIVE LINE FEEDS SIMULATE A VERTICAL TAB DCA TEMP TAD (212 DCA I XR ISZ TEMP JMP .-3 JMP I (EOL /FORM FEED AND VERTICAL TAB ARE LINE ENDERS FFEED, TAD I (COPTSW SZA CLA /SHOULD WE CONVERT? JMP FFLF /YES TAD CHAR DCA I XR TAD (-11 /NINE RUBOUTS AFTER A FORM FEED JMS I (RUBOUT JMP I (EOL CARRET, TAD I (MPARAM RTL SMA CLA /"C" SWITCH MEANS DELETE TRAILING BLANKS FROM CARDS JMP NOTOPT /IT WASN'T ON TOPT, TAD XR DCA TEMP TAD I TEMP TAD (-240 SZA CLA /WAS THE LAST CHAR ON THE LINE A SPACE? JMP NOTOPT /NO CLA CMA TAD XR /YES - BACK UP THE LINE POINTER DCA XR JMP TOPT NOTOPT, TAD CHAR DCA I XR /STORE THE CARRIAGE RETURN IN THE BUFFER JMP TESTXR /CARRIAGE RETURN IS NOT A LINE TERMINATOR COLCT, 0 *3400 /SUBROUTINES CALLED BY THE REST OF PIP DELETE, 0 /DELETES THE FILES ON THE OUTPUT SIDE OF THE CD LIST TAD (7600 DCA DPFILE CLA CLL CMA RTL DCA CHAR /MAXIMUM OF THREE OUTPUT FILES DELOOP, TAD (OUDEVH+1 DCA DLHNDL TAD I DPFILE SNA /DOES THIS FILE EXIST? JMP I DELETE /NO - THATS ALL JMS I (200 1 /ASSIGN HANDLER FOR THE DELETION DLHNDL, 0 HLT TAD I DPFILE /RELOAD DEVICE NUMBER FOR DELETE ISZ DPFILE /BUMP DPFILE TO POINT TO THE FILE NAME JMS I (200 /DEVICE NUMBER IN AC DP4, 4 /CLOSE - USED AS DELETE IN THIS CASE DPFILE, 0 /POINTER TO FILE NAME 0 /ZERO LENGTH FOR DELETE JMS I (PIPERR /FILE WASN'T THERE TO BE DELETED 3 TAD DPFILE TAD DP4 DCA DPFILE ISZ CHAR JMP DELOOP /DELETE AS MANY FILES AS HE LISTED(UP TO 3) JMP I DELETE DZERO, 0 /SUBROUTINE TO ZERO THE DIRECTORY OF THE /FIRST OUTPUT DEVICE JMS I (OTYPE CLL RTL SZL /IS DEVICE READ-ONLY? JMP OZERR /YES - ERROR RTR AND (770 /MASK OUT DEVICE TYPE CLL RTR RAR TAD (DEVLEN /USE IT TO INDEX A TABLE OF DEVICE LENGTHS DCA TEMP TAD I TEMP SNA JMP I DZERO /DEVICE LENGTH ZERO MEANS NON-DIRECTORY DEVICE DCA TEMP /STORE LENGTH TAD (OUDEVH+1 DCA OZHNDL TAD I (7600 JMS I (200 1 /ASSIGN DEVICE, FETCH HANDLER OZHNDL, 0 HLT TAD OZHNDL TAD (171 SNA CLA /IS THE DEVICE EQUIVALENT TO "SYS"? JMS I (RUSURE /YES,TEST USER'S RESOLUTION. TAD (7 /FILE ORIGIN FOR NON-SYSTEMS DEVICE DCA DFORG TAD TEMP TAD DFORG DCA DLENGT TAD I (MPARAM+3 CIA DCA DWASTE /DEFINE THE NUMBER OF WASTE WORDS CIF 0 JMS I OZHNDL 4210 /OUTPUT 1 BLOCK FROM FIELD 1 DIRECT 1 /ALL DIRECTORIES ARE IN RECORD 1 OZERR, JMS I (PIPERR /ERROR WHILE ZEROING DIRECTORY 2 DCA OLDDIR /ZERO DIRECTORY POINTER TO FORCE A NEW READ JMP I DZERO PIPERR, 0 CLA CDF 10 /JUST IN CASE TAD I PIPERR /GET ARG TAD (ERRTBL DCA TEMP TAD I TEMP JMS I (ERPRNT JMP I (PIP /RESTART PIP TTYOUT, 0 TLS TSF JMP .-1 CLA JMP I TTYOUT /NOT DEVICE INDEPENDENT - TOUGH BLEEP LEADER, 0 JMS I (OTYPE AND (770 /GET THE TYPE OF THE OUTPUT DEVICE TAD (-PTP /IS IT A PAPER TAPE PUNCH? SZA CLA JMP I LEADER /NO TAD (7600 DCA TEMP JMS I (OCHAR /PUT OUT SOME LEADER JMP I (AOUERR ISZ TEMP JMP .-3 JMP I LEADER DIRECT, -1 /DUMMY DIRECTORY FOR /Z OPTION DFORG, 0 /FILE OROGIN 0 /LINK 0 /FLAG DWASTE, 0 /NUMBER OF GARBAGE WORDS 0 /UNUSED SPACE DLENGT, 0 /LENGTH OF UNUSED SPACE *3600 /TABLE OF DEVICE LENGTHS FOR /Z OPTION DEVLEN, 0;0;0;0;0;1520 /RK08 (1520= - DECIMAL 3248) 6000;4000;2000;0001 /RF08 IN VARIOUS SIZES /(CHEATS A BLOCK ON LARGEST TO KEEP IT NON-ZERO) 7601;7401;7201;7001 /DF32 IN VARIOUS SIZES /(CHEATS A BLOCK TO AVOID HARDWARE TROUBLE) 6437;6437 /DECTAPE AND LINCTAPE ZBLOCK 60 /OTHER DEVICES FIXLEN, 0 /ROUTINE TO ESTIMATE OUTPUT FILE LENGTH TAD I (7600 AND (7760 SZA CLA /DID THE USER PROVIDE AN ESTIMATE? JMP I FIXLEN /YES - USE IT DCA CHAR TAD (7617 DCA TEMP FIXLP, TAD I TEMP /GET NEXT INPUT FILE SNA JMP FIXOVR /NO MORE INPUT FILES AND (7760 CIA CLL /GET LENGTH AS A POSITIVE NUMBER /(LENGTH OF ZERO TURNS LINK ON) TAD CHAR DCA CHAR /UPDATE CUMULATIVE LENGTH SZL CLA /DID CUMULATIVE LENGTH OVERFLOW 256 BLOCKS? JMP I FIXLEN /YES - CAN'T ESTIMATE IT ISZ TEMP ISZ TEMP JMP FIXLP FIXOVR, TAD CHAR TAD I (7600 DCA I (7600 /STICK LENGTH IN OUTPUT FILE DESCRIPTOR JMP I FIXLEN PWRTEN, -1750;-144;-12;-1;0 RUSURE, 0 /IS USER REALLY SURE? TAD (SURE JMS I (ERPRNT /TYPE OUT "ARE YOU SURE?" KSF JMP .-1 /WAIT FOR REPLY JMS I (CTCTST /WAS REPLY ^C? RETURN TO MONITOR KRB TAD (-"Y SNA CLA ISZ SQFLAG /IT WAS "YES"! TAD SQFLAG CLL RAL TAD (NOYES JMS I (ERPRNT /PRINT "NO" OR "YES" TAD SQFLAG SNA CLA /WELL, DO WE OR DON'T WE? JMP I (PIP /WE DON'T TAD (61 JMP I RUSURE /BE SURE TO CLA AFTER THIS IF YOU /DONE LIKE THE 61 IN THE ACC! NOYES, TEXT /NO/ TEXT /YES/ /DIRECTORY PRINTER FOR PIP MDATE=7666 *4000 DIRPRE, JMS I (OUTOPN /OPEN THE OUTPUT FILE TAD (ABUF DCA CHAR /ABUF WILL BE A TEMPORARY ARRAY OF STARTING FILES TAD (7617 DCA TEMP TAD I (7617 SNA JMS I (DSKNUM DCA I (7617 /DEFAULT DIRECTORY IS DSK: DFUJLP, TAD I TEMP SNA /ARE WE THROUGH WITH THE INPUT DEVICES? JMP GETDIR /YES AND (17 DCA I TEMP /ONLY THE DEVICE NUMBER IS IMPORTANT TAD I TEMP TAD (DCB-1 DCA PRWD CLA CLL CML RTL TAD TEMP DCA INFPTR /THIS SERVES NO FUNCTION EXCEPT IMPROVING ERROR MESSAGES TAD I PRWD SMA CLA /IS THE DEVICE A DIRECTORY DEVICE? JMS I (PIPERR /NO 6 ISZ TEMP TAD I TEMP DCA I CHAR /SAVE THE STARTING BLOCK NUMBER CLA IAC DCA I TEMP /READ FROM THE DIRECTORY ISZ TEMP ISZ CHAR JMP DFUJLP GETDIR, TAD (ABUF DCA CHAR JMS PCRLF TAD I (MDATE JMS I (PDATE JMS PCRLF JMS I (IOPEN /RESET POINTERS - WERE GONNA FAKE OUT THOSE "GENERAL" /ROUTINES JMP I (NXTDIR PRWD, 0 /ROUTINE TO PRINT SIXBIT TEXT SNA /IS COUNT ZERO? CMA /MAKE IT ONE DCA PRCT /STORE COUNT PRWDLP, TAD I PRWD RTR RTR RTR JMS PR6BIT TAD I PRWD JMS PR6BIT ISZ PRWD ISZ PRCT JMP PRWDLP JMP I PRWD PRCT, 0 PR6BIT, 0 AND (77 SZA TAD (-40 SPA TAD (100 TAD (240 /CONVERT SIXBIT TO ASCII JMS I POCHAR JMP I (AOUERR JMP I PR6BIT PRNUM, 0 DCA PRWD DCA TEMP TAD (PWRTEN DCA PCRLF PRNMLP, DCA PR6BIT TAD I PCRLF SNA JMP I PRNUM CLL TAD PRWD SNL JMP .+4 DCA PRWD ISZ PR6BIT JMP PRNMLP+1 CLA TAD PR6BIT TAD TEMP SNA PBLJMP, JMP PRBLNK /INCREMENTED BY PDATE TO KILL LEADING BLANKS TAD (260 JMS PR6BIT CLA CLL CML RAR DCA TEMP ISZ PCRLF JMP PRNMLP PRBLNK, JMS PR6BIT JMP .-3 PCRLF, 0 TAD (215 JMS I POCHAR JMP I (AOUERR TAD (212 JMS I POCHAR JMP I (AOUERR JMP I PCRLF POCHAR, OHAR