Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-05 - 43,50337/23/arrlgd.mac
There is 1 other file named arrlgd.mac in the archive. Click here to see a list.
00100	COMMENT * SIMULA specification;
00200	OPTIONS(/EXTERN:QUICK,arrlgd);
00300	INTEGER PROCEDURE arrlgd(ta); TEXT ARRAY ta;;
00400	
00500	!*;! MACRO-10 code !*;!
00600	
00700		TITLE arrlgd
00800	;!	Compute N := no. of elements in array TA + sum of
00900	;!	the lengths of the elements in the text array TA
01000	;!	N is returned as value of the function procedure ARRLGD
01100		SALL
01200		SEARCH	MACSIM
01300		QUICKPROC
01400		ENTRY arrlgd
01500		SPECIFY<
01600		PROC	.arrlgd,ta
01700		INTEGER	.arrlgd
01800		ARRAY	ta
01900		>
02000		X4=4
02100	arrlgd:	EXCH	ta,(xtac)
02200		PUSH	XPDP,X4
02300		MOVE	X1,5(ta)
02400		SUB	X1,4(ta)	;! Upper limit - lower limit
02500		ADDI	X1,1		;! Loop index
02600		MOVEI	X4,7(ta)	;! Position in array
02700		MOVEM	X1,ta		;! Result = number of elements
02800	L1:	HLRZ	X0,(X4)		;! Length of next element
02900		ADDM	X0,ta		;! Add to result
03000		ADDI	X4,2		;! Increase array position
03100		SOJG	X1,L1		;! End of loop
03200		POP	XPDP,X4		;! Restore register from stack
03300		EXCH	ta,(XTAC)
03400		RETURN
03500		LIT
03600		END;