perm filename OUTCHR.MAC[SIM,SYS] blob sn#460163 filedate 1979-07-20 generic text, type T, neo UTF8
COMMENT * SIMULA specification;
OPTIONS(/E:QUICK,outchr);
PROCEDURE outchr(ofile,c,n);
REF(Outfile)ofile; CHARACTER c; INTEGER n;
COMMENT Outputs n ASCII characters on the file, which is normally a terminal.
Ofile.Image is not affected.
If ofile==NONE, the controlling terminal is assumed.
If n<=0, no character is output, otherwise the character c is output n times.
The buffer is used directly.
;

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

	TITLE	outchr
	ENTRY	outchr
	SUBTTL	SIMULA utility, Lars Enderin Mar 1976

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


	sall
	search	simmac,simmcr,simrpa
	macinit

	;! Local definitions ;!

	ofile==XWAC1
	c==XWAC2
	n==XWAC3
	bup==OFFSET(ZBHBUP)
	cnt==OFFSET(ZBHCNT)


outchr:	PROC
	JUMPLE	n,L9
	LOWADR
	CAIN	ofile,NONE
	L	ofile,YSYSOUT(XLOW)
	LF	XBH,ZFIOBH(ofile)
	SUBI	XBH,1
	LOOP
		SOSGE	cnt(XBH)
		EXEC	IONB
		IDPB	c,bup(XBH)
	AS
		SOJG	n,TRUE
	SA
L9():!	RETURN
	EPROC
error:	OUTSTR	[ASCIZ/
?ZYLOUC Outchr error
/]
	RTSERR	QDSCON,214
	RETURN
	LIT
	END;