
 .TITLE RMNTR         / *** RESIDENT MONITOR ***
                      /WRITTEN BY V. KEZYS
                      /FOR EXPANDED PDP-15/20.
                      /FILE OPERATION ON
                      /258K DRUM.
 .ABS
SPFAL=703201
MTSF=707301
MTSE=707341
MTLC=707304
MTCL=707302
MTGO=707344
CLSF=705341
DRSF=707001
MTRS=707352
LSDF=706501	/DEC. STANDARD
RSF=700101
PSF=700201
KSF=700301
TSF=700401
IOF=700002
ION=700042
CAF=703302
DRDA=707004
DRCF=707002
DRRS=707212
ARGP=ARGPT
TLS=700406
KRB=700312
DRCL=707201
 .TITLE PICENT       /PROG. INT. ENTRY POINT
 .LOC 0
PIC 0	
 IOF
 DAC AC
 JMP SKPCHN
 .TITLE MNTPRM          /MONITOR PARAMETERS
ARGPT
ARG
DAT
FN 0       /FILE NO.
 .TITLE RMC          /RESIDENT MONITOR CONTROL
 .LOC 20
CALPT 0
 ION
 777776
 ADD CALPT
 DAC CALPT
 DAC ARGPT
 774000     / (774000
 AND* CALPT     /CHECK FOR IND. CAL
 SNA
 JMP .+3
 JMS ERR
 1001
 ISZ ARGPT	/ *FUNC. TEST*
 LAC* ARGPT
 DAC ARG	/2ND ARG
 SPA        	/CHECK FOR +VE FUNC.
 JMP ER0
 SNA       	/CHECK FOR 0 FUNC.
 JMP ER0	/ILLEGAL
 TAD (377760
 SPA        	/CHECK IF GT. 20
 JMP ER0	/IF SO - ERR. (0)
 LAC ARG
 TAD (377764	/CHECK IF MCR
 SPA
 JMP MCR
 LAC* CALPT
 JMS DATD       /DETERMINE AND CHECK .DAT
 TAD (JMP DTDSP
 DAC DTDSP
 CLA
 JMP DTDSP
/
DATD 0          /TO DETERMINE AND CHECK .DAT
 AND (777
 DAC DAT	/ACTUAL .DAT
 AND (400	/-VE .DAT?
 SNA
 JMP PDAT	/+VE .DAT
 LAC DAT	/-VE .DAT
 TCA
 ADD (377762
 SPA        	/SKP IF .DAT LEGAL
 JMP ER2
 LAC DAT
 TCA
 AND (777
 JMP* DATD
 .TITLE  .SCOM
 .LOC 100      /.SCOM TABLE
 17717    /1ST FREE REG. BELOW SYS. BOOTSTRAP
 1500     /1ST FREE REG. ABOVE RESIDENT MNTR.
 0        /1ST FREE REG.
 0        /LAST FREE REG.
 0        /HARDWARE OPTIONS.
 0         /SYS. PROG. STARTING ADD.
 3760    /USER STARTING ADD.
 .LOC 120       /REMAINING TABLE NOT APLICABLE
AC 0
PDAT LAC DAT
 CLL!SNA
 JMP ER2
 777767
 ADD DAT
 SZL
 JMP ER2
 ADD (26
 JMP* DATD
ER0 JMS ERR
 1000
ER2 JMS ERR
 1002
ERR 0
 LAC* ERR
 DAC ERCD
 LAC 0
 DAC PC
 LAC 20
 DAC ECAL
 IORS
 DAC IOR
 DRRS
 DAC DRR
 MTRS
 DAC MTR
 CAF     /CLEAR ALL FLAGS.
 JMP EXIT+1
ERCD
PC
ECAL
IOR
DRR
MTR
 ADD (377767	/LEGAL .DAT ?
 SPA
 JMS ERR
 1002
 LAC DAT
 ADD (15	/APPEND TO DAT TABLE
 JMP* DATD   /RET.
 JMS ERR
 1001
 JMP ER0	/ILLEGAL CAL FUNC.
MCR AND (7  /ADJUST FOR DISPACH
 TAD (JMP MCRDSP+1
 DAC MCRDSP
MCRDSP XX
 .REPT 5
 JMP EXIT
EXIT DZM ERCD
 LAC 111      /CHECK IF NRMNTR IN
 SZA
 JMP 7000     /START IT
 LAC 0
 DAC 117
 LAC AC
 DAC 116      /SAVE AC.
 760000
 DAC 17764    /#WDS. - 8K
 777777
 DAC 17765
 LAC (750005
 IOF
 DRDA
 DRSF
 JMP .-1
 3760-17777
 DAC 17764
 LAC (3757
 DAC 17765
 LAC (7000
 DAC 17760
 LAC (720004
 JMP 17720
 760000
 DAC 115
 777774
 DAC 17764
 LAC (114
 DAC 17765
 
 .TITLE DATDSP           /.DAT DISPACHING
DTDSP XX            /.DAT DISPACH
 JMP DR.      / .DAT -1
 JMP TTY      / -2
 JMP TTY      / -3
  .REPT 3
 HLT
 JMP DR2
 JMP DR1      / -10
 JMP DR0
 NOP
 JMP DR1
 JMP DR0      / -14
 JMP DR0      / -15
 .REPT 3
 HLT
 JMP TTY      / +4
 JMP TTY      / +5
 JMP DR0      / .DAT +6
 JMP DR1      / +7
 JMP DR.     / +10
/  END OF .DAT TABLE
/
 .TITLE FILE TABLE
DR6 IAC
DR5 IAC
DR4 IAC
DR3 IAC
DR2 IAC
DR1 IAC
DR0 DAC FN       /STORE FILE NO.
 CLL!RAL
 DAC J      /TEMP.
 CLL!RAL
 ADD J      / x6
 ADD (FT
 DAC FTAD
 JMP DR.
FTAD 0
FTABP 0
FT 260004     /START OF DATA BLOCK,POINTER
 777000     /NO. OF WDS LEFT
 0         /NEXT SECTION AD.
 260000      /FIRST SECTION AD.
 0         /NO. OF WDS. WRITTEN
 0         /START OF SECTION AD.
 264004      /2ND FILE
 777000
 0
 260000
 0
 0
 22400
 770000
 0
 224000
 0
 0
 .REPT 40
  0
 .TITLE SKPCHN        / SKIP CHAIN
SKPCHN SPFAL	/POWER FAIL
 SKP
 HLT
 MTSF	/MAG. TAPE DONE
 SKP
 JMP MINT
 MTSE	/MAG. TAPE ERR.
 SKP
 JMP MERR
 DRSF	/DRUM DONE
 SKP
 JMP DINT
 CLSF	/CLOCK OVERFLOW
 SKP
 HLT
 LSDF	/PRINTER DONE
 SKP
 HLT
 RSF	/PT. RD. DONE
 SKP
 HLT
 PSF	/PT. PUNCH DONE
 SKP
 HLT
 KSF	/KEYBOARD RDY.
 SKP
 JMP KINT
 TSF	/TELEPRINTER DONE
 SKP
 JMP TINT
 JMS ERR   /ILLEGAL INTERUPT
 1003
 .REPT 15         /5 SKPCHN ENTRIES AVAILABLE
 HLT
 .TITLE DRUM HANDLER     /VERSION 2A
DR. LAC* ARGP
 ISZ ARGP
 TAD (JMP DRPCH    /DR. ENTRY PT
 DAC DRPCH
DRPCH XX
 JMP DRINIT
 CLA
 CLA
 JMP OUT1
 JMP* ARGP
 JMP DCLS     
 JMP* ARGP
 JMP DREAD
 JMP DRWRT
 SKP
 JMP DRTRAN
 JMS WT
DUND 0
DRINIT ISZ ARGP      /DRUM INITIALIZE
 LAC (777732          /BUFFER SIZE
 DAC* ARGP
 DRCL
 LAC FTAD
 AAC+3
 DAC FTABP
 LAC* FTABP
 DAC PJ
 JMS NTB
 DZM DUND
 DZM CONT
 JMP OUT1
DCLS LAC FTAD     /CLOSE A DRUM FILE
 TAD (4
 DAC FTABP
 LAC* FTABP
 SNA
 JMP RCLS        /READ FILE
 IAC
 DAC SVAD         /TEMP.
 ISZ FTABP
 LAC* FTABP       /SECT. START AD.
 IAC
 DAC PJ           /STORE FOR WRITE
 ADD (3
 DAC* FTAD        /RESTORE DATA POINTER
 LAC FTAD
 IAC
 DAC FTABP        /POINT TO #WDS
 LAC SVAD         /#WDS WRITTEN
 DAC* FTABP
 JMS NTB
 JMP* ARGP
/
RCLS 777776
 ADD ARGP   /RESET FOR RETURN FROM INIT
 DAC ARGP
 JMP DRINIT+3
/
WT 0
 LAC* CALPT         /WAIT OR WAITR
 AND (1000
 SNA
 JMP NR
 DAC J
 ISZ ARGP
 LAC* WT       /DEV. UNDERWAY FLAG
 SZA
 JMP* J
 ISZ ARGP
 JMP* ARGP
NR 700042
 LAC* WT
 SZA
 JMP NR
 JMP* ARGP
DREAD DZM DW
 JMP STUP
/
DRWRT CLA!CMA
 DAC DW
 JMP STUP
/
DRTRAN LAC DUND
 SZA
 JMP* CALPT
 LAC* CALPT
 AND (10000
 SZA
 CLA!IAC
 ADD* ARGP
 DAC DRCOM
 ISZ ARGP
 LAC* ARGP
 DAC 17765
 ISZ ARGP
 LAC* ARGP
 DAC 17764
 LAC DRCOM
 JMP TRN
/
STUP LAC DUND
 SZA
 JMP* CALPT
 LAC* ARGP
 707764
 DAC DHDP
 AAC-1
 DAC 17765
 ISZ ARGP
 777732
 DAC NW
COMP LAC FTAD
 DAC FTABP
 ISZ FTABP
 LAC* FTAD
 DAC DRCOM
 LAC* FTABP
 TCA
 TAD NW
 AND (777776
 SPA
 JMP SPLT
 TCA
 DAC* FTABP   /# OF WDS LEFT
 LAC NW
 IAC
 AND (777776
 DAC 17764
 TCA     /DR AD PT.
 ADD* FTAD  /MOVED FOR NEXT 
 DAC* FTAD  /TRANSFER SEQ.
 DZM CONT
TR LAC DW   /ENTRY FROM A SPLIT CONT.
 TCA
 ADD DRCOM        /INC. FOR WRITE
TRN DAC DRCOM
 CLA!CMA
 DAC DUND
 LAC FTAD
 AAC+4      /LAST ENTRY
 DAC FTABP
 LAC DW
 SNA
 JMP RCHK     /CHECK IF READ AFTER WRITE
 LAC 17764
 ADD* FTABP    /COUNT NO. OF WDS. WRITTEN
 DAC* FTABP
DCOM LAC DRCOM       /EXECUTER DRUM COMM.
 DRDA
OUT1 ISZ ARGP
IGN JMP* ARGP
/
RCHK LAC* FTABP         /CHECK IF READ AFTER WRITE
 SZA       /IF SO
 JMP DOFLO      /END OF FILE
 JMP DCOM       /READ
/
SPLT SNA        /SPLIT TRANSF.;NEW # OF WDS.
 JMP DEOI
 DAC NW         /STORE IT
 LAC* FTABP
 DAC 17764
 CLA!CMA        /SET TRNSF. TO 
 DAC CONT        /BE CONT.
 JMP TR
/
SPLTC DZM CONT
 LAC FTAD
 AAC+2
 DAC FTABP
 DZM* FTABP
 ISZ FTABP
 LAC* FTABP        /IF DR. AD=0
 SNA          /IF SO
 JMP DEOI     /END OF INFO
 DAC PJ
CMP JMS NTB     /READ IN NEW TABLE
 JMP COMP
DEOI LAC DW
 SNA
 JMP DOFLO    /READ OPPERATION
 LAC PJ       /ADD . OF LAST TBL TRNSF.
 IAC
 DAC PJ
 IAC
 DAC* FTAD   /RESET PRS AD.
 LAC EXT
 DAC* FTABP      /PT TO NEW SECTION
 JMS NTB      /RE-WRITE LAST TBL
 LAC EXT   /EXT FILE AD.
 IAC
 DAC PJ
 AAC+3
 DAC* FTAD
 LAC FTAD
 IAC
 DAC FTABP
 LAC NW
 DAC* FTABP
 TCA
 ADD EXT        /MOVE EXTENTION AD.
 DAC EXT
 ISZ FTABP
 DZM* FTABP
 JMP CMP    /NEW TABLE FORMED
DOFLO LAC (2005
 DAC* DHDP
 ISZ DHDP
 TCA
 DAC* DHDP
 ISZ DHDP
 DZM* DHDP
 JMP DFIN
/
NTB 0       /READ OR WRITE A FILE TABLE
 707764
 LAC 17765  /SAVE CORE ADD.
 DAC SVAD
 777774
 DAC 17764  /TABLE IS 4 WDS.
 777776
 ADD FTAD   /SET AD PT-1
 DAC 17765
 LAC FTAD
 AAC+6
 DAC FTABP  /POINT TO SECT START 
 LAC PJ     /PRESET COMM. WD
 IOF
 DRDA
 AND (777776
 DAC PJ       /RESTORE COMM WD.
 DAC* FTABP
 CLA       /SHOULD READ: DRRS
 SZA
 JMP ER4
 DRSF
 JMP .-4
 DRCF
 ION
 ISZ 17765
 DZM* 17765      /ZERO NO. OF WDS. WRITTEN
 LAC SVAD
 DAC 17765
 JMP* NTB
/
/     INTERUPT ENTRY PT.
/
DINT LAC 0
 DAC DRET
 DRRS
 SNA
 JMP .+3
ER4 JMS ERR
 1104
 LAC CONT
 SZA
 JMP SPLTC
DFIN DZM DUND
 DZM CONT
 DRCF
 ION
 LAC AC      /RESTORE ACC.
 JMP* DRET
EXT 300000        /EXTEND DRUM PT.
SVAD 0       /CORE ADD.
NW 0      /# OF WDS. TO BE TRNSF.
J    
DHDP 0    /HD PT
DRCOM 0
CONT 0     /SPLIT CONTINUE FLAG
DW 0       /WRITE FLAG
PJ 0       /DR AD. FOR NEW TABLES
DRET 0     /PC ON DRUM INTERUPT
 .TITLE TTY         /TTY HANDLER
TCF=700402
TTY LAC* ARGP
 ISZ ARGP
 TAD (JMP TDPCH
 DAC TDPCH
TDPCH XX
 JMP TINIT
 JMP OUT1
 JMP OUT1
 JMP OUT1
 JMP* ARGP
 JMP TCLS
 JMP* ARGP
 JMP KREAD
 JMP TWRITE
 SKP
 HLT         /ERR. 6
 JMS WT
TUND 0
TINIT LAC* ARGP
 DAC CPRET
 ISZ ARGP
 LAC (42
 DAC* ARGP    /STANDARD BUFF. SIZE
 JMS CRLF
 DZM TUND
 JMP OUT1
TCLS ION
 LAC TUND /TTY UNDERWAY FLG.
 SZA
 JMP* CALPT
 JMS CRLF
 JMP* ARGP
KREAD JMS TCHK     /CHECK IF TTY IS BUSY
 DZM TM
 JMS TSET        /0 = READ
 DZM ILST
 JMP OUT1
TWRITE JMS TCHK
 CLA!CMA
 DAC TM         /-1 = WRITE
 JMS TSET
 LAC TMD       /DATA MODE
 SNA
 JMP STIOP
 LAC* TLBA    /IMAG. ALPH.
 TLS
 ISZ TLBA
 ISZ TWC
 SKP
 JMP FW
 LAC* TLBA
 DAC CHAR
 ISZ TWC
 SKP
 JMP OUT1
FW DZM TUND      /LT. 2 CHARS.
 JMP OUT1
STIOP JMS GTCHAR  /SET UP FOR IOPS WRITE
 TLS
 JMS GTCHAR
 DAC CHAR
 JMP OUT1
/
TCHK 0
 LAC TUND     /CHECK WHETER TTY BUSY
 SZA
 JMP* CALPT   /LOOP ON CAL IF SO
 JMP* TCHK
/
/
TSET 0
 CLA!CMA
 DAC TUND         /SET I/O UND.
 LAC* CALPT       /FIND &
 AND (2000        /CHECK DATA MODE
 SNA
 HLT             /ERR. 7
 LAC* ARGP
 DAC THD     /HEADER ADD.
 ISZ ARGP
 IAC          /POINT BUFF-1 FOR IOPS MODE
 DAC TLBA           /L.B.   ADD.
 DZM COUNT             /LINE COUNT
 LAC* CALPT
 AND (1000
 DAC TMD             /DATA MODE: 0=IOPS,1=IMAG.
 SZA
 ISZ TLBA       /IT IS NOT IOPS
 LAC TM
 SZA
 JMP NRNI     /NOT READ
 LAC* ARGP
 ADD (2
 JMP RS
NRNI LAC* THD
 RTR
 RTR
 RTR
 RTR
 AND (777
 TCA
 SNA
 CMA
 IAC         /REMOVE HEADER COUNT
RS DAC TWC             /WD. COUNT  (PAIR)
 DAC PWC            /PERM. WD. COUNT
 JMS RSP
 JMP* TSET
RSP 0
 777777
 DAC PG1
 777776
 DAC PG2
 JMP* RSP
/
CRLF 0
 LAC (215
 JMS PRNT
 LAC (212
 JMS PRNT
 JMP* CRLF
/
PRNT 0
 IOF
 TLS
 TSF
 JMP .-1
 TCF
 ION
 JMP* PRNT
/
/   KEYBOARD INTERUPT
/
KINT KRB      /READ KEYBOARD BUFF.
 DAC CHAR
 SAD (215     /CAR. RET.
 JMP CRET
 SAD (233     /ALT. MODE OR ESC.
 JMP AM
 SAD (335
 JMP AM
 SAD (336
 JMP AM
 SAD (377      /DELETE
 JMP DEL
 SAD (211       /HORIZ. TAB
 JMP HT
 SAD (203
 JMP CC
 SAD (220
 JMP CP
 SAD (222
 JMP CR
 SAD (223
 JMP CS
 SAD (224
 JMP CT
 SAD (225
 JMP CU
 SAD (221
 JMP CU
 SAD (204
 JMP CD
 LAC TUND
 SNA
 JMP IOUT
ON LAC TMD
 SNA
 JMP KIOPS
 LAC CHAR 
 DAC* TLBA
 ISZ COUNT
 ISZ TLBA
 ISZ TWC
 JMP IOUT
FRMHD LAC COUNT     /FORM HEADER
 TAD (2
 CLL!RAR
 CLL!RTR
 RTR
 RTR
 RTR
 RTR
 ADD (2
 DAC* THD
 LAC TMD
 SZA
 ISZ* THD     /RECORD DATA MODE
FIN DZM TUND
IOUT LAC AC
 ION
 JMP* 0
/
KIOPS LAC CHAR      /READ IOPS MODE
 AND (177           /TRUNCATE TO 7 BITS
 DAC CHAR
 JMS PTCHAR
 JMP IOUT
/
/   TELEPRINTER INTERUPT
/
TINT TCF
 LAC TUND
 SNA
 JMP IOUT
 LAC TM
 SNA
 JMP IOUT
 LAC CHAR
 SNA
 JMP FINI+2
 TLS
 LAC TMD
 SNA
 JMP TIOPS
 ISZ TLBA
 ISZ TWC
 SKP
 JMP FIN
 LAC* TLBA
 DAC CHAR
 JMP IOUT
TIOPS JMS GTCHAR
 DAC CHAR
 JMP IOUT
GTCHAR 0          /GET A CHAR FROM IOPS BUFF.
 ISZ PG1       /MUST INIT. = -1
 SKP
 JMP G1          /5 CHARS FINISHED
 ISZ PG2         /MUST INIT. = 777776
 SKP
 JMP G2          /2 CHARS FINISHED, APPEND NEXT
GT LAC IOP       /TEMP .WD. STORE
 CLL!RTL
 RTL
 RTL
 RAL
 DAC IOP         /ADJUST FOR NEXT CHAR.
 RAL        /GET BIT OUT OF LINK
 AND (177    /7 BIT CHAR.
 JMP* GTCHAR
/
G1 ISZ TLBA
 LAC* TLBA
 DAC IOP
 777773
 DAC PG1
 ISZ TWC
 SKP
 JMP FINI
 ISZ TWC
 JMP GT
FINI TSF        /FINISHED IOPS BUFFER
 JMP .-1
 LAC (212     /PRINT LF.
 JMS PRNT
 JMP FIN
/
G2 LAC* TLBA
 AND (17
 CLL!RTL
 RAL
 DAC CHAR   /TEMP. FOR 4 BITS
 ISZ TLBA
 777774
 DAC PG2
 LAC* TLBA
 RTL
 RAL
 DAC IOP     /POSITION FOR NEXT CHAR.
 RAL         /ADJUST SPLIT CHAR.
 AND (7
 XOR CHAR
 JMP* GTCHAR
/
/
PTCHAR 0     /PUT A CHAR IN IOPS BUFF.
             /TLBA MUST INIT. POINT -1+BUFF
 LAC PG1
 DAC PG3
 ISZ PG1     /MUST INIT. = -1
 SKP
 JMP P1
 LAC PG2
 DAC PG4
 ISZ PG2     /MUST INIT. = 777776
 SKP
 JMP P2
PT LAC* TLBA
 CLL!RTL
 RTL
 RTL
 RAL
 XOR CHAR
 DAC* TLBA
 JMP* PTCHAR
P1 LAC* TLBA   /ADJUST LAST LINE
 RAL
 DAC* TLBA
 LAC ILST       /CHECK IF LAST ENTRY IN BUFF.
 SZA            /IF SO JUMP OUT
 JMP LST        /TO ENTER N 000 CHARS.
 777773
 DAC PG1
 ISZ COUNT
 ISZ COUNT
 ISZ TLBA      /BUFF-1
 DZM* TLBA
 JMP PT
/
P2 LAC CHAR
 AND (170
 RTR
 RAR
 DAC IOP     /TEMP. UPPER 4 BITS
 LAC* TLBA
 RTL
 RTL
 XOR IOP
 DAC* TLBA
 ISZ TLBA
 LAC CHAR
 AND (7     /LOWER 3 BITS
 DAC* TLBA
 777774
 DAC PG2
 JMP* PTCHAR
/
CRET LAC TMD
 SNA
 JMP IRET
 LAC CHAR
 JMP ON
IRET DZM TUND      /RET. ON IOPS MODE
 LAC CHAR
 AND (177
 DAC CHAR
 JMS PTCHAR
 LAC (212      /PRINT A LINE FEED
 JMS PRNT
 CLA!CMA
 DAC ILST
 CLA
 DAC CHAR
 JMS PTCHAR
 JMP .-1
LST DZM ILST    /BUFF. FILLED
 JMP FRMHD
/
AM LAC (275
 DAC CHAR
 JMP CRET
DEL LAC TMD
 SZA
 JMP RPT
 LAC PG3   /RESET IOPS BUFF.
 DAC PG1
 LAC PG4
 DAC PG2
 777773
 SAD PG1
 JMP DICP     /DE-INC. BUFF PT.
 IAC
 SAD PG2
 JMP DICP
 JMP RCONT
DICP 777776
 ADD* TLBA
 DAC TLBA
 JMP RCONT
RPT 777776
 ADD TLBA     /RESET BUFF. PT.
 DAC TLBA
RCONT 777776
 ADD COUNT           /RESET COUNT -1
 DAC COUNT
 777776
 ADD TWC    /MOVE BACK BUFF. PT.
 DAC TWC
 LAC (334    /PRINT BACK SLASH
 JMS PRNT
 JMP IOUT
/
HT LAC TMD   /HORIZ. TAB
 SNA
 HLT
 LAC CHAR
 JMP ON
CC JMS CPRNT
 .EXIT
CP JMS CPRNT
 JMP* CPRET
CR JMS CPRNT
 JMP* CALPT
CS JMS CPRNT
 JMP* 106
CT JMS CPRNT
 HLT
CD JMS CPRNT
 JMP 3774
CU LAC (300
 JMS PRNT
 LAC TM
 SNA
 JMP REST
 DZM TUND
 JMS CRLF
 JMP IOUT
REST LAC PWC      /RESTORE INPUT
 DAC TWC
 DZM COUNT
 LAC THD
 IAC
 DAC TLBA
 LAC TMD
 SZA
 ISZ TLBA          /IMAG.  MODE
 JMS CRLF
 JMS RSP
 JMP IOUT
CPRNT 0       /CONTROL CHAR. PRINT (^X)
 LAC (336     / ^
 JMS PRNT
 LAC CHAR
 XOR (100    /CONVERT TO CORESPONDING CHAR.
 JMS PRNT
 JMP* CPRNT
CPRET 0            /ADD. OF ^P RETURN
TM 0        /I/O MODE: 0=INPUT; -1=OUTPUT
TMD         /DATA MODE: 0=IOPS; 1000=IMAGE.
THD         /HD. ADD.
TLBA       /BUFF. PT.
COUNT        /LINE COUNT
PWC          /PERM. WD COUNT
TWC          /WD COUNT
CHAR         /TEMP. 8 BIT CHAR. STORAGE
PG1 0
PG2 0
IOP 0
ILST 0       /FLAG FOR LAST ENTRY INTO IOPS BUFF.
PG3 0
PG4 0
/
 .TITLE MTA     /MAG. TAPE HANDLER V1A.
MTA LAC* ARGP     /SIMPLIFIED MAG. TAPE HANDLER
 ISZ ARGP
 TAD (JMP MDPCH
 DAC MDPCH
MDPCH XX
 JMP MTINIT
 JMP OUT1
 JMP OUT1
 JMP OUT1
 JMP* ARGP
 JMP MCLOS
 JMP MTAPE
 JMP MREAD
 JMP MWRITE
 SKP
 JMP MTRAN
 JMS WT
MUND 0
/
MTINIT ISZ ARGP
 LAC (50
 DAC* ARGP    /BUFFER SIZE
 MTCL
 MTRS
 AND (006000
 SZA
 JMP .+3
 JMS ERR
 1304         /DEV #3 (MT) NOT READY
 DZM MUND
 JMP OUT1
/
MCLOS LAC MUND
 SZA
 JMP .+2
 JMS WEOF
 JMS REWND
 JMP* ARGP
/
MTAPE LAC MUND
 SZA
 JMP .-2
 LAC* CALPT
 AND (017000
 SWHA
 TAD (JMP MTPCH
 DAC MTPCH
MTPCH XX
 JMP REW
 JMP ER6
 JMP BCKSPC
 JMP ER6
 JMP MWEOF
 JMP FRDSPC
 JMP ER6
 JMP ER6
 JMP OUT1
 JMP OUT1
 JMP OUT1
 JMP OUT1
 JMP OUT1
 JMP OUT1
 JMP ER6
 JMP ER6
/
REW JMS REWND
 JMP OUT1
REWND 0
 LAC (004000
 MTLC
 MTRS
 AND (020000
 SZA
 JMP .-3
 JMP* REWND
/
BCKSPC JMP OUT1   /NOT YET AVAILABLE
FRDSPC JMP OUT1   / "   "    "    "
MWEOF JMS WEOF
 JMP OUT1
WEOF 0
 LAC (020000
 MTLC
 MTGO
 MTSF
 JMP .-1
 JMP* WEOF
/
MREAD LAC MUND
 SZA
 JMP .-2
 LAC* ARGPT
 DAC MBFHD   /BUFF. HD. PT.
 AAC-1
 DAC 17763
 -50     /BUFF. SIZE
 DAC 17762
 LAC (000400
 MTLC
 MTGO
 CLA!CMA
 DAC MUND
 ISZ ARGP
 JMP OUT1
/
ER6 JMS ERR
 1306
/
MWRITE LAC MUND
 SZA
 JMP .-2
 LAC* ARGP
 DAC MBFHD
 AAC-1
 DAC 17763
 -50
 DAC 17762
 LAC (040400
 MTLC
 MTGO
 CLA!CMA
 DAC MUND
 ISZ ARGP
 JMP OUT1
/
MTRAN ISZ ARGP
 LAC* ARGP
 DAC 17763
 ISZ ARGP
 LAC* ARGP
 DAC 17762
 IAC
 DAC MBFHD
 LAC* CALPT
 AND (10000
 XOR (000400
 MTLC
 MTGO
 CLA!CMA
 DAC MUND
 ISZ ARGP
 JMP OUT1
MDFHD 0    /BUFF. HD PT.
/
/ MAG TAPE INTERUPT HANDLER
/
MINT LAC 0
 DAC MRET    /SAVE INT. ADD.
 MTRS
 AND (200000
 SZA
 JMP MEOF   /END OF FILE
 MTRS
 AND (040000
 SZA
 JMP MEOT      /END-OF-TAPE
 MTRS
 AND (400000
 SZA
 JMP MERR      /PARITY ERR
MOUT DZM MUND
 LAC AC
 MTCL     /CLEAR FLAG
 ION
 JMP* MRET
MRET 0
MEOF LAC (2005
 DAC* MBFHD
 ISZ MBFHD
 TCA
 DAC* MBFHD
 ISZ MBFHD
 DZM* MBFHD
 JMP MOUT
MEOT LAC (2006
 JMP MEOF+1
MERR JMS ERR
 1314
/
 .END
