Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-05 - 43,50337/24/forsim.mac
There are 2 other files named forsim.mac in the archive. Click here to see a list.
COMMENT ! SIMULA SPECIFICATION;
OPTIONS(/E:FORTRAN,FORSIM);
PROCEDURE forsim(n); INTEGER n;
COMMENT n <= 0: No error interrupt desired.
	       If n=0, type error message first time, but allow to continue.
	n > 0: Allow to continue n-1 times, then give RTS error;

!;! MACRO-10 code !;!

	TITLE	FORSIM

	SUBTTL	SIMULA utility, Lars Enderin 1975

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

	ENTRY	FORSIM,IN.,OUT.,IOLST.,FIN. ;! [307]

	OPDEF	RTSERR	[001B8]
	udfe==214	;! User defined error
	X1==1

FORSIM:	HLRZ	-1(16)	;! Parameter may be missing if called from FORTRAN
	JUMPE	.+3	;! Leave as is if so
	MOVE	@(16)	;! n
	MOVEM	N
	POPJ	17,

IOLST.:	MOVEI	IOLMSG
JRST	out

IN.:	MOVEI	INMSG
	JRST	out

OUT.:	MOVEI	OUTMSG
	JRST	out

FIN.:	MOVEI	FINMSG	;! [307]
	JRST	out

out:	SKIPN	N
	 JRST	out1
	SOSE	X1,N
	 JRST	out2
	OUTSTR	@
	RTSERR	udfe
out1:	OUTSTR	@
	SETOM	N	;! Inhibit further messages
out2:	POPJ	17,


N:	Z
INMSG:	ASCIZ	"
% I/O attempted by FORTRAN subroutine
"
OUTMSG=INMSG
FINMSG=INMSG
IOLMSG=INMSG

	END;