/ PS/8 OUTPUT ROUTINE / /***************************************************** / USER EQUATES /******************************************************* / TWOPAG=1 /1 IF 2-PAGEHANDLER IS ALLOWED BUFOUT=6600 /STARTADDRESS OF OUTPUTBUFFER BLKOUT=1 /NUMBER OF OUTPUT BLOCKS HANDL=7200 /STARTADDRESS OF DEVICE HANDLER / /******************************************************** / PROGRAM EQUATES /******************************************************* / PFIELD=10 /FIELD OF PROGRAM IS 1 FILNAM=7601 /ADDRESS OF OUTPUTFILE NAME BUFFLD=10 /FIELD OF BUFFER IS 1 WRITE=4000 /CODE FOR WRITE / /******************************************************* / FIELD 1 / *7200 /USER DEFINED STARTING ADDRESS / / /************************************************** / MAIN-FRAME OF PS8OUT ROUTINE /************************************************** / PS8OUT, 0 /ENTRYPOINT DCA CHAR /SAVE CHAR. RDF /GET FIELD OF USER PROGRAM TAD PSOCIF /SET UP FOR EXIT DCA PSORET CDF PFIELD PSINIT, JMP PSOBEG /INITIALIZE,ONCE ONLY CODING; /AFTER INIT., JMS PACKB /IS STORED HERE JMS PSWRIT /BUFFER FULL, WRITE BUFFER TAD CHAR TAD PSM232 /WAS IT CTRL/Z? SZA CLA JMP PSORET /NO, EXIT DCA CHAR /SET CHAR TO ZERO PSPACK, JMS PACKB /ZERO REST OF BUFFER SKP /BUFFER END JMP .-2 /AGAIN JMS PSWRIT /WRITE BUFFER TO OUTPUTDEVICE CLA CLL IAC RTL /+4 IN AC JMS PSOUSR /CLOSE FILE PSOCIF, CIF CDF 0 /YES, GO TO MONITOR JMP I PS7600 / IN FIELD 0 PSORET, 0 /RESTORE DATA AND INSTR.FIELD JMP I PS8OUT / /************************************************* / SUBROUTINE PACKB /************************************************* / ROUTINE PACKS A STRING IN A BUFFER / POINTERS ARE OUPTR AND OUPKSW / OUPTR POINTS TO ADDRESS / OUPKSW=0: LAST 8 BITS / OUPKSW=-2: FIRST 4 BITS OF 2 WORDS / AFTER STORING IN BUFFER OUPTR AND OUPKSW / POINT TO NEXT BUFFERADDRESS / NORMAL EXIT AT JMS +2 / BUFFER END EXIT AT JMS +1 /************************************************* 7400 PACKB, 0 TAD OUPKSW /TEST PACKSWITCH SZA JMP PACKON /JUMP IF -2 TAD CHAR /GET CHARACTER DCA I OUPTR /INSERT IN BUFFER TAD OUPTR CLL RAR /IS POINTER ODD? SNL CLA /SKIP IF YES JMP .+4 CLL CLA CMA RAL /SET PACKSWITCH TO -2 DCA OUPKSW SKP /NO INCREMENT ISZ OUPTR /INCREMENT POINTER IF EVEN JMP PACKEX /GO TO EXIT PACKON, CLA CMA TAD OUPTR /DECREMENT POINTER DCA OUPTR TAD CHAR /GET CHARACTER RTL RTL /SHIFT 4 POS. TO LEFT DCA PSOBL-1 /SAVE TEMP TAD PSOBL-1 AND PACKB-1 /KILL BITS 4-11 TAD I OUPTR DCA I OUPTR /INSERT IN BUFFER ISZ OUPTR /INCREMENT ADDRESSPOINTER TAD PSOBL-1 ISZ OUPKSW /INCREMENT PACKSWITCH JMP PACKON+4 /AGAIN IF PACKSWITCH NONZERO PS7600, 7600 /CLEAR AC TAD LIMIT /TEST ON BUFFER END TAD OUPTR SPA CLA /SKIP IF BUFFER END PACKEX, ISZ PACKB /SET UP FOR NORMAL RETURN JMP I PACKB /RETURN / / /******************************************************* / ROUTINE TO CALL USR /******************************************************* / FILNAM PSOUSR, 0 DCA PSCALL+1 /STORE FUNCTION CODE TAD PSOUSR-1 /GET ADDRESS OF FILENAME DCA PSCALL+2 TAD PSOBL /GET BLOCKCOUNT DCA PSCALL+3 TAD I PS7600 /GET DEVICE NUMBER PSCALL, JMS I USR 0 /FUNCTION CODE 0 /POINTER TO FILENAME 0 /BLOCKCOUNT JMP ERR2 /ERROR RETURN JMP I PSOUSR /RETURN / /************************************************************ / INITIALIZATION ROUTINE /************************************************************ / PSOBEG, TAD I PS7600 /GET DEVICE NUMBER SNA /TEST IF OUTPUT DEVICE IS SPECIFIED CLA CLL CML IAC RAL /NO, TTY BY DEFAULT DCA I PS7600 TAD I PS7600 JMS I USR /CALL DEVICE HANDLER PSOBL, 1 PSOHND, HANDL+TWOPAG /ENTRYPOINT CLA CLL IAC RAL /ERROR 1 RETURN CLL CML IAC RAL /+3 IN AC OR 7 FOR ERR.MSG JMS PSOUSR /ENTER OUTPUT FILE TAD PSCALL+3 /IS DEVICE FILE-STRUCTURED? SNA /SKIP IF YES CLL CML RAR /NO, SET BLOCKCOUNT TO MAX.VALUE DCA PSCALL+3 /STORE NEG.BLOCKCOUNT TAD PSPACK /GET NEW INSTRUCTION DCA PSINIT /STORE IN MAINPART DCA PSOBL /INITIALIZE BLOCKCOUNT JMP PSINIT /RETURN / / /******************************************************** / ERROR PART /******************************************************** / ERR4, ISZ PSOUSR-1 /WRITE ERROR ERR3, ISZ PSOUSR-1 /FILE TOO LONG ERR2, ISZ PSOUSR-1 /ENTER OR CLOSE ERROR /ERR1: GET DEV.HANDLER ERROR JMP PSOHND+1 /GIVE ERRORMESSAGE / /******************************************************** / ROUTINE TO WRITE BUFFER TO DEVICE /******************************************************** / BLKOUT PSWRIT, 0 TAD PSCALL+2 /GET STARTING BLOCKNUMBER DCA PSOWRI TAD PSCALL+3 /TEST ON FILE OVERFLOW TAD PSWRIT-1 SMA SZA /SKIP IF NO OVERFLOW JMP ERR3 /ERROR 3, AC CLEARED IN PSOHND+1 DCA PSCALL+3 CIF 0 /FIELD 0 JMS I PSOHND /CALL DEVICE HANDLER BLKOUT^200+BUFFLD+WRITE PSOBUF, BUFOUT /BUFFER ADDRESS PSOWRI, -5 /STARTING BLOCKNUMBER JMP ERR4 /ERROR RETURN TAD PSWRIT-1 TAD PSCALL+2 DCA PSCALL+2 /UPDATE STARTING BLOCKNUMBER TAD PSWRIT-1 TAD PSOBL DCA PSOBL /UPDATE BLOCKCOUNT TAD PSOBUF /RESET POINTER DCA OUPTR JMP I PSWRIT /RETURN / /************************************************ / CONSTANTS AND VARIABLES /************************************************ / CHAR, 0 OUPKSW, 0 OUPTR, BUFOUT LIMIT, -BLKOUT^400-BUFOUT USR, 7700 PSM232, -232 / $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$