Google
 

Trailing-Edge - PDP-10 Archives - BB-H348C-RM_1982 - swskit-v21/listings/rsx11s/crash.list
There are no other files named crash.list in the archive.
CRASH	MACRO M1110  22-AUG-79 07:05  PAGE 3


      1						.TITLE	CRASH
      2						.IDENT	/04/
      3					;
      4					;
      5					; COPYRIGHT (C) 1977
      6					; DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
      7					;
      8					;
      9					; THIS  SOFTWARE  IS  FURNISHED  UNDER A LICENSE FOR USE ONLY ON A
     10					; SINGLE COMPUTER SYSTEM AND MAY BE COPIED ONLY WITH THE INCLUSION
     11					; OF  THE  ABOVE COPYRIGHT  NOTICE.  THIS SOFTWARE, OR  ANY  OTHER
     12					; COPIES THEREOF, MAY NOT BE PROVIDED OR OTHERWISE  MADE AVAILABLE
     13					; TO  ANY  OTHER PERSON  EXCEPT  FOR USE ON SUCH SYSTEM AND TO ONE
     14					; WHO AGREES TO THESE LICENSE TERMS.  TITLE  TO  AND  OWNERSHIP OF
     15					; THE SOFTWARE SHALL AT ALL TIMES REMAIN IN DIGITAL.
     16					;
     17					; THE  INFORMATION  IN THIS DOCUMENT IS SUBJECT  TO CHANGE WITHOUT
     18					; NOTICE AND SHOULD NOT BE CONSTRUED AS A  COMMITMENT  BY  DIGITAL
     19					; EQUIPMENT CORPORATION.
     20					;
     21					; DIGITAL ASSUMES NO  RESPONSIBILITY FOR THE USE OR RELIABILITY OF
     22					; ITS SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL.
     23					;
     24					;
     25					; VERSION 04
     26					;
     27					; J. MASSE / P. J. BEZEREDI  24-OCT-77
     28					;
     29					;
     30					; CRASH DUMP ROUTINES
     31					;
     32
     33
     34						.IF DF	C$$RSH
     35
     36					;
     37					; MACRO LIBRARY CALLS
     38					;
     39						.MCALL	HWDDF$
     40						HWDDF$
     41
     42					;
     43					; LOCAL DATA
     44					;
     45
     46					;
     47					;
     48					$CRUPC::.WORD	0		; USER PC IS STORED HERE
     49					$CRUST::.WORD	0		; USER PS IS STORED HERE
     50
     51						.IF DF	C$$CDA
     52
     53					CRSMSG:	.ASCII	<15><12><12>/CRASH -- CONT WITH SCRATCH MEDIA ON /
     54
     55					.IIF EQ C$$CDA-1,	.ASCII	/DT/
     56					.IIF EQ C$$CDA-2,	.ASCII	/DK/
     57					.IIF EQ C$$CDA-3,	.ASCII	/MT/
CRASH	MACRO M1110  22-AUG-79 07:05  PAGE 3-1


     58					.IIF EQ C$$CDA-4,	.ASCII	/MM/
     59
     60					UNIT:	.ASCIZ	/0/<15><12><12>
     61						.EVEN
     62
     63						.ENDC
     64
     65
     66						.IF DF	C$$TTY
     67
     68					MSG1:	.ASCIZ	<15><12><12>/SYSTEM CRASH AT LOCATION /
     69					MSG2:	.ASCII	<15><12><12>/REGISTERS/<15><12><12>
     70						.ASCIZ	/ R0=/
     71					MSG3:	.ASCIZ	/R1=/
     72					MSG4:	.ASCIZ	/R2=/
     73					MSG5:	.ASCIZ	/R3=/
     74					MSG6:	.ASCIZ	<15><12><12>/ R4=/
     75					MSG7:	.ASCIZ	/R5=/
     76					MSG8:	.ASCIZ	/SP=/
     77					MSG9:	.ASCIZ	/PS=/<0>
     78					MSG10:	.ASCII	<15><12><12>/SYSTEM STACK DUMP/
     79						.ASCIZ	<15><12><12>/ LOCATION CONTENTS/<15><12><12>
     80						.EVEN
     81
     82						.ENDC
     83
     84
     85									; *** THE FOLLOWING MUST BE ADJACENT
     86					$CRPBF::.BLKW	4		;STACK AREA FOR SUBROUTINE CALLS
     87					$CRSBF::.BLKW	14.		;INTERNAL CRASH STACK ...
     88					$CRPST::			;TOP OF PANIC STACK
     89
     90
     91						.IF DF	M$$MGE
     92
     93						.BLKW	159.		;... MAPPED STACK IS THIS LARGE
     94
     95						.ENDC
     96
     97
     98					$CRSST==.-2			;TOP OF CRASH STACK
     99									; *** ABOVE MUST BE ADJACENT
    100
    101
    102						.IF DF	C$$CDA
    103
    104					$CRSBN::.WORD	PBNH,PBNL	;STARTING DEVICE ADDRESS
    105					$CRSCS::.WORD	PBNH+PBNL	;CHECKSUM OF DEVICE ADDRESS
    106
    107					;
    108					; LOCAL MACROS
    109					;
    110						.MACRO	PUSH	ARG
    111						SUB	#2,SP
    112						MOV	ARG,(SP)
    113						.ENDM	PUSH
    114
CRASH	MACRO M1110  22-AUG-79 07:05  PAGE 3-2


    115						.ENDC
    116
    117
    118						.ENDC
    119
    120
    121					;+
    122					; **-$CRASH-SYSTEM CRASH DUMP ROUTINE
    123					;
    124					; THIS ROUTINE IS ENTERED VIA A JUMP WHENEVER A FATAL SYSTEM ERROR
    125					; (IOT) IS DETECTED.
    126					;
    127					; THIS ROUTINE PERFORMS A MEMORY DUMP THAT CAN BE DIRECTED TO A
    128					; HARD COPY DEVICE, DECTAPE, RK05, TU10 OR TU16.  THE DUMP GENERATED
    129					; WILL HAVE A SPECIAL BLOCK AS THE FIRST BLOCK OF THE DUMP, WHICH WILL
    130					; CONTAIN INFORMATION CONCERNING THE STATE OF THE SYSTEM AT THE TIME
    131					; THE CRASH OCCURRED.  ONCE THE DUMP IS FINSIHED THE SYSTEM MAY BE
    132					; RE-BOOTED OR ANOTHER DUMP MAY BE TAKEN.  IF THE DUMP IS DIRECTED
    133					; TO A HARD COPY DEVICE THE DUMP WILL CONTAIN ONLY THE REGISTER
    134					; CONTENTS AND THE SYSTEM STACK.
    135					;
    136					; INPUTS:
    137					;
    138					;	02(SP)=PS WORD AT CRASH.
    139					;	00(SP)=PC WORD AT CRASH.
    140					;
    141					; OUTPUTS:
    142					;
    143					;	THE INTERNAL CRASH STACK AND A CORE IMAGE OF THE SYSTEM,
    144					;	UP TO 128K, ARE DUMPED ONTO THE MASS STORAGE CRASH DUMP DEVICE.
    145					;	THE REGISTER CONTENTS AND THE SYSTEM STACK ARE DUMPED IF A
    146					;	HARD COPY DUMP IS REGUESTED.
    147					;-
    148
    149	000000				$CRASH::			;CRASH DUMP ROUTINE
    150
    151
    152						.IF DF	C$$RSH
    153					;
    154						MOV	(SP)+,$CRUPC	; SAVE USER PC FROM THE STACK
    155						MOV	(SP)+,$CRUST	; SAVE USER PS FROM THE STACK
    156					$CRALT::
    157					;
    158
    159
    160						.IF DF	C$$TTY
    161
    162						MOV	(SP)+,$CRPBF	;SAVE LOCATION OF CRASH
    163						MOV	R0,$CRPBF+2	;SAVE R0
    164						MOV	#$CRPBF+4,R0	;SET UP SAVE AREA
    165						MOV	R1,(R0)+	;SAVE R1 THRU R5
    166						MOV	R2,(R0)+	;
    167						MOV	R3,(R0)+	;
    168						MOV	R4,(R0)+	;
    169						MOV	R5,(R0)+	;
    170						MOV	(SP)+,2(R0)	;SAVE PS
    171						MOV	SP,(R0)		;SAVE SP
CRASH	MACRO M1110  22-AUG-79 07:05  PAGE 3-3


    172						MOV	#$CRPST,SP	;SETUP TEMPORARY STACK
    173						MOV	#C$$TTY,R5	;SPECIFY OUTPUT DEVICE CSR
    174						MOV	#$CRPBF,R1	;POINT TO DATA VECTOR
    175						MOV	#MSG1,R4	;POINT TO MESSAGE TEXT
    176					1$:	MOVB	(R4)+,R2	;GET A BYTE OF MESSAGE
    177						BEQ	5$		;IF EQ AT MESSAGE BREAK
    178						BR	3$		;ELSE ALREADY HAVE A BYTE
    179					2$:	MOVB	(R4)+,R2	;GET A BYTE OF MESSAGE
    180						BEQ	4$		;IF EQ END OF THIS MESSAGE
    181					3$:	CALL	$OUT		;OUTPUT THIS CHARACTER
    182						BR	2$		;GO AGAIN
    183					4$:	MOV	(R1)+,R3	;GET DATA WORD
    184						CALL	$EDIT		;PRINT IN PLACE
    185						BR	1$		;GET NEXT MESSAGE
    186					5$:	MOVB	(R4)+,R2	;GET NEXT CHARACTER TO OUTPUT
    187						BEQ	6$		;IF EQ END OF STRING
    188						CALL	$OUT		;OUTPUT CHARACTER
    189						BR	5$		;GO AGAIN
    190					6$:	MOV	$CRPBF+16,R1	;POINT TO BOTTOM OF SYSTEM STACK
    191					7$:	MOV	R1,R3		;SET ADDRESS OF LOCATION TO EDIT
    192						CALL	8$		;EDIT ADDRESS
    193						MOV	(R1)+,R3	;GET CONTENTS OF LOCATION
    194						CALL	8$		;EDIT CONTENTS
    195						CALL	$CRLF		;ISSUE CARRIAGE RETURN, LINE FEED
    196						CMP	R1,#$STACK	;END OF SYSTEM STACK?
    197						BLO	7$		;IF LO NO
    198						MOV	#$CRPBF+16,R0	;POINT TO SAVED STACK POINTER
    199						MOV	(R0),SP		;RESTORE SP
    200						MOV	-(R0),R5	;RESTORE R5 THRU R0
    201						MOV	-(R0),R4	;
    202						MOV	-(R0),R3	;
    203						MOV	-(R0),R2	;
    204						MOV	-(R0),R1	;
    205						MOV	-(R0),R0	;
    206						BR	9$		;BR AROUND SUBROUTINE
    207					8$:	CALL	$OUTB		;OUTPUT TWO BLANKS
    208						CALL	$OUTB		;
    209						CALLR	$EDIT		;PRINT CONTENTS OF R3 AND RETURN
    210					9$:				;REF LABEL
    211
    212						.ENDC
    213
    214
    215						.IF DF	C$$CDA
    216
    217						MOV	#6,@#4		;SETUP TO IGNORE NON-EXISTANT MEMORY
    218						MOV	#2,@#6		;PUT RTI INSTRUCTION IN LOCATION 6
    219
    220
    221						.IF DF	L$$SI1
    222
    223						CLR	$CRSST		;CLEAR PS STORAGE WORD
    224						MFPS	$CRSST		;STORE LOW BYTE OF PS
    225						MTPS	#PR7		;LOCK OUT INTERRUPTS
    226
    227						.IFF
    228
CRASH	MACRO M1110  22-AUG-79 07:05  PAGE 3-4


    229						MOV	PS,$CRSST	;STORE FULL PS
    230						MOVB	#PR7,PS		;LOCK OUT INTERRUPTS
    231
    232						.ENDC
    233
    234
    235						MOV	SP,$CRSST-2	;;;SAVE SP
    236						MOV	$CRUPC,$CRSST-4	;;;SAVE PC BEFORE IOT CRASH
    237						MOV	$CRUST,$CRSST-6	;;;SAVE PS BEFORE IOT CRASH
    238						MOV	#$CRSST-6,SP	;;;RESET SP TO INTERNAL STACK
    239
    240
    241						.IF DF	M$$MGE
    242
    243						MFPI	SP		;;;SAVE USER'S SP
    244
    245						.IFF
    246
    247						CLR	-(SP)		;;;NO USER SP IF UNMAPPED
    248
    249						.IFTF
    250
    251						MOV	R0,-(SP)	;;;SAVE REGISTER SET 1
    252						MOV	R1,-(SP)	;;;
    253						MOV	R2,-(SP)	;;;
    254						MOV	R3,-(SP)	;;;
    255						MOV	R4,-(SP)	;;;
    256						MOV	R5,-(SP)	;;;
    257
    258						.IFT
    259
    260						PUSH	SR0		;;;SAVE MEMORY MANAGEMENT REGISTERS
    261						PUSH	SR0+2		;;;
    262						PUSH	SR0+4		;;;
    263						PUSH	SR3		;;;
    264						BIC	#67,SR3		;;;DISABLE UNIBUS MAP AND D-SPACE
    265						MOV	#UISDR0,R0	;;;SETUP TO SAVE FIRST SET OF APR'S
    266						MOV	#32.,R1		;;;
    267					10$:	PUSH	(R0)		;;;SAVE APR
    268						ADD	#2,R0		;;;MOVE TO NEXT ONE
    269						DEC	R1		;;;DONE YET?
    270						BNE	10$		;;;IF NE NO
    271						MOV	#SISDR0,R0	;;;SETUP TO SAVE SECOND SET OF APR'S
    272						MOV	#64.,R1		;;;
    273					20$:	PUSH	(R0)		;;;SAVE APR
    274						ADD	#2,R0		;;;MOVE TO NEXT ONE
    275						DEC	R1		;;;DONE YET?
    276						BNE	20$		;;;IF NE NO
    277						MOV	#UBMPR,R0	;;;GET ADDRESS OF FIRST UMR
    278						MOV	#62.,R1		;;;NUMBER OF UMR'S TO SAVE
    279					30$:	PUSH	(R0)		;;;SAVE A UMR
    280						ADD	#2,R0		;;;MOVE TO NEXT ONE
    281						DEC	R1		;;;DONE YET?
    282						BNE	30$		;;;IF NE NO
    283
    284						.ENDC
    285
CRASH	MACRO M1110  22-AUG-79 07:05  PAGE 3-5


    286
    287					;
    288					; TYPE MESSAGE AND WAIT FOR USER
    289					;
    290
    291					AGAIN:	MOV	$CRSUN,R0	;;;GET CRASH UNIT NUMBER
    292						ADD	#'0,R0		;;;ADD ASCII BIAS
    293						MOVB	R0,UNIT		;;;MOVE IT INTO TEXT STRING
    294						MOV	#CRSMSG,R1	;;;TYPE USER MESSAGE
    295						MOV	#C$$RSH,R5	;;;GET CSR ADDRESS OF PRINT DEVICE
    296					10$:	MOVB	(R1)+,R2	;;;GET CHARACTER
    297						BEQ	$CRSHT		;;;IF EQ MESSAGE PRINTED
    298						CALL	$OUT		;;;OUTPUT THE CHARACTER
    299						BR	10$		;;;LOOP FOR MORE
    300					$CRSHT::HALT			;;;WAIT FOR THE USER
    301						BR	DUMP		;;;GO DO THE DUMP
    302
    303					;
    304					; FOR CONVENIENCE THE CRASH DEVICE UNIT NUMBER IS STORED
    305					; HERE SO THAT THE CONSOLE DISPLAY +2 WILL GIVE THE
    306					; ADDRESS OF THE NEXT WORD, THUS ALLOWING THE USER TO PATCH
    307					; A DIFFERENT UNIT NUMBER (IGNORING THE PRINTOUT).
    308					;
    309
    310					$CRSUN::.WORD	C$$RUN		;;;CRASH UNIT NUMBER (DEFAULT=0)
    311
    312
    313					;+
    314					; **-CKSUM-VERIFY CHECKSUM OF DEVICE ADDRESS
    315					;
    316					; THIS ROUTINE WILL VERIFY THAT THE DEVICE ADDRESS FOR THE RK11
    317					; AND TC11 HAS NOT BEEN CORRUPTED BY THE CRASH.
    318					;-
    319
    320					CKSUM:	MOV	$CRSBN,-(SP)	;;;GET HIGH ORDER BITS
    321						ADD	$CRSBN+2,(SP)	;;;ADD LOW ORDER BITS
    322						CMP	(SP)+,$CRSCS	;;;COMPARE WITH CHECKSUM
    323						BEQ	10$		;;;IF EQ OK
    324						HALT			;;;WAIT FOR USER
    325						BR	CKSUM		;;;TRY AGAIN
    326					10$:	RETURN			;;;
    327
    328					;+
    329					; **-DUMP-DUMP THE SYSTEM IMAGE
    330					;
    331					; THIS ROUTINE IS USED TO DUMP THE INTERNAL CRASH STACK
    332					; AND THE SYSTEM IMAGE ONTO A SCTATCH DUMP MEDIA.  WHEN THE DUMP
    333					; IS FINISHED THE SYSTEM IS EITHER RE-BOOTED OR THE USER IS ASKED
    334					; IF HE WANTS TO DUMP ANOTHER COPY OF THE IMAGE.
    335					;
    336					; INPUTS:
    337					;	NONE.
    338					;
    339					; OUTUTS:
    340					;	IMAGE DUMPED.
    341					;-
    342
CRASH	MACRO M1110  22-AUG-79 07:05  PAGE 3-6


    343					DUMP:				;;;DUMP IMAGE ONTO MEDIA
    344						MOV	#C$$CSR,R0	;;;GET CSR ADDRESS OF DUMP DEVICE
    345						MOV	$CRSUN,R3	;;;GET UNIT NUMBER
    346
    347
    348						.IF EQ	C$$CDA-1
    349
    350					PBNH=	0			;HIGH ORDER TC11 BLOCK NUMBER
    351					PBNL=	100			;LOW ORDER TC11 BLOCK NUMBER
    352
    353						CALL	CKSUM		;;;CHECK BLOCK NUMBER AGAINST CHECKSUM
    354						SWAB	R3		;;;POSITION UNIT BITS
    355						MOV	R3,R1		;;;COPY
    356						BIS	#4003,R1	;;;SET FOR READ LBN IN REVERSE
    357						MOV	R1,(R0)		;;;START THE TAPE
    358					10$:	BIT	#100200,(R0)	;;;ERROR OR READY?
    359						BEQ	10$		;;;IF EQ NO
    360						BPL	DUMP		;;;IF PL MOVE UNTIL ENDZONE
    361					20$:	MOV	R3,R1		;;;RETREIVE UNIT BITS
    362						BIS	#3,R1		;;;SET TO READ LBN FORWARD
    363						MOV	R1,(R0)		;;;START THE TAPE
    364					30$:	BIT	#100200,(R0)	;;;ERROR OR READY?
    365						BMI	DUMP		;;;IF MI ERROR, RESTART
    366						BEQ	30$		;;;IF EQ WAIT
    367						SUB	$CRSBN+2,6(R0)	;;;ARE WE AT THE BLOCK WE WANT?
    368						BNE	20$		;;;IF NE NO
    369						MOV	#-256.,2(R0)	;;;WORD COUNT FOR INTERNAL STACK
    370						MOV	#$CRSBF,4(R0)	;;;SET INTERNAL STACK ADDRESS
    371						MOV	R3,R1		;;;RETREIVE UNIT BITS
    372						BIS	#15,R1		;;;SET TO WRITE DATA FORWARD
    373						MOV	R1,(R0)		;;;WRITE THE BLOCK
    374					40$:	BIT	#100200,(R0)	;;;ERROR OR READY?
    375						BEQ	40$		;;;IF EQ NO
    376						BMI	DUMP		;;;IF MI ERROR, RESTART
    377						CLR	2(R0)		;;;SET TO WRITE ALL MEMORY
    378						CLR	4(R0)		;;;
    379						MOV	R3,R1		;;;RETREIVE UNIT BITS
    380						BIS	#15,R1		;;;SET TO WRITE DATA FORWARD
    381						MOV	R1,(R0)		;;;WRITE ALL MEMORY
    382					50$:	CLR	2(R0)		;;;KEEP WRITING
    383						TST	(R0)		;;;ANY ERRORS?
    384						BPL	50$		;;;IF PL NO
    385						BIT	#400,-2(R0)	;;;NON-EXISTANT MEMORY?
    386						BEQ	DUMP		;;;IF EQ NO, RESTART
    387						BIS	#1,R3		;;;SET TO STOP TAPE
    388						MOV	R3,(R0)		;;;STOP TAPE
    389
    390						.ENDC
    391
    392
    393						.IF EQ	C$$CDA-2
    394
    395					PBNH=	0			;HIGH PART OF RK11 DISK ADDRESS
    396					PBNL=	124			; LOW PART OF RK11 DISK ADDRESS
    397
    398						CALL	CKSUM		;;;CHECK DISK ADDRESS AGAINST CHECKSUM
    399						CLC			;;;SET TO POSITION UNIT BITS
CRASH	MACRO M1110  22-AUG-79 07:05  PAGE 3-7


    400						ROR	R3		;;;
    401						ROR	R3		;;;
    402						ROR	R3		;;;
    403						ROR	R3		;;;
    404						MOV	#401,(R0)	;;;RESET RK11 CONTROLLER
    405						BIS	$CRSBN+2,R3	;;;SET STARTING DISK ADDRESS
    406						MOV	R3,6(R0)	;;;SET DISK ADDRESS
    407						MOV	#$CRSBF,4(R0)	;;;SET ADDRESS OF INTERNAL STACK
    408						MOV	#-256.,2(R0)	;;;SET TO WRITE ONE BLOCK
    409						MOV	#403,(R0)	;;;WRITE THE FIRST BLOCK
    410					10$:	BIT	#100200,(R0)	;;;ERROR OR READY?
    411						BEQ	10$		;;;IF EQ NO
    412						BMI	DUMP		;;;IF MI ERROR, RESTART
    413						CLR	4(R0)		;;;SETUP TO WRITE ALL MEMORY
    414						CLR	2(R0)		;;;
    415						MOV	#403,(R0)	;;;START THE WRITE
    416					20$:	CLR	2(R0)		;;;KEEP WRITING
    417						TST	(R0)		;;;ANY ERROR BITS SET?
    418						BPL	20$		;;;IF PL NO
    419						BIT	#2000,-2(R0)	;;;NON-EXISTANT MEMORY?
    420						BEQ	DUMP		;;;IF EQ NO, RESTART
    421
    422						.ENDC
    423
    424
    425						.IF EQ	C$$CDA-3
    426
    427					PBNH=	0			;BLOCK NUMBER IGNORED FOR TM11
    428					PBNL=	0			;
    429
    430						SWAB	R3		;;;POSITION UNIT SELECT BITS
    431						BIS	#60001,R3	;;;MERGE DENSITY AND GO BITS
    432						MOV	R3,R2		;;;COPY
    433						BIS	#16,R2		;;;SET REWIND FUNCTION
    434						MOV	R2,(R0)		;;;START THE REWIND
    435					10$:	BIT	#100200,(R0)	;;;ERROR OR READY?
    436						BMI	DUMP		;;;IF MI ERROR, RESTART
    437						BEQ	10$		;;;IF EQ NO
    438						MOV	#$CRSBF,4(R0)	;;;SET ADDRESS OF INTERNAL STACK
    439						MOV	R3,R2		;;;RETREIVE MTC BITS
    440						BIS	#4,R2		;;;SET WRITE DATA FUNCTION
    441						MOV	#-512.,2(R0)	;;;SET 512. BYTE RECORD
    442						MOV	R2,(R0)		;;;START THE WRITE
    443					20$:	BIT	#100200,(R0)	;;;ERROR OR READY?
    444						BMI	DUMP		;;;IF MI ERROR, RESTART
    445						BEQ	20$		;;;IF EQ NO
    446						CLR	(R0)		;;;CLEAR MTC REGISTER
    447						CLR	4(R0)		;;;START TO WRITE ALL MEMORY
    448						BIC	#1,R2		;;;CLEAR GO BIT
    449						MOV	R2,(R0)		;;;LOAD MTC REGISTER
    450					30$:	MOV	#-500,R1	;;;WAIT FOR TAPE TO SETTLE DOWN
    451					35$:	DEC	R1		;;;WAIT
    452						BNE	35$		;;;IF NE LOOP
    453						MOV	#-512.,2(R0)	;;;SET 512. BYTE RECORDS
    454						BIS	#1,(R0)		;;;START THE WRITE
    455					40$:	BIT	#100200,(R0)	;;;ERROR OR READY?
    456						BEQ	40$		;;;IF EQ NO
CRASH	MACRO M1110  22-AUG-79 07:05  PAGE 3-8


    457						BPL	30$		;;;IF PL WRITE FINISHED
    458						TSTB	-2(R0)		;;;NON-EXISTANT MEMORY?
    459						BPL	DUMP		;;;IF PL NO, RESTART
    460						MOV	R3,R2		;;;RETREIVE MTC BITS
    461						BIS	#10000,R2	;;;SET CLEAR FUNCTION
    462						MOV	R2,(R0)		;;;LOAD FUNCTION
    463					50$:	TSTB	(R0)		;;;READY?
    464						BPL	50$		;;;IF PL NO
    465						BIS	#6,R3		;;;SET WRITE EOF FUNCTION
    466						MOV	R3,(R0)		;;;DO THE WRITE EOF
    467					60$:	TSTB	(R0)		;;;READY?
    468						BPL	60$		;;;IF PL NO
    469						CLR	(R0)		;;;CLEAR MTC REGISTER
    470
    471						.ENDC
    472
    473
    474						.IF EQ	C$$CDA-4
    475
    476					PBNH=	0			;BLOCK NUMBER IGNORED FOR TJU16
    477					PBNL=	0			;
    478
    479						BIS	(PC)+,R3	;;;SET MODE AND DENSITY
    480					$DNSTY::.WORD	1300		;;;DEFAULT TO 800 BPI, NORMAL MODE
    481						BIS	#40,10(R0)	;;;RESET CONTROLLER
    482					10$:	TSTB	12(R0)		;;;IS THE TAPE DRIVE READY?
    483						BPL	10$		;;;IF PL NO
    484						MOV	R3,32(R0)	;;;SET FORMAT BITS
    485						MOV	#7,(R0)		;;;START THE TAPE REWINDING
    486					20$:	BIT	#20000,12(R0)	;;;POSITIONING STILL IN PROGRESS?
    487						BNE	20$		;;;IF NE YES
    488						TSTB	12(R0)		;;;DRIVE READY?
    489						BPL	20$		;;;IF PL NO
    490						MOV	#$CRSBF,4(R0)	;;;SET ADDRESS OF INTERNAL STACK
    491						MOV	#-256.,2(R0)	;;;SET WORD COUNT
    492						MOV	#-512.,6(R0)	;;;SET FRAME COUNT
    493						MOV	#61,(R0)	;;;START THE WRITE
    494					30$:	TSTB	12(R0)		;;;DRIVE READY?
    495						BPL	30$		;;;IF PL NO
    496						BIT	#40000,(R0)	;;;TRANSFER ERROR?
    497						BNE	DUMP		;;;IF NE YES, RESTART
    498						CLR	4(R0)		;;;SET TO WRITE ALL OF MEMORY
    499					40$:	MOV	#-256.,2(R0)	;;;SET WORD COUNT
    500						MOV	#-512.,6(R0)	;;;SET FRAME COUNT
    501						BIS	#1,(R0)		;;;START TO WRITE ALL OF MEMORY
    502					50$:	TSTB	12(R0)		;;;DRIVE READY?
    503						BPL	50$		;;;IF PL NO
    504						BIT	#40000,(R0)	;;;TRANSFER ERRORS?
    505						BEQ	40$		;;;IF EQ NO
    506						BIT	#4000,10(R0)	;;;NON-EXISTANT MEMORY?
    507						BEQ	DUMP		;;;IF EQ NO
    508						BIS	#40,10(R0)	;;;RESET CONTROLLER
    509					60$:	TSTB	12(R0)		;;;DRIVE READY?
    510						BPL	60$		;;;IF PL NO
    511						MOV	R3,32(R0)	;;;RESET FORMAT BITS
    512						MOV	#27,(R0)	;;;WRITE EOF ON TAPE
    513					70$:	TSTB	12(R0)		;;;IS DRIVE READY?
CRASH	MACRO M1110  22-AUG-79 07:05  PAGE 3-9


    514						BPL	70$		;;;IF PL NO
    515						CLR	(R0)		;;;CLEAR CONTROLLER REGISTER
    516
    517						.ENDC
    518
    519						.ENDC
    520
    521
    522						.IFF
    523
    524	000000	000167 	000000G			JMP	$PANIC		;;;JUMP TO PANIC DUMP ROUTINE
    525
    526
    527						.ENDC
    528
    529
    530					;+
    531					; IF B$$OOT IS DEFINED, RE-BOOT THE SYSTEM BY JUMPING TO THE
    532					; BOOTSTRAP ROM ADDRESS SPECIFIED BY B$$OOT.  ELSE, RE-ISSUE
    533					; THE CRASH MESSAGE IF THE USER WISHES ANOTHER DUMP.  IF NO
    534					; CRASH DUMP WAS CONFIGURED, SIMPLY RE-BOOT OR HALT FOREVER.
    535					;-
    536
    537	000004				$BTSTP::			;;;RE-BOOT THE SYSTEM
    538
    539
    540						.IF DF	B$$OOT
    541
    542						HALT			;;;WAIT FOR THE USER BEFORE BOOTING
    543						RESET			;;;RESET THE WORLD
    544						JMP	@#B$$OOT	;RE-BOOT THE SYSTEM
    545
    546						.IFF
    547
    548	000004	000000 				HALT			;;;WAIT FOR THE USER
    549
    550
    551						.IF DF	C$$RSH
    552
    553
    554						.IF DF	C$$CDA
    555
    556						JMP	AGAIN		;;;DO IT ALL OVER AGAIN
    557
    558						.ENDC
    559
    560
    561						.IFF
    562
    563	000006	000776 				BR	.-2		;;;LOOP FOREVER
    564
    565						.ENDC
    566
    567
    568						.ENDC
    569
    570
CRASH	MACRO M1110  22-AUG-79 07:05  PAGE 3-10


    571		000001 				.END
CRASH	MACRO M1110  22-AUG-79 07:05  PAGE 3-11
SYMBOL TABLE

A$$CHK= 000000   	I$$RDN= 000000   	L$$DRV= 000000   	P$$TPT= 000000   	V$$CTR= 001200
A$$CPS= 000000   	K$$CNT= 177546   	M$$CRB= 000124   	R$$DER= 000000   	V$$RSN= 000031
A$$TRP= 000000   	K$$CSR= 177546   	M$$MGE= 000000   	R$$EXV= 000000   	X$$DBT= 000000
C$$ORE= 002000   	K$$IEN= 000115   	M$$NET= 000000   	R$$SND= 000000   	$BTSTP  000004RG
G$$TPP= 000000   	K$$LDC= 000001   	M$$NT2= 000000   	R$$11M= 000000   	$CRASH  000000RG
G$$TTK= 000000   	K$$TPS= 000074   	N$$LDV= 000001   	R$$11S= 000000   	$PANIC= ****** GX
H$$RTZ= 000074   	L$$ASG= 000000   	P$$RTY= 000000   	S$$YSZ= 001740

. ABS.	000000	   000
      	000010	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  1155 WORDS  ( 5 PAGES)
DYNAMIC MEMORY:  2980 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:17
[11,24]CRASH,SY0:[11,34]CRASH/-SP=[1,1]EXEMC/ML,[11,10]RSXMC/PA:1,CRASH