Google
 

Trailing-Edge - PDP-10 Archives - decuslib20-03 - decus/20-0078/libsim/findpr.mac
There are 2 other files named findpr.mac in the archive. Click here to see a list.
Comment * SIMULA specification;
OPTIONS(/E:CODE,findprintfile);
REF(Printfile)PROCEDURE findprintfile(filespec);
VALUE filespec; TEXT filespec;
COMMENT If a Printfile according to the specification can be opened,
then return a file ref, otherwise NONE;

! *;! MACRO-10 code *;!

	TITLE	findprintfile
	SUBTTL	SIMULA utility, Lars Enderin Oct 1975

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

	ENTRY	findprintfile
	sall
	search	simmac,simmcr,simrpa
	macinit

	result==ZBI%S
	filespec==result+1

findprintfile:
	PROC
	EXEC	CPNE	;! Allocate a file object
	XWD	0,IOPF	;! Printfile prototype
	SETON	ZFIFND(XWAC1)	;! Flag special case
	LD	filespec(XCB)	;! Copy the parameter
	STD	OFFSET(ZFISPC)(XWAC1)
	EXEC	CSEN
	IF	;! No luck
		IFON	ZIFEND(XWAC1)
		GOTO	FALSE
	THEN	;! Close the channel etc
		EXEC	IOCL
	ELSE
		ST	XWAC1,result(XCB)
		SETOFF	ZFIFND(XWAC1)
	FI
	BRANCH	CSEP
	EPROC
	END;