Google
 

Trailing-Edge - PDP-10 Archives - BB-4172G-BM - 4-sources/makdmp.mac
There are 20 other files named makdmp.mac in the archive. Click here to see a list.
;<4.UTILITIES>MAKDMP.MAC.3,  3-Jan-80 15:26:00, EDIT BY R.ACE
;UPDATE COPYRIGHT DATE
;<4.UTILITIES>MAKDMP.MAC.2, 10-Mar-79 14:10:02, Edit by KONEN
;UPDATE COPYRIGHT FOR RELEASE 4

;THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY ONLY BE USED
;  OR COPIED IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE.
;
;COPYRIGHT (C) 1976,1977,1978,1979,1980 BY DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.

;THIS IS A PROGRAM TO MANUFACTURE A STANDARD DUMP.EXE FILE
;FOR TOPS-20.
	SEARCH MONSYM,MACSYM
	.REQUIRE SYS:MACREL
A==1
B==2
C==3


EXEDIR:	1776,,1
	1777,,1
COUNT:	BLOCK 1			;PAGE COUNT OF FILE
CNTBUF:	BLOCK 2			;RDTTY WORK BUFFER

	RELOC 1000-140		;START ON PAGE

START:	RESET
	DMOVE A,EXEDIR		;GET DEFAULT EXE DIR
	DMOVEM A,10000		;INTO THE PAGE
	MOVX A,GJ%FOU!GJ%SHT
	HRROI B,[ASCIZ /<SYSTEM>DUMP.EXE/]
	GTJFN
	 JSHLT			;COULDN'T GET IT
	MOVS 16,1
	MOVE B,[440000+OF%WR]
	OPENF
	 JSHLT			;ERROR OF SOME SORT
PROMPT:	HRROI A,[ASCIZ /
MAX SIZE OF MEMORY IN K (512): /]
	PSOUT
	HRROI A,CNTBUF		;BUFFER TO HOLD INPUT
	MOVEI B,^D9		;LIMITED BUFFER SPACE
	HRROI C,[ASCIZ /MAX SIZE OF MEMORY IN K (512): /]
	RDTTY			;GET ANSWER FROM USER
	 JRST [	JSERR		;BAD ANSWER
		JRST PROMPT]	;TRY AGAIN
	TXNN B,RD%BTM		;GOT A TERMINATOR?
	JRST [	HRROI A,[ASCIZ /
?NOT CONFIRMED.
/]
		PSOUT
		JRST PROMPT]	;GET MORE
	LDB A,[POINT 7,CNTBUF,6] ;LOOK AT FIRST BYTE
	CAIN A,.CHCRT		;IS IT A CR?
	JRST [	MOVEI B,^D512	;YES. ASSUME LARGE MACHINE
		JRST MAPIT0]	;AND GO ON
	HRROI A,CNTBUF		;GET BUFFER
	MOVEI C,12		;GET NUMBER IN DECIMAL
	NIN			;GET IT
	 JRST [	JSERR		;BAD
		JRST PROMPT]	;TRY AGAIN
MAPIT0:	LSH B,1			;MAKE IT A PAGE COUNT
	ADDI B,1		;ALLOW ONE PAGE FOR DIRECTORY
	MOVEM B,COUNT		;SAVE NUMBER
MAPIT:	MOVE A,[.FHSLF,,10]
	MOVE B,16
	MOVX C,PM%RWX
	SETZM 10777		;CREATE THE PAGE
	PMAP
	ADDI 16,1
	MOVEI A,0(16)		;GET CURRENT PAGE NUMBER
	CAMGE A,COUNT		;GOT IT ALL YET?
	JRST MAPIT		;NO. GO ON
	HLRZ A,16
	TXO A,1B0
	CLOSF
	 JFCL
	HRLI A,.FBSIZ
	SETO B,
	MOVE C,COUNT		;GET PAGE COUNT
	IMULI C,^D512		;COMPUTE WORDS IN THE FILE
	CHFDB
	HRLI A,.FBBYV
	MOVX B,FB%BSZ
	MOVX C,<FLD(44,FB%BSZ)>
	CHFDB
	HRLI A,.FBCTL		;CHANGE FLAG WORD
	MOVX B,FB%NOD
	MOVX C,FB%NOD		;SET TO "NO DUMP"
	CHFDB
	MOVEI A,0(A)
	RLJFN
	 JFCL
	HALTF
	END START