Google
 

Trailing-Edge - PDP-10 Archives - tops10and20_integ_tools_v9_3-aug-86 - tools/crc/browse/crclr.mac
There are no other files named crclr.mac in the archive.
	TITLE CRCLR - SETS ARRAY TO STRING VALUE
	SEARCH CRCSYM,macsym
	ENTRY CRCLR
	external gtwrd
;
;CALL FROM FORTRAN WITH
;      CALL CRCLR(I,J,K)
;I IS THE START OF THE AREA TO BE CLEARED
;J IS THE NUMBER OF WORDS TO BE CLEARED
;K IS THE VALUE TO BE PLACED IN EACH WORD
;
;
;SET UP T1 AND T2 FOR BLOCK TRANSFER
;THE VALUE PLACED IN THE FIRST WORD IS
;COPIED TO SUBSEQUENT WORDS UNTIL THE
;WORD IN T2 IS REACHED
;
CRCLR:	movei	t1,2			;want the first word of K
	call	gtwrd			;whatever of type
	MOVE	T3,@1(CX)		;CHECK ARG 3 >1
	CAIGE	T3,2
	 JRST	[CAIE	T3,1		;CHECK ARG 3 =1
		 POPJ	P,		;arg 3 = 0 RETURN IMEDIATLY
		MOVEM	T1,@(CX)	;arg 3 = 1 FILL ONE WORD !!
		POPJ	P,]
	MOVEI	T2,@(CX)		;ADDRESS OF 1ST ARG TO T2
	MOVEM	T1,@(CX)		;ASCII STRING TO 1ST ELEMENT
	MOVE	T1,T2			;ADDRESS OF START OF ARRAY TO RT 1/2
	HRL	T1,T1			;ADDRESS OF 1ST ELEMENT TO LT 1/2
	AOJ	T1,			;ADDRESS OF 2ND ELEMENT TO RT 1/2
	ADD	T2,T3			;FIND LAST ELEMENT
	SOJ	T2,			;ADDRESS OF LAST ELEMENT CORRECT
	BLT	T1,(T2)			;PROPAGATE TO END OF ARRAY
	POPJ	P,			;RETURN
	END