Google
 

Trailing-Edge - PDP-10 Archives - bb-bt99e-bb - rmsio.c05
There are 2 other files named rmsio.c05 in the archive. Click here to see a list.
 REP 8/1	;05C1
	;COPYRIGHT (C) 1979, 1981 BY DIGITAL EQUIPMENT CORPORATION
 WIT
	;COPYRIGHT (C) 1979, 1981, 1982 BY DIGITAL EQUIPMENT CORPORATION


	;EDITS
	;NAME	DATE		COMMENT
	;SMI	14-OCT-82	[1046] Fix CHECKPOINT with RMS files for DELETE, and
	;				REWRITE.
	;JSM	18-OCT-82	[1045] Use $MESSAGE in RMSGET as first RMS-20 call to
	;				initialize RMS-20 global data symbols.
	;RLF	08-OCT-82	[1044] Space fill record area
	;RJD	21-APR-82	[1020] Test for CHECKPOINT with RMS files
	;RJD	29-APR-82	[1022] Deallocate memory if OPEN fails


 INS 19/4	;05C2
	FT.CRC: POINT 8,F.CRC(FT),17	;[1020] CHECKPOINT RECORD COUNT
 INS 64/7	;05C3
		$MESSAGE		;[1045] TURN ON RMS-20 INTERNAL MESSAGE
					;[1045] REPORTING AND ALSO INITIALIZE THE
					;[1045] AREA FOR RMS-20 GLOBAL DATA SYMBOLS.
 INS 35/10	;05C4
		LDB	T0,FT.CRC	;[1020] IS THERE CHECKPOINTING?
		JUMPE	T0,.+2		;[1020] NO
		MOVEM	T0,D.CRC(FT)	;[1020] YES, INITIALIZE RECORD COUNT
 INS 154/14	;05C5
	;SPACE FILL THE RECORD AREA
		MOVE	T0,F.WFLG(FT)	;[1044] GET FLAGS
		LDB	T3,[POINT 2,T0,2]
		MOVE	T2,[5
			    4
			    6](T3)	;[1044] BYTE/WORD IN T2
		LDB	T1,FT.MRS	;[1044] MAX RECORD SIZE
		IDIV	T1,T2		;[1044] # OF WORDS
		SKIPE	T2		;[1044] ROUND UP IF
		ADDI	T1,1		;[1044] ANY REMAINDER
		LDB	T3,[POINT 2,T0,14];[1044] INTERNAL DATA MODE
		MOVE	T0,SPCTLE(T3)	;[1044] GET SPACE
		MOVE	T2,F.RREC(FT)	;[1044] GET RECORD PTR
		MOVEM	T0,(T2)		;[1044] FILL FIRST LOC WITH SPACE
		HRLI	T0,(T2)		;[1044] THE FROM ADR
		HRRI	T0,1(T2)	;[1044] THE TO ADR
		ADDI	T1,-1(T2)	;[1044] THE UNTIL ADR
		BLT	T0,(T1)		;[1044] FILL WITH SPACES

 REP 339/14	;05C6
		 POPJ	PP,		;No, regular error
 WIT
	;[D1022]	 POPJ	PP,		;No, regular error
		 PJRST	RFNFER		;[1022] Jump to routine to release core
 INS 380/14	;05C7

	SPCTLE:	ASCII /     /		;[1044] ASCII SPACES
		BYTE (9) 100,100,100,100	;[1044] EBCDIC
		SIXBIT /      /		;[1044] SIXBIT

 INS 22/23	;05C8
		PUSH	PP,T2		;[1020] SAVE THE RAB FOR FLUSH
 REP 26/23	;05C9
		MOVE	T1,FS.FS	;GET FILE STATUS
		CAIL	T1,^D10		;SEE IF SOME KIND OF AT-END/INVALID KEY
		CAILE	T1,^D29
		 PJRST	SETFS		;SET FILE-STATUS, AND GIVE NORMAL RETURN
 WIT
		POP	PP,T2		;[1020] RESTORE THE RAB
		MOVE	T1,FS.FS	;GET FILE STATUS
	;[D1020]	CAIL	T1,^D10		;SEE IF SOME KIND OF AT-END/INVALID KEY
	;[D1020]	CAILE	T1,^D29
		CAIG	T1,^D9		;[1020] SEE IF SOME KIND OF AT-END/INVALID KEY
		JRST	CHKPT		;[1020]	
		CAIG	T1,^D29		;[1020]
		JRST	CPOPJ1		;[1020]
	CHKPT:	LDB	T0,FT.CRC	;[1020] CHECKPOINTING?
		JUMPE	T0,CHKPT1	;[1020] NO
		SOSE	D.CRC(FT)	;[1020] DECREMENT COUNT - TIME TO OUTPUT?
		JRST	CHKPT1		;[1020] NOT YET
		LDB	T0,FT.CRC	;[1020] GET COUNT
		MOVEM	T0,D.CRC(FT)	;[1020] RESET COUNT
		$FLUSH	<(T2)>,FSHERR	;[1020] WRITE REC TO DISK
	CHKPT1:				;[1020]
		 PJRST	SETFS		;SET FILE-STATUS, AND GIVE NORMAL RETURN
	FSHERR:	TYPE	[ASCIZ/
	?LIBOL:	$FLUSH  failed
	/]				;[1020] RETURN ERROR MESSAGE
		JRST	RSFAIR		;[1020] RMS SYSTEM ERROR
 INS 12/24	;05C10
		MOVE	T0,D.CRC(FT)	;[1020]] IF TIME TO CHECKPOINT
		CAIE	T0,1		;[1020]] DON'T TURN ON WRITE BEHIND
 REP 41/29	;05C11
		$DELETE	<(T2)>,DELSER	;SEQ. DELETE ERROR
		PUSHJ	PP,SETFS	;SET FILE-STATUS TO 0
 WIT
		PUSH	PP,T2		;[1046] SAVE RAB
		$DELETE	<(T2)>,DELSER	;SEQ. DELETE ERROR
		POP	PP,T2		;[1046] RESTORE RAB
		LDB	T0,FT.CRC	;[1046] CHECKPOINTINT ?
		JUMPE	DLG1		;[1046] NO
		SOSE	D.CRC(FT)	;[1046] DECREMENT COUNT, TIME TO OUTPUT ?
		JRST	DLG1		;[1046] NOT YET
		LDB	T0,FT.CRC	;[1046] GET COUNT
		MOVEM	T0,D.CRC(FT)	;[1046] RESET IT
		$FLUSH	<(T2)>,FSHERR	;[1046] WRITE RECORD (S) TO DSK
	DLG1:	PUSHJ	PP,SETFS	;[1046] SET FILE-STATUS TO 0
 INS 27/30	;05C12
		PUSH	PP,T2		;[1046] SAVE RAB
 INS 30/30	;05C13
		POP	PP,T2		;[1046] RESTORE RAB
 REP 36/30	;05C14
	UPDOK:	PUSHJ	PP,SETFS	;SET FILE-STATUS WORD
 WIT
	UPDOK:	LDB	T0,FT.CRC	;[1046] CHECKPOINTING ?
		JUMPE	UPDO1		;[1046] NO
		SOSE	D.CRC(FT)	;[1046] DECREMENT COUNT - TIME TO OUTPUT ?
		JRST	UPDO1		;[1046] NOT YET
		LDB	T0,FT.CRC	;[1046] GET COUNT
		MOVEM	T0,D.CRC(FT)	;[1046] RESET COUNT
		$FLUSH	<(T2)>,FSHERR	;[1046] UPDATE DISK
	UPDO1:	PUSHJ	PP,SETFS	;SET FILE-STATUS WORD
 SUM 260687