Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-05 - 43,50337/24/run.mac
There are 5 other files named run.mac in the archive. Click here to see a list.
COMMENT * SIMULA specification;
OPTIONS(/E:CODE,ZYLRUN);
PROCEDURE run(filespec,entrypoint);
VALUE filespec; TEXT filespec; INTEGER entrypoint;
COMMENT Runs the program specified by filespec without closing files.
Normally, an explicit extension should NOT be given.
entrypoint must be in the range 1-16 inclusive.
For a standard CUSP, 1 gives the normal entry point and 2 gives the
secondary entry point (CCL entry).
If the device was not specified or specified as DSK:, and no ppn was
given, SYS: is tried as device on failure.
;

!*;! MACRO-10 code !*;!

	TITLE	run
	ENTRY	ZYLRUN
	SUBTTL	SIMULA utility, Lars Enderin Feb 1976

;!*** Copyright 1976 by the Swedish Defence Research Institute. ***
;!*** Copying is allowed.					***


	sall
	search	simmac,simmcr,simrpa
	macinit

	;! Local definitions ;!


	filespec==2
	entrypoint==4
	xdvn==x4
	xnam==x5
	xext==x6
	xppn==x10
	x17==17

ZYLRUN:	PROC
	GOTO	L1
;! Restore jumps to this point
	SETOM	offs
	GOTO	L2
L1():!	SETZM	offs
	L	entrypoint(XCB)
	IF	;! [205] Too large or negative offset
		SOJL	TRUE
		CAIG	^D15
		GOTO	FALSE
	THEN	;! Error
		BRANCH	CSEP	;! [206] Return on error
	FI
	SOS	entrypoint(XCB)
L2():!	EXEC	CPNE	;! Create file object
	XWD	0,IOIN	;! Any file class will do
	LD	X0,filespec(XCB)
	STD	X0,OFFSET(ZFISPC)(XWAC1)
	LI	1B<%ZFIBNW>+1B<%ZFINLE>	;! No buffers, no lookup
	IORM	OFFSET(ZFIBNW)(XWAC1)
	EXEC	CSEN	;! Initialize file info
	;! [206] No message
	LF	xdvn,ZFIDVN(XWAC1)
	LF	xnam,ZFIFIL(XWAC1)
	IF	;! [244] Extended lookup block
		IFOFF	ZFIDE(XWAC1)
		GOTO	FALSE
	THEN	;! Get info from that
		HLLZ	xext,OFFSET(ZXBEXT)(xnam)
		WLF	xppn,ZXBP2(xnam)
		LF	xnam,ZXBFIL(xnam)
	ELSE
		HLLZ	xext,OFFSET(ZFIEXT)(XWAC1)
		WLF	xppn,ZFIPRG(XWAC1)
	FI
	IF	;! [244] Could be SFD ptr
		CAMN	xppn,[-1]
		SETZ	xppn,
		JUMPE	xppn,FALSE
	THEN	;! Adjust any ptr
		TLNN	xppn,-1
		ADDI	xppn,2
	FI
	LOWADR
	SKIPL	X1,offs
	MOVS	X1,entrypoint(XCB)
	HRRI	X1,dvn
	SAVEALLACS
	STD	xdvn,dvn
	HRLZM	xext,ext
	SETZM	ext+1
	ST	xppn,ppn
	SETZM	coreas

	RUN	X1,
	LOWADR
	;! Restore ac's
	MOVSI	x17,YUUOAC(XLOW)
	BLT	x17,x17
	IF	;! Device was not SYS and ppn was not given
		JUMPN	xppn,FALSE
		CAMN	xdvn,[SIXBIT'SYS']
		GOTO	FALSE
	THEN	;! Try SYS
		MOVSI	xdvn,'SYS'
		ST	xdvn,dvn
		RUN	X1,
	FI
	HALT



offs:	BLOCK	1	;! If non-zero, used as start offset
dvn:	BLOCK	1
nam:	BLOCK	1
ext:	BLOCK	1
	BLOCK	1
ppn:	BLOCK	1
coreas:	BLOCK	1
	EPROC
	LIT
	END;