
/MAP HANDLING
MAPAD  MAP
/
/MAP RESTORE
/EXTERNAL: MAPAD
MAPOUT 0
       LAW 17401   /AC = 777401
       JMS DRUM
       -120        / -WC
       MAP-1       / CA-1
       JMP* MAPOUT
DRSF=707001
DRDA=707004
DRCL=707201
DRRS=707212
/
/DRUM INPUT ONE 256 WORD BLOCK
/ENTER WITH    AC = BLOCK#
/          JMS+1  = FILE ADDRESS
DRIN   0
       AND (1777
       CLL!RTL      /SHIFT LEFT 8 BITS
       RTL
       RTL
       RTL
       DAC DRIN0    /SAVE DRUM COMMAND
       LAC* DRIN    /GET FILE ADDRESS
       TAD (-1
       DAC DRIN1    /SET CA-1
       ISZ DRIN     /POINT TO RETURN LOC
       LAC DRIN0    /GET DRUM COMMAND
       JMS DRUM
       -400         /WORD COUNT
DRIN1  0            /CA -1
       JMP* DRIN    /RETURN
DRIN0  0
/
/DRUM OUTPUT ONE 256 WORD BLOCK
DROUT  0
       AND (1777
       CLL!RTL
       RTL
       RTL
       RTL
       IAC       /SET FOR WRITE
       DAC DROUT0   /SAVE COMMAND
       LAC* DROUT   /GET FILE ADDRESS
       TAD (-1
       DAC DROUT1
       ISZ DROUT   /POINT TO RETURN LOC
       LAC DROUT0    /GET COMMAND
       JMS DRUM
       -400
DROUT1  0
       JMP* DROUT
DROUT0 0
/
/DRUM HANDLER
/CALLING SEQUENCE:       AC = DRUM COMMAND
/                        JMS DRUM
/                        -WC
/                        CA-1
/XTERNAL: COMOUT
DRUM  0
       DAC DRCOM     /SAVE DRUM COMMAND
       DZM DRCNT     /CLEAR ATTEMPT COUNT
       LAC* DRUM     /GET -WC
       DAC DRWC
       ISZ DRUM
       LAC* DRUM     /GET CA-1
       DAC DRCA
       ISZ DRUM      /POINT TO RETURN LOC
DRUM2  LAC DRWC
       DAC 17764     /SET -WC
       LAC DRCA    
       DAC 17765     /SET CA-1
       IOF
       LAC DRCOM
       DRDA
       DRSF
       JMP .-1
       DRRS         /READ DRUM STATUS
       DRCL
       ION
       SNA
       JMP* DRUM   /NORMAL RETURN
       ISZ DRCNT   /INCREMENT ATTEMPT COUNT
       LAC DRCNT    /TRY 8 TIMES
       AND (7
       SZA
       JMP DRUM2
       JMS COMOUT
       LAW 20       /DRUM ERROR
       JMP 4        /MONITOR ERROR DIAG.
DRCOM  0
DRWC   0
DRCA   0
DRCNT  0
/COMEIN FROM SYSTEM PROGRAM
/SAVES LOC16, LOC17
/TEST FOR PAGE-BANK MODES
COMIN  0
       DZM PGMDE
       SBA          /TEST IF BANK MODE
       SKP
       JMP .+3      /YES, DO NOTHING
       ISZ PGMDE    /SET PAGE MODE FLAG
       EBA          /ENABLE BANK MODE
       LAC 16
       DAC COM16
       LAC 17
       DAC COM17
       JMP* COMIN
COM16  0
COM17  0
PGMDE  0
/
/COME OUT FROM FILE HANDLER.
COMOUT 0
       LAC COM16
       DAC 16
       LAC COM17
       DAC 17
       LAC PGMDE    /TEST WHICH MODE REQUIRED
       SZA
       DBA          /REPLACE INTO PAGE MODE
       JMP* COMOUT
SBA=707761
