
/
/OUTPUT FILE HANDLER
/REPLACES PTP HANDLER
/EXTERNALS: MAPAD, LOC16, LOC17, FILE0, FILE1
/           SEARCH, DELETE, CREATE
/           SYS001, SYS002
/           MEMA, MEMB
/
OUTHAN DAC OARGP
       ISZ OARGP   /POINT TO CAL+1
       JMS COMIN
       LAC* OARGP   /GET CAL FUNCTION CODE
       ISZ OARGP    /POINT TO CAL+2
       TAD OJUMP
       DAC ODSPCH
ODSPCH 0            /MODIFIED JUMP
       JMP OINIT
       JMP ORETN1
       JMP OERR6
       JMP OENTER
       JMP ORETN
       JMP OCLOSE
       JMP ORETN
       JMP OERR6
       JMP OWRITE
       JMP ORETN
       JMP OERR6
ORETN1 ISZ OARGP   /POINT TO CAL+3
ORETN  JMS COMOUT
       CLA
       JMP* OARGP  /RETURN
OERR6  JMS COMOUT
       LAW 6
       JMP 4       /MONITOR ERROR DIAG.
OERR14 JMS COMOUT
       LAW 14
       JMP 4
OERR15 JMS COMOUT
       LAW 15
       JMP 4
OARGP  0
OJUMP  JMP ODSPCH
/
/
OINIT ISZ OARGP   /POINT TO CAL+3
      LAC (64
      DAC* OARGP  /SET LINE BUFFER SIZE
      ISZ OARGP   /POINT TO RETURN LOC
      JMP ORETN
OENTER LAC* OARGP /GET FILE NAME POINTER
       DAC OENT0  /SAVE
       LAC* OENT0  /TEST FIRST CHAR IN NAME
       AND (770000   / IS IT "?"
       SAD (770000
       JMP OENT1
/CORE OVERLAY
       JMS MEMSET
       LAC OENT0    /POINT TO FILE NAME
       JMS SEARCH
       SMA
       JMS DELETE
       LAC OENT0
       JMS CREATE   /CREATE NEW FILE
       DAC OENT3    /SAVE RESULT
/
/RESTORE CORE
       JMS MEMRES
       LAC OENT3    /TEST STORAGE
       SNA
       JMP OERR15   /DRUM FULL
       SPA
       JMP OERR14   /DIRECTORY FULL
       DAC OBLOCK   /SAVE BLOCK#
       LAC OFILAD   /GET OUTPUT FILE
       TAD (3       /POINT TO LOC BEFORE FIRST ENTRY
       DAC OFILP    /SET UP FILE POINTER
       LAC (2
       DAC OWC      /INITIALIZE WORD PAIR COUNT
       ISZ OARGP    /POINT TO RETURN LOC
       JMP ORETN
OENT1  JMS COMOUT   
       LAW 13      /FILE NAME ERROR
       JMP 4
OENT0  0
OENT3  0
OFILAD FILE1
OFILP  0
OWC    0
OBLOCK 0
/
/
OWRITE LAC* OARGP    /GET LINE BUFFER ADDRESS
       DAC OLBUF
       ISZ OARGP     /POINT TO -W
       ISZ OARGP     /POINT TO RETURN LOC
       LAC OLBUF
       TAD (-1
       DAC 16
       LAC* 16       /GET HW0
       ISZ 16        /SKIP HW1
       SWHA
       AND (377
       DAC LBWC      /SAVE LB WPC
       TAD OWC       /ADD FILE BUFFER COUNT
       CMA!IAC
       TAD (200
       SMA
       JMP OWRT1     /BUFFER SPACE OK
       JMS FRBLK     /LOOK FOR A NEW BLOCK
       SNA
       JMP OERR15    /DRUM FULL
       DAC OBLK1     /SAVE NEW BLOCK#
       JMS SFLBT     /SET MAP BIT
       LAC OFILAD
       TAD (-1
       DAC 17         /SET UP OLD FILE POINTER
       LAC OWC
       DAC* 17       /EPOSIT WORD PAIR COUNT
       DZM* 17       /NO CHECKSUM
       LAC OBLK1
       DAC* 17       /DEPOSIT NEXT BLOCK POINTER
       DZM* 17       /NULL NEXT WORD
       LAC OBLOCK    /WRITE OLD BLOCK
       JMS DROUT
       FILE1
/
/INITIALIZE BUFFER AREA AGAIN
       LAC OBLK1
       DAC OBLOCK
       LAC OFILAD
       TAD (3
       DAC OFILP
       LAC (2
       DAC OWC
OWRT1  LAC OFILP
       DAC 17        /SET UP FILE POINTER
       LAC LBWC
       CMA!IAC       /NEGATE
       DAC LBWC
OWRT2  ISZ LBWC      /REMEMBER FIRST PAIR IS IGNORED
       SKP
       JMP OWRT3     /TRANSFER COMPLETE
       LAC* 16       /TRANSFER ONE PAIR
       DAC* 17
       LAC* 16
       DAC* 17
       ISZ OWC       /UPDATE WPC
       JMP OWRT2
OWRT3  LAC 17
       DAC OFILP     /RESTORE FILE POINTER
       JMP ORETN
OLBUF  0
LBWC   0
OBLK1  0
/
/
