Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-05 - 43,50337/23/depcha.mac
There is 1 other file named depcha.mac in the archive. Click here to see a list.
COMMENT * SIMULA specification;
OPTIONS(/E:QUICK,depchar);
PROCEDURE depchar(t,p,c); TEXT t; INTEGER p; CHARACTER c;
!	IF p>0 AND p<=t.Length
!	THEN t.Sub(p,1).Putchar;
COMMENT Safe version of Putchar. No action for parameters out of range;

!*;! MACRO-10 code !;!

	TITLE	depchar
	ENTRY	depchar
	SUBTTL	SIMULA utility, Lars Enderin Nov 1975

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

	sall
	search SIMMCR,SIMMAC
	macinit

	t==XWAC1
	p==t+2
	c==p+1

depchar:LF	X1,ZTVLNG(,t)	;! t.Length
	IF	;! p is in range
		SOJL	p,FALSE
		CAMG	X1,p
		GOTO	FALSE
	THEN	;! Compute byte pointer, deposit char
		LF	,ZTVSP(,t)	;! offset
		ADD	p		;! +p-1
		IDIVI	5
		ADDI	2(t)		;! Address to 1st text word
		HLL	ptab(X1)
		DPB	c,
	FI
	RETURN

ptab:	POINT	7,2,06
	POINT	7,2,13
	POINT	7,2,20
	POINT	7,2,27
	POINT	7,2,34
	END;