Google
 

Trailing-Edge - PDP-10 Archives - decus_20tap1_198111 - decus/20-0003/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,monsym

	extern getchr,illfn,getlnx,putlnx,putpgx,clofil,norchx
	entry stset.,stwr.

	reloc 400000

	filbct==30		;count left
	filbpt==27		;byte ptr
	filfps==26		;first position - for getindex only

strnt:	exp 7b5,strget,strput,getlnx,putlnx,0,.+1
	exp illfn,illfn,putpgx,illfn,illfn,cpopj,cpopj,cpopj

strget:	sosge filbct(b)
	jrst strend
	ildb a,filbpt(b)
	jumpe a,strget
	jrst getchr

strput:	sosge filbct(b)
	jrst strend
	move a,filcmp(b)
	idpb a,filbpt(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)
	move t,[xwd 1,norchx##]	;assume no lower case mapping
	movem t,filcht(b)
	skipe filclo(b)		;any closing needed?
	pushj p, [ setz c,		;yes - do it
	           jrst clofil]
	movei t,fl%fme		;allow format error
	movem t, filflg(b)
	hrri t,filr11(b)
	hrli t,strnt+1
	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,iox4
	movem t,filerr(b)
	popj p,

	end