Google
 

Trailing-Edge - PDP-10 Archives - decuslib20-04 - decus/20-0110/saver.sai
There are 2 other files named saver.sai in the archive. Click here to see a list.
Entry;
COMMENT
.SEC(SAVER.SAI - reenter procedure for SAIL)
.index(SAVER.SAI - reenter procedure for SAIL)
.;
Begin "SAVER.SAI"

Require "DEFINE.REQ" source!file;

Internal PROCEDURE SAVER;
Begin "SAVER"

Comment on entering this procedure save the state of the
	core image and then exit where you are supposed to
	type SAVE. To restart at a later date do a GET <file name>
	then REENTER.;

Label FOO;
Integer R0,R1,R2,R3,R4,R5,R6,R7,R8,R9,R10,R11,R12,R13,R14,R15,R16,R17;
COMMENT note: all files must be closed be call saver;

	Outstr("To save the core image for later use: type SAVE"&
		crlf&"To restart, do GET <program name>"&
		" then do REENTER"&crlf);

COMMENT NOW USE START CODE TO SAVE;
	START!CODE;

COMMENT FIRST SAVE ALL REGISTERS!;
	MOVEM 0,R0;
	MOVEM 1,R1;
	MOVEM 2,R2;
	MOVEM 3,R3;
	MOVEM 4,R4;
	MOVEM 5,R5;
	MOVEM 6,R6;
	MOVEM 7,R7;
	MOVEM 8,R8;
	MOVEM 9,R9;
	MOVEM  10,R10;
	MOVEM  11,R11;
	MOVEM  12,R12;
	MOVEM  13,R13;
	MOVEM  14,R14;
	MOVEM  15,R15;
	MOVEI   1,FOO;
	MOVEM	1,'124;  # SAVE REENTER ADDRESS IN '124 .JBREN;
	HRR 1,'44;    # SOME OTHER FIXES WHICH ARE NECESSARY;
	HRLM 1,'120;
	HRLM 1,'133;
	End;

#	JRST  4,0;	# NOW HALT;
Comment	Now halt;
	CALL(0,"EXIT");

	START!CODE;
COMMENT THIS IS WHERE PROGRAM WILL REENTER;
FOO:    
COMMENT NOW RESTORE REGISTERS;
	MOVE 0,R0;
	MOVE 1,R1;
	MOVE 2,R2;
	MOVE 3,R3;
	MOVE 4,R4;
	MOVE 5,R5;
	MOVE 6,R6;
	MOVE 7,R7;
	MOVE 8,R8;
	MOVE 9,R9;
	MOVE  10,R10;
	MOVE  11,R11;
	MOVE  12,R12;
	MOVE  13,R13;
	MOVE  14,R14;
	MOVE  15,R15;
	End ;
	Outstr("Reentering program!"&'15&'12);
End "SAVER";
End "SAVER.SAI";