Google
 

Trailing-Edge - PDP-10 Archives - bb-bt99g-bb - ipcser.c13
There are no other files named ipcser.c13 in the archive.
 REP 2/40	;13C1
		HLRE	P1,T1
		TRNE	P1,1		;MUST BE AN ODD NUMBER OF ARGUMENTS
 WIT
		HLRZ	P1,T1
 REP 15/40	;13C2
		HRRES	T1
		JUMPE	T1,QUEILF
		CAML	T1,[.GTQFC##-.GTQFT##]
		CAILE	T1,QUTBLN##
		JRST	QUEILF
		HRRZ	T1,.GTQFT##(T1)
		SKIPN	(T1)
 WIT
		HRRES	T1		;GET FUNCTION CODE
		JUMPE	T1,QUEILF	;ZERO IS ILLEGAL
		CAML	T1,[.GTQFT##-.GTQFC##] ;CUSTOMER FUNCTION?
		CAILE	T1,QUTBLN##	;DEC FUNCTION?
		JRST	QUEILF		;NO TO EITHER
		HRRZ	T1,.GTQFT##(T1)	;GET ADDRESS OF ASSOCIATED PID
		JUMPE	T1,QUEILF	;ILLEGAL FUNCTION IF NO MATCHING PID
		SKIPN	(T1)		;DOES IT EXIST?
 REP 47/40	;13C3
	;HERE TO SCAN THE ARGUMENT LIST MAKING SURE ITS IN CORE AND DETERMINING
	; THE NUMBER OF WORDS OF CORE NECESSARY FOR BUILDING THE GALAXY MESSAGE
		MOVEI	P2,-3(P1)
		LSH	P2,-1		;ARGUMENTS ARE WORD PAIRS
 WIT
	;HERE TO SCAN THE ARGUMENT LIST MAKING SURE ITS IN CORE AND DETERMINING
	; THE NUMBER OF WORDS OF CORE NECESSARY FOR BUILDING THE GALAXY MESSAGE
		MOVEI	P2,-3(P1)	;COUNT OF ARGUMENT WORDS
 DEL 54/40	;13C4
 REP 4/41	;13C5
		SKIPGE	T1		;IF IMMEDIATE,
		MOVEI	T2,1		;IMMEDIATE MESSAGES ARE TWO WORDS LONG
		ADDI	P3,1(T2)	;LENGTH OF THE DATA BLOCK + 1 FOR THE HEADER WORD
		JRST	GLXIN1
 WIT
		ADDI	P3,1(T2)	;LENGTH OF DATA BLOCK + 1 FOR HEADER WORD
		JRST	GLXIN1		;LOOP BACK
 INS 13/41	;13C6

 REP 31/41	;13C7
		MOVEI	T2,-3(P1)	;ARGUMENT COUNT
		LSH	T2,-1		;TWO WORDS PER ARGUMENT
		ADDI	T2,QUEIGL	;FOUR ARGUMENTS INTERNALLY GENERATED
		MOVEM	T2,QUEARC(T1)
 WIT
		MOVEI	T2,QUEIGL	;SET INITIAL ARGUMENT COUNT TO
		MOVEM	T2,QUEARC(T1)	; THE NUMBER OF INTERNAL BLOCKS GENERATED
 DEL 49/41	;13C8
 REP 8/42	;13C9
	;HERE TO COPY THE USERS ARGUMENT LIST TO THE GALAXY MESSAGE
	GLXIN3:	MOVEI	P2,-3(P1)	;NUMBER OF ARGUMENTS TO COPY
		LSH	P2,-1		;ARGUMENTS ARE WORD PAIRS
 WIT
	;HERE TO COPY THE USERS ARGUMENT LIST TO THE GALAXY MESSAGE
	GLXIN3:	MOVEI	P2,-3(P1)	;NUMBER OF ARGUMENT WORDS
 REP 16/42	;13C10
		LDB	T3,[POINT 9,T1,17] ;LENGTH OF THE DATA BLOCK
		SKIPGE	T1		;IMMEDIATE ARGUMENT?
		MOVEI	T3,1		;YES, LENGTH IS 1
		LDB	T4,[POINT 12,T1,35] ;FUNCTION
 WIT
		HLRZ	T3,P3		;GET MESSAGE ADDRESS
		AOS	QUEARC(T3)	;COUNT THE BLOCK ABOUT TO BE ADDED
		LDB	T3,[POINT 9,T1,17] ;LENGTH OF THE DATA BLOCK
		HRRZ	T4,T1		;FUNCTION
 REP 23/42	;13C11
		MOVE	T4,T2		;ASSUME AN IMMEDIATE ARGUMENT
		JUMPL	T1,GLXIN6	;GO IF IT IS
	GLXIN5:	EXCTUX	<MOVE T4,(T2)>	;GET DATA
		AOS	T2		;NEXT WORD OF DATA
	GLXIN6:	MOVEM	T4,(P1)		;STORE DATA IN THE MESSAGE
 WIT
	GLXIN5:	EXCTUX	<MOVE T4,(T2)>	;GET DATA
		MOVEM	T4,(P1)		;STORE DATA IN THE MESSAGE
		HRRI	T2,1(T2)	;ADVANCE ARGUMENT POINTER
 REP 7/44	;13C12
		PUSH	P,T1
		PUSHJ	P,GETWR1##
		  JRST	NXTAD2		;QUEADC, BUT POP T1 AND CALL OFF STACK FIRST.
	;IMMEDIATE?
		SKIPL	T2,(P)		;BIT ZERO ON INDICATES IMMEDIATE ARGUMENT
		JRST	NXTAR1		;NOPE - PRETEND WE HAVE @T1
		TDNE	T2,[377776,,770000]
		JRST	NXTIAL		;SPURIOUS BITS ON - QUEIAL
		MOVE	T2,T1		;ARGUMENT IS NOW IN T2
		JRST	TPOPJ1##	;RESOLVED
	NXTAR1:	TDNN	T2,[777000,,770000]
		TLNE	T1,(17777B12)	;ALLOW ONLY @(17)777777
		JRST	NXTIAL		;SPURIOUS BITS ARE ON, QUEIAL
		HLRZS	T2		;NUMBER OF WORDS OF ARGUMENT IS IN LEFT HALF
		CAIGE	T2,1
		JRST	NXTIAL		;LESS THAN ONE WORD OF ARGUMENT, QUEIAL
 WIT
		TLNN	T1,777		;WORD COUNT SPECIFIED?
		TLO	T1,1		;NO--DEFAULT TO ONE
		HLRZ	T2,T1		;NUMBER OF WORDS OF ARGUMENT IS IN LEFT HALF
		ANDI	T2,777		;STRIP OFF ANY FLAGS THERE MIGHT BE
		TLNN	T1,377000	;ANY ILLEGAL BITS TURNED ON?
		CAIGE	T2,1		;REASONABLE LENGTH?
		JRST	NXTIAL		;ILLEGAL ARGUMENT
		PUSH	P,T1		;SAVE ON STACK
		JUMPGE	T1,NXTAR1	;GO FETCH IF NOT IMMEDIATE
		HRRI	M,1(M)		;ADVANCE ARGUMENT POINTER
		MOVE	T1,M		;ADDRESS OF SUB-BLOCK
		PUSH	P,M		;BALANCE STACK
		JRST	NXTAR2		;RE-JOIN COMMON CODE
	NXTAR1:	PUSHJ	P,GETWR1##
		  JRST	NXTAD2		;QUEADC, BUT POP T1 AND CALL OFF STACK FIRST.
		TLNE	T1,(17777B12)	;ALLOW ONLY @(17)777777
		JRST	NXTIA2		;SPURIOUS BITS ARE ON, QUEIAL
		HLRZ	T2,(P)		;GET LENGTH OF THIS SUB-BLOCK
 REP 27/44	;13C13
		PUSH	P,T1		;SAVE ADDRESS OF THE DATA BLOCK
		HRRZS	T1,(P)		;ADDRESS OF DATA BLOCK, CLEAR LEFT HALF BITS
		HLL	T1,-2(P)	;WHERE CHKIC WANTS LENGTH
		PUSHJ	P,CHKIC
		POP	P,T2		;ADDRESS OF THE DATA BLOCK
		POP	P,M		;RESTORE POINTER TO THE ARGUMENT LIST
 WIT
	NXTAR2:	PUSH	P,T1		;SAVE ADDRESS OF THE DATA BLOCK
		HRRZS	T1,(P)		;ADDRESS OF DATA BLOCK, CLEAR LEFT HALF BITS
		HLL	T1,-2(P)	;WHERE CHKIC WANTS LENGTH
		TLZ	T1,400000	;IGNORE IMMEDIATE-MODE BIT
		PUSHJ	P,CHKIC
		POP	P,M		;RESTORE BLOCK ADDRESS
		EXCH	M,(P)		;SAVE AND RESTORE M
		HLRZ	T2,-1(P)	;GET SUB-BLOCK LENGTH PLUS FLAG
		TRZN	T2,400000	;IMMEDIATE MODE?
		MOVEI	T2,1		;NO, ONLY ONE WORD USED BY POINTER
		SUBI	P2,(T2)		;ACCOUNT FOR ARGS IN UUO BLOCK
		JUMPL	P2,NXTIA2	;ILLEGAL ARG LIST IF COUNTS DON'T MATCH
		ADD	T2,M		;POINT PAST CURRENT ARGUMENT
		HRRI	M,-1(T2)	;OFFSET FOR GETWR1
		POP	P,T2		;ADDRESS OF THE DATA BLOCK
 REP 1/45	;13C14
	NXTIAL:	POP P,(P)		;POP T1,
		POP P,(P)		; AND CALL TO NXTARG
 WIT
	NXTIA2:	POP P,(P)		;POP T1,
	NXTIAL:	POP P,(P)		; AND CALL TO NXTARG
 SUM 233124