Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-11 - 43,50531/passtr.mac
There are 4 other files named passtr.mac in the archive. Click here to see a list.
	title PASSTR - string I/O for pascal

	twoseg

	search pasunv

	extern illfn,clofil,norchx
	entry stset.,stwr.

	reloc 400000

	filfps==26		;first position - for getindex only

strnt:	exp strget,strput,.+1
	exp illfn,illfn,0,cpopj,cpopj,illfn,illfn

strget:	sosge filbtc(b)
	jrst strend
	ildb a,filbtp(b)
	jumpe a,strget
	move a,norchx(a)
	hlrem ac1,fileol(reg)
	hrrzm ac1,filcmp(reg)
	came a,[xwd -1," "]	;carriage return in official mode
	popj p,
streol:	pushj p,strget		;we have a CR, look for real EOL
	skipe fileof(b)		;stop after errors
	popj p,
	skipg fileol(b)		;real EOL?
	jrst streol		;no, next char
	popj p,			;yes, done



strput:	sosge filbtc(b)
	jrst strend
	move a,filcmp(b)
	idpb a,filbtp(b)
cpopj:	popj p,

stset.:	movei a,0		;normal eof
	pushj p,stropn
	jrst @filget(b)

stwr.:	movei a,1		;normal eof
	;jrst stropn

stropn:	movem a,fileof(b)
	trc a,1
	movem a,filbad(b)
	skipe filbfp(b)		;any closing needed?
	pushj p, [ setz c,		;yes - do it
	           jrst clofil]
	movei t,1B23		;allow format error
	movem t,filerr(b)
	hrri t,filr11(b)
	hrli t,strnt
	blt t,filr99(b)		;put in dispatch
	popj p,

strend:	move t,filbad(b)
	movem t,fileof(b)
	movem t,fileol(b)
	setzm filcmp(b)
	movei t,1B22
	hrlm t,filerr(b)
	popj p,

	end