Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-11 - 43,50530/xio.mac
There are 2 other files named xio.mac in the archive. Click here to see a list.
	title XIO - extra I/O runtimes for PASCAL

	search pasunv

	t0=0
	t1=1

if1,<
%getsts=getsts
%mtape=mtape
%setsts=setsts
>


	twoseg
	reloc 400000
	entry setsts,getsts,mtape
	entry erbits,stbits
	entry to6,from6,clreof,erstat
	ENTRY CCLSW,RNFILE
	entry lstrec

define validate,<
	move t0,filtst(reg)
	caie t0,314157
	pushj p,initb.##
	>

setsts:	validate
	move t0,filchn(reg)	;get close UUO
	ior t0,[setsts (reg1)]	;make it SETSTS
	xct t0
	movem reg1,filsta(reg)	;and save for others
	popj p,

getsts:	validate
	move t0,filchn(reg)	;close UUO
	tlo t0,(%getsts)		;make GETSTS
	hrri t0,1(p)		;place to put it
	xct t0
	popj p,

stbits:	validate
	move t0,filchn(reg)	;channel
	tlo t0,(%getsts)	;make getsts
	hrr t0,reg1		;place to put it
	xct t0
	popj p,

clreof:	validate
	move t0,filbad(reg)	;get good return
	trc t0,1
	movem t0,fileof(reg)	;set eof
	hrrzs filerr(reg)	;clear old errors
;removed setting of fileol
	popj p,

erstat:	validate
	hlrz t0,filerr(reg)	;get error status
	movem 1(p)		;return as function
	popj p,

erbits:	validate
	hlrz t0,filerr(reg)	;get error status
	movem t0,(reg1)		;give them to the user
	setzm 1(reg1)		;clear rest of his set
	popj p,

mtape:	validate
	move t0,filchn(reg)	;close UUO
	tlo t0,(%mtape)		;MTAPE
	hrr t0,reg1		;bits for MTAPE
	xct t0
	popj p,

to6:	setzm 1(p)	;from alfa to sixbit. result goes here
	move reg2,[point 6,1(p)] ;result
	move t0,[point 7,reg]	;source
	movei reg3,6		;count
to6l:	ildb t1,t0
	subi t1,40
	cail t1,100		;take care of lower case
	subi t1,40
	idpb t1,reg2
	sojg reg3,to6l
	popj p,

from6:	move t0,[ascii /     /]	;from sixbit to alfa
	movem t0,(reg1)		;result
	movem t0,1(reg1)
	move reg2,[point 7,(reg1)]	;result
	move t0,[point 6,reg]		;source
	movei reg3,6			;count
from6l:	ildb t1,t0
	addi t1,40
	idpb t1,reg2
	sojg reg3,from6l
	popj p,

CCLSW:	MOVE T1,%CCLSW##
	MOVEM T1,1(P)
	POPJ P,

RNFILE:	MOVE T1,%RNDEV##
	MOVEM T1,(REG)
	MOVE T1,%RNNAM##
	MOVEM T1,(REG1)
	MOVE T1,%RNPPN##
	MOVEM T1,(REG2)
	POPJ P,

lstrec:	validate
	move t0,filrcs(reg)
	movem t0,1(p)
	popj p,


	END