CMDMP
* /--- FILE TYPE = E
* /--- BLOCK INTRO 00 000 82/09/30 10.20
IDENT CMDMP,FETS
ABS
SST
ENTRY CMDMP
ENTRY DMP=
ENTRY MFL=
*COMMENT CMDMP - CONTROL POINT CM DUMP (PLATO).
COMMENT COPYRIGHT CONTROL DATA CORP. 1982.
SYSCOM B1
TITLE CMDMP - CONTROL POINT CM DUMP (PLATO).
SPACE 4
*** CMDMP - CONTROL POINT CM DUMP (PLATO).
*
* E. TRUSS. PDEV. 09/28/82.
SPACE 4
*** CMDMP PROVIDES A FULL DUMP OF A JOBS
* CENTRAL MEMORY TO A SPECIFIED FILE. IF NO
* FILE IS SPECIFIED, *CMFILE* IS USED.
*
* THE FIRST RECORD OF THE SPECIFIED FILE IS A
* HEADER RECORD CONTAINING THE NAME OF THE JOB
* WHICH CALLED THE DUMP PROGRAM AND THE DATE
* AND TIME OF THE DUMP. THE REMAINDER OF THE
* FILE IS A SERIES OF 1000B-WORD RECORDS WHICH
* CONTAIN THE CM DUMP AND IS TERMINATED BY AN
* END-OF-FILE.
TITLE LOCAL SYMBOLS / FETS / GLOBAL STORAGE.
* LOCAL SYMBOLS.
FBUFL EQU 1001B USER FILE BUFFER SIZE
DBUFL EQU 401B SYSTEM DUMP FILE BUFFER SIZE
SPACE 4
* COMMON DECKS.
*CALL,COMCMAC
SPACE 4
* FETS.
ORG 120B
FETS BSS 0
CMFILE FILEB FBUF,FBUFL,(FET=8)
D RFILEB DBUF,DBUFL
DD EQU *
ORG D
VFD 42/3LDM*,18/3
ORG DD
SPACE 4
* GLOBAL STORAGE.
DL BSS 1 BLOCKS TO READ FROM DUMP FILE
DA BSS 1 DUMP ADDRESS (0 = FILE-ONLY)
CL BSS 1 BLOCKS TO READ FROM MEMORY
* /--- BLOCK PRESET 00 000 82/09/29 15.06
TITLE PRESET.
* PRESET USER FILE NAME.
CMDMP SB1 1
SA1 ARGR
MX6 42
BX6 X6*X1
ZR X6,CMD1
SX1 B1
BX6 X6+X1
SA6 CMFILE
* OPEN AND POSITION OUTPUT FILE.
CMD1 OPEN CMFILE,WRITE,R
RECALL CMFILE
REWIND CMFILE
RECALL CMFILE
* WRITE HEADER RECORD
GETJN FBUF SET JOB NAME IN HEADER
DATE FBUF+1 SET DATE IN HEADER
CLOCK FBUF+2 SET TIME IN HEADER
SX6 FBUF+3 SET IN POINTER
SA6 CMFILE+2
SX6 FBUF SET OUT POINTER
SA6 A6+B1
WRITER CMFILE,R WRITE HEADER
RECALL CMFILE
* SET UP DUMP FILE.
OPEN D,READ,R
RECALL D
SA1 D+6 SET FILE RANDOM INDEX
MX6 42
BX6 X6*X1
SX1 1 SKIP SYSTEM SECTOR
BX6 X6+X1
SA6 A1
READ D,R START INPUT
RECALL D
.OSL IFGE "MODLEVEL",552D
SA1 DBUF+FLSW GET JOBS FIELD LENGTH
.OSL ELSE
SA1 DBUF+STSW GET JOBS FIELD LENGTH
.OSL ENDIF
MX6 -12
BX6 -X6*X1
LX6 6
SA0 X6
SX6 DBUF+200B SKIP CP AREA IN DUMP
SA6 D+3
* SET BLOCKS TO READ FROM DUMP FILE (DUMPS MEMORY
* OVERWRITTEN BY THIS PROGRAM).
SX1 A0 GET FL
SX1 X1+FBUFL-1
AX1 9 (IN BLOCKS)
SX6 CMDL LENGTH OF PROGRAM
SX6 X6+FBUFL-2
AX6 9
IX2 X1-X6
SX3 X2-1
PL X3,CMD2 IF FL .GE. PROGRAM LENGTH
SX6 X1-1
SA6 DL SET DUMP FILE LENGTH
MX6 0
SA6 CL SET MEMORY DUMP LENGTH
SA6 DA FLAG ALL MEMORY IN FILE
EQ MAIN
CMD2 SA6 DL SET DUMP FILE LENGTH
LX6 9 SET MEMORY DUMP ADDRESS
SA6 DA
SX6 X2-1
SA6 CL SET MEMORY DUMP LENGTH
* /--- BLOCK MAIN 00 000 82/09/29 15.07
TITLE MAIN LOOP.
* READ BLOCKS FROM DUMP FILE AND WRITE TO USER FILE
* UNTIL THE MEMORY OVERWRITTEN BY THIS PROGRAM
* IS DUMPED.
MAIN SA1 DL DECREMENT BLOCK COUNT
SX6 X1-1
SA6 A1
NG X6,MAIN1 IF DONE WITH FILE BLOCKS
SA1 CMFILE+1 RESET BUFFER POINTERS
SX6 X1+FBUFL-1
SA6 A1+B1 SET IN
SX6 X1
SA6 A6+B1 SET OUT
READW D,FBUF,FBUFL-1
WRITER CMFILE,R WRITE TO USER FILE
RECALL CMFILE
EQ MAIN
* SET BUFFER POINTERS FOR USER FILE FET INTO JOBS
* MEMORY SO WE DON'7T NEED TO MOVE THE DATA INTO
* THE NORMAL CIO BUFFER. WRITE REMAINDER OF JOBS
* CM TO THE USER FILE.
MAIN1 SA1 CL DECREMENT BLOCK COUNT
SX6 X1-1
SA6 A1
NG X6,MAIN2 IF NO CM BLOCKS
ZR X6,MAIN1A IF ON LAST FULL BLOCK
SA1 CMFILE+1 RESET BUFFER POINTERS
MX6 42
BX6 X6*X1
SA2 DA
BX6 X6+X2
SA6 A1 SET FIRST
SX7 X2+FBUFL-1
SA7 A6+B1 SET IN
SA6 A7+B1 SET OUT
SX6 X6+FBUFL
SA6 A6+B1 SET LIMIT
SX6 FBUFL-1 INCREMENT DUMP ADDRESS
IX6 X2+X6
SA6 A2
WRITER CMFILE,R WRITE TO USER FILE
RECALL CMFILE
EQ MAIN1
* MOVE THE LAST FULL BLOCK INTO THE USER FILE BUFFER
* TO AVOID SETTING THE CIO POINTERS OUT OF RANGE ON
* JOBS WHOSE FL IS AN EVEN MULTIPLE OF 10000B (IN
* THIS CASE, ON THE LAST FULL BLOCK, *LIMIT* WILL
* BE SET TO *FL+1*).
MAIN1A SB2 FBUFL-2
SA1 DA BEGINNING OF LAST FULL BLOCK
SB3 X1
NZ X1,MAIN1B IF BLOCK IN CM
READW D,FBUF,FBUFL-1 READ WORDS FROM FILE
EQ MAIN1C
MAIN1B SA1 B3+B2
BX6 X1
SA6 FBUF+B2
SB2 B2-B1
PL B2,MAIN1B
MAIN1C SA1 CMFILE+1 RESET BUFFER POINTERS
MX6 42
BX6 X6*X1
SX1 FBUF
BX6 X6+X1
SA6 A1 SET FIRST
SX6 X1+FBUFL-1
SA6 A1+B1 SET IN
SX6 X1
SA6 A6+B1 SET OUT
SX6 X1+FBUFL
SA6 A6+B1 SET LIMIT
SA1 DA INCREMENT DUMP ADDRESS
SX6 FBUFL-1
IX6 X1+X6
SA6 A1
WRITER CMFILE,R
RECALL CMFILE
* /--- BLOCK MAIN 00 000 82/09/30 10.20
* ZERO THE USER FILE BUFFER, MOVE THE LAST (PARTIAL)
* BLOCK INTO IT AND WRITE TO THE USER FILE.
MAIN2 MX6 0
SB2 FBUFL-1
MAIN3 SA6 FBUF+B2
SB2 B2-B1
PL B2,MAIN3
SX1 A0 GET LENGTH TO MOVE
MX2 -9
BX1 -X2*X1
ZR X1,MAIN5 IF NO PARTIAL BLOCK
SB2 X1-1
SA1 DA BEGINNING OF PARTIAL BLOCK
SB3 X1
NZ X1,MAIN4 IF PARTIAL BLOCK IN CM
READW D,FBUF,B2+B1 READ WORDS FROM FILE
EQ MAIN4A
MAIN4 SA1 B3+B2
BX6 X1
SA6 FBUF+B2
SB2 B2-B1
PL B2,MAIN4
MAIN4A SA1 CMFILE+1 RESET BUFFER POINTERS
MX6 42
BX6 X6*X1
SX1 FBUF
BX6 X6+X1
SA6 A1 SET FIRST
SX6 X1+FBUFL-1
SA6 A1+B1 SET IN
SX6 X1
SA6 A6+B1 SET OUT
SX6 X1+FBUFL
SA6 A6+B1 SET LIMIT
WRITER CMFILE,R
RECALL CMFILE
MAIN5 WRITEF CMFILE
RECALL CMFILE
ENDRUN
SPACE 4
* COMMON DECKS.
*CALL COMCSYS
*CALL COMCCIO
*CALL COMCCPM
*CALL COMCRDW
* /--- BLOCK BUFFERS 00 000 82/09/28 13.50
BUFFS TITLE BUFFERS.
* BUFFERS.
BUFFERS BSS 0
USE //
SEG
DBUF BSS DBUFL DM* FILE BUFFER
FBUF BSS FBUFL USER FILE BUFFER
BSS 10B ALLOW FOR *COMCRDW* READ AHEAD
IDENT
*
* ALL FOLLOWING COMPUTATIONS MUST BE ROUNDED
* TO NEAREST 1000B SO CORRECT NUMBER OF BLOCKS
* OF CM WILL BE WRITTEN TO DUMP FILE.
*
.1 SET *+777B
DMP= EQU .1/1000B*10B+10000B
CMDL EQU .1/1000B*1000B END OF MEMORY IN FILE
MFL= EQU CMDL
END