perm filename REST.MAC[SIM,SYS] blob sn#460184 filedate 1979-07-20 generic text, type T, neo UTF8
	COMMENT! SIMULA specification;
	OPTIONS(/EXTERN:QUICK,REST);
	TEXT PROCEDURE rest(t); TEXT t;
	!;!Computes t.sub(t.pos,t.length+1-pos);!

	;! MACRO-10 code ;!

	TITLE	REST
	SUBTTL	Compute text reference to text after pos
	SALL
	SEARCH	SIMMAC,SIMMCR
	MACINIT
	ENTRY	REST
REST:	PROC
	EXCH	XWAC1,(XTAC)
	EXCH	XWAC2,1(XTAC)
	LF	X0,ZTVLNG(,XWAC1)
	SUBI	X0,(XWAC2)
	IF	;!Anything left
		JUMPLE	X0,FALSE
	THEN	;!Modify text descriptor
		LF	X1,ZTVSP(,XWAC1)
		ADDI	X1,(XWAC2)
		SF	X1,ZTVSP(,XWAC1)
		SF	X0,ZTVLNG(,XWAC1)
	ELSE	;!NOTEXT
		SETZB	XWAC1,XWAC2
	FI
	HLLZS	XWAC2	;! Setpos(1)
	EXCH	XWAC2,1(XTAC)
	EXCH	XWAC1,(XTAC)
	RETURN
	EPROC
	END;