Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-05 - 43,50337/24/from.mac
There are 2 other files named from.mac in the archive. Click here to see a list.
COMMENT& SIMULA specification;
OPTIONS(/EXTERN:QUICK,from);

TEXT PROCEDURE from(t,i); TEXT t; INTEGER i;

!	IF i<=t.Length THEN
!	from :- IF i<=0 THEN t ELSE t.Sub(i,t.Length-1+1);

	!&;! MACRO-10 code !;!

	TITLE	from
	SUBTTL	Compute text reference to text after pos=i
	SALL
	SEARCH	SIMMAC,SIMMCR
	MACINIT
	ENTRY	from
from:	PROC
	HLLZ	1(XTAC)		;!Length,,0
	L	X1,2(XTAC)	;! i
	IF	;! i>0
		SOJLE	X1,FALSE
	THEN	;! Compute t.Length-(i-1)
		MOVSI	X1,(X1)
		ADDM	X1,(XTAC)	;!New offset,,address
		SUB	X1		;!New Length,,0
		SKIPG
		SETZB	(XTAC)		;! NOTEXT
	FI
L9():!	ST	1(XTAC)
	RETURN
	EPROC
	END;