Google
 

Trailing-Edge - PDP-10 Archives - decuslib20-03 - decus/20-0078/libsim/ptyfil.mac
There is 1 other file named ptyfil.mac in the archive. Click here to see a list.
COMMENT * SIMULA specification;
OPTIONS(/E:CODE,ptyfil);
REF(Outfile) PROCEDURE ptyfil(ptyinf); REF(Infile)ptyinf;
COMMENT Provided PTYINF is an Infile on device PTY,
an Outfile will be opened on the same channel.
The result of PTYFIL is a reference to that Outfile object.
;

!*;! MACRO-10 code !*;!

	TITLE	ptyfil
	ENTRY	ptyfil
	SUBTTL	SIMULA utility, Lars Enderin Sept 1977

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


	sall
	search	simmac,simmcr,simrpa
	macinit

	;! Local definitions ;!

	result==2
	ptyinf==result+1

ptyfil:	PROC
	L	XWAC1,ptyinf(XCB)
	CAIN	XWAC1,NONE
	 BRANCH  CSEP
	LF	,ZFICHN(XWAC1)
	DEVTYP
	 BRANCH	 CSEP
	ANDI	TY.DEV
	CAIE	.TYPTY
	 BRANCH	 CSEP
;!NEW Outfile("PTYxxx:")
	XEC	CPNE
	 XWD	0,IOOU
	LI	XWAC2,2*5
	XEC	TXBL
	 XWD	1,[1B0]
	L	XWAC4,ptyinf(XCB)
	LF	XWAC5,ZFICHN(XWAC4)
	DEVNAM	XWAC5,
	 BRANCH  CSEP
	L	X1,[POINT 6,XWAC5]
	LI	X2,2(XWAC2)
	HRLI	X2,(POINT 7,)
	LOOP
		ILDB	X1
		ADDI	" "
		IDPB	X2
	AS
		CAIE	" "
		GOTO	TRUE
	SA
	LI	":"
	DPB	X2
	STD	XWAC2,OFFSET(ZFISPC)(XWAC1)
	XEC	CSEN
	L	XWAC2,ptyinf(XCB)
	HLLZ	OFFSET(ZFICHN)(XWAC1)
	TLO	(RELEASE)
	XCT
	LF	X1,ZFICHN(XWAC1)
	ADD	X1,.JBOPS
	SETZM	YIOCHT(X1)
	LF	X1,ZFICHN(XWAC2)
	ADD	X1,.JBOPS
	HRLM	XW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