Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-04 - 43,50346/comprm.mac
There is 1 other file named comprm.mac in the archive. Click here to see a list.

;***	THIS ROUTINE ASSEMBLED WITH PARAMETER FILE COMPRM.MAC    ***


	IF2,<IFNDEF P..LST,<TAPE>>	;DON'T LIST PARAMETER FILE

					;LIST PARAMETER FILE ONLY IF
					;P..LST IS DEFINED. NOT NORMALLY
					;DONE.


;	COMPRM - PARAMETER FILE FOR ASYNCHRONOUS INTERPROCESSOR COMMUNICATIONS ROUTINES

;	R. PALM			SYRACUSE, N.Y. JUNE-74

;*** COPYRIGHT 1974 DIGITAL EQUIPMENT CORP. MAYNARD, MASS. ***



;	THIS MODULE CONTAINS PARAMETER DEFINITIONS WHICH ARE COMMON
;	TO BOTH OF THE ROUTINES FOR INTERPROCESSOR COMMUNICATIONS
;	OVER AN ASYCHRONOUS LINE.  IT SHOULD BE ASSEMBLED AS A PARAMETER
;	FILE WITH EACH OF THOSE ROUTINES.



;	DEFINE REGISTER ASSIGNMENTS

	CHR=	1		;KEEPS CURRENT CHARACTER IN PROCOL
				;REGISTER ASSIGNMENT MUST AGREE WITH
				; REGISTER C IN CHANEL
	C=	1		;KEEPS CURRENT CHARACTER IN CHANEL
	CRC=	2		;KEEPS CYCLIC REDUNDANCY CHECK
	T1=	CRC+1		;TEMP  MUST BE CRC+1 FOR PROCOL
	T2=	T1+1		;TEMP
	CNT=	5		;CHARACTER COUNT AC
	TIME=	6		;KEEPS DAYTIME
	L=	16		;LINK REGISTER
				;  PUSHJ ARGUMENT LIST POINTER
				;  F40 JSA AC
	P=	17		;PUSH DOWN POINTER

IFN CHR-C,<PRINTX 
	PRINTX ?VALUES OF C AND CHR DO NOT AGREE, CHECK COMPRM.MAC>

;	DEFINE NUMBER OF TEMPORARY REGISTERS TO BE SAVED

	HICHNL=	4		;HIGHEST TEMP AC TO SAVE IN CHANEL.MAC
	HIPRCL=	6		;HIGHEST TEMP AC TO SAVE IN PROCOL.MAC
	HIAC=	HICHNL		;ASSUME HICHNL > HIPRCL.
IFG HIPRCL-HICHNL,<HIAC=HIPRCL>	;DEFINE HIGHEST TEMP AC TO SAVE OVERALL



;	DEFINE CONSTANTS

	TP%BYT=	15		;COBOL,FORTRAN-10 ARG. IS BYTE POINTER

	MSLMAX=	^D80		;MAXIMUM LENGTH OF MESSAGE
	TXLMAX=	^D72		;MAXIMUM LENGTH OF TEXT
;	DEFINE MACROS


DEFINE ENTR (AA)
<	SALL
	IFDIF <AA> <.>,<
	IFNDEF CHANEL,<IFNDEF A.....,<
	LALL

	EXTERN	EXIT%%,SAVEL,ACSAV,JSAFLG
	SALL
A.....=0>>
	LALL

	ENTRY	AA'F,AA'C,AA
AA'F:				;FORTRAN CALL. FOR COMPATIBILITY ONLY
AA'C:				;COBOL CALL. FOR COMPATIBILITY ONLY
AA:	JFCL			;PUSHJ (F10,COBOL) ENTRY POINT
	SETZM	JSAFLG		;JSA (F40) ENTRY POINT
				;ASSUME PUSHJ ENTRY
	TLNE	L,-1		;WAS IT REALLY A PUSHJ ENTRY?
	SETOM	JSAFLG		;NO. FLAG AS A JSA ENTRY
	MOVEM	L,SAVEL		;SAVE ARG LIST POINTER
	SALL
	>

	IFIDN <AA> <.>,<
	LALL

	INTERN	EXIT%%,SAVEL,ACSAV,JSAFLG

;	EXIT ROUTINE
;	ALL ENTRY POINTS WHICH USE THE ABOVE CODE SHOULD EXIT
;	WITH   JRST EXIT%%

EXIT%%:	SKIPN	JSAFLG		;CALLED BY JSA ?
	JRST	XIT%%		;NO. CALLED BY A PUSHJ
	MOVEM	L,JSAFLG	;SAVE RETURN ADDRESS TEMPORARILY
	MOVSS	L		;ADDRESS OF ENTRY POINT IN RH
	PUSH	P,(L)		;GET VALUE OF L WE WANT RESTORED
	POP	P,SAVEL		;PUT IT IN THE CORRECT PLACE
	HRLI	L,(<JFCL>)	;ENTRY INSTR. TO BE RESTORED
	HLLZM	L,(L)		;RESTORE THE INSTR. FOR FUTURE PUSHJ
	SKIPA	L,JSAFLG	;RESTORE L AND SKIP
XIT%%:	POP	P,L		;RH OF L IS RETURN ADDRESS
	HRLI	L,SAVEL		;LH OF L IS WHERE TO RESTORE L FROM
	JRA	L,(L)		;RESTORE L AND RETURN TO CALLER

;	ENTRY/EXIT STORAGE AREAS

SAVEL:	BLOCK	1		;SAVE THE ARGUMENT LIST POINTER
ACSAV:	BLOCK	HIAC+1		;AREA TO SAVE TEMP REGISTERS
JSAFLG:	BLOCK	1		;ENTRY TYPE FLAG
				;-1  CALLED BY JSA
				; 0  CALLED BY PUSHJ
	SALL>
	XALL>			;END OF ENTR MACRO



DEFINE	SAVE(N)			;AC SAVE MACRO
<	MOVEM	N,ACSAV+N	;SAVE AC N
	HRRZI	N,ACSAV		;SET UP BLT WORD
	BLT	N,ACSAV+N-1	;SAVE OTHER ACS
>				; 



DEFINE	RESTOR(N)		;RESTORE AC MACRO
<	HRLZI	N,ACSAV		;SET UP BLT WORD
	BLT	N,N		;RESTORE ACS
>				; 


;	THE ARGUMENT REGISTER CONTAINS THE ADDRESS OF A SUBROUTINE
;	ARGUMENT.  IF THAT ARGUMENT IS A BYTE POINTER REFERENCE
;	TO THE REAL ARGUMENT (COBOL, FORTRAN-10 TYPE CODE 15), FIXUP
;	THE ADDRESS IN THE REGISTER TO POINT TO THE REAL ARGUMENT.


DEFINE ARYREF(AA)
<	SKIPE	JSAFLG		;CALLED BY PUSHJ ?
	JRST	.+4		;NO. WE ARE OK
	LDB	0,[POINT 4,(L),12] ;GET ARG TYPE CODE
	CAIN	0,TP%BYT	;IS IT A BYTE POINTER ?
	HRRI	AA,@(AA)	;YES. GET ADDRESS FROM IT
>				;WATCH THOSE NASTY INDIRECT REFERENCES



;	DEFINE THE ENTRIES IN THE COMMUNICATIONS ROUTINE'S PERFORMANCE
;	STATISTICS TABLE.  THE SYMBOLS ARE DEFINED AS AN OFFSET INTO
;	THE TABLE (STATBL DEFINED IN PROCOL.MAC).  EACH ENTRY IN
;	THE TABLE IS ONE WORD.


DEFINE	STATOF (AA)
<	IFNDEF S...,<
	S...=	-1 >		;;INITIAL OFFSET (TO BE INCREMENTED)

	S...=	S...+1		;;INCREMENT THE TABLE OFFSET
	AA=	S...		;;DEFINE THE SYMBOLIC OFFSET
>



	STATOF	(NACKS)		;THE NUMBER OF DATA MESSAGES POSITIVELY
				;REACKNOWLEDGED AND IGNORED BY THE SEND
				;ROUTINE WHILE IT WAS WAITING FOR AN
				;ACKNOWLEDGEMENT MESSAGE.
	STATOF	(NIGNS)		;THE NUMBER OF DATA MESSAGES COMPLETELY
				;IGNORED BY THE SEND ROUTINE WHILE IT
				;WAS WAITING FOR AN ACKNOWLEDGEMENT
				;MESSAGE.
	STATOF	(NACKR)		;THE NUMBER OF DATA MESSAGES
				;REACKNOWLEDGED AND IGNORED BY THE
				;RECEIVE (RECV) ROUTINE.
	STATOF	(NRESET)	;THE NUMBER OF TIMES THE INTERNAL
				;MESSAGE NUMBER HAS BEEN REINITIALIZED
				;BY THE RECEIVE (RECV) ROUTINE.
	STATOF	(UEXPAK)	;THE NUMBER OF UNEXPECTED ACKNOWLEDGE-
				;MENT MESSAGES (EITHER ACK OR NAK)
				;RECEIVED BY THE RECEIVE (RECV) ROUTINE
				;WHILE IT WAS WAITING FOR A DATA MESSAGE.

;	INSERT NEW ENTRIES HERE

STATLN=	S...+1			;DEFINE THE LENGTH OF THE STATISTICS TABLE.
;	ASSEMBLY CONDITIONS


;IF CC (3RD HEADER WORD IN A MESSAGE) IS TO BE SETUP AND
;CHECKED FOR ODD PARITY, ASSEMBLE WITH FTODCC==1

IFNDEF	FTODCC,<FTODCC==0>	;NO PARITY CHECK ON CC


IFNDEF FTDIAL,<FTDIAL==0>	;SET NON-ZERO IF THESE ROUTINES ARE
				;REQUIRED TO DIAL A NUMBER ON THE
				;COMMUNICATIONS CHANNEL
IFNDEF FTPAGE,<FTPAGE==0>	;IF NON-ZERO SET LINE ATTRIBUTES
				;TO RECOGNIZE X-ON AND X-OFF.
				;NOT REQUIRED FOR IMAGE MODE LINES.
IFNDEF FTVERSION,<FTVERSION==0>	;SET NONZERO IF THE VERSION
				;NUMBER OF THE COMMUNICATIONS ROUTINES
				;IS TO BECOME THE VERSION NUMBER OF THE
				;COMMUNICATION PROGRAM.
IFNDEF FTMRCV,<FTMRCV==0>	;SET NONZERO IF RECEIVE ROUTINE IS TO
				;COLLECT MULTIPLE MESSAGES TO SATISFY
				;THE CHARACTER COUNT FOR A SINGLE
				;REQUEST. OTHERWISE THE RECEIVE ROUTINE
				;RETURNS TO THE CALLER (WITH A CHARACTER
				;COUNT) AFTER RECEIVING ONE MESSAGE.
IFNDEF FTCIBS,<FTCIBS==0>	;CLEAR INPUT BEFORE SEND.
				;IF SET NON-ZERO, THE INPUT BUFFER WILL
				;BE CLEARED BEFORE A MESSAGE IS SENT.
				;DEFAULT IS TO NOT CLEAR THE INPUT BEFORE				;SENDING A MESSAGE BECAUSE THE DEC-10 HAS
				;HIGH PRIORITY FOR RECEIVING AND LOW
				;PRIORITY FOR SENDING.
IFNDEF FTSNOI,<FTSNOI==-1>	;SEND NAK ON INITIALIZATION.
				;IF SET NON-ZERO, A NAK MESSAGE WITH A
				;MESSAGE NUMBER OF ZERO IS SENT AS PART
				;OF INITIALIZATION.
				;THE DEFAULT IS TO SEND THE MESSAGE.
IFNDEF FTDEBUG,<FTDEBUG==0>	;SET NON-ZERO TO WRITE DEBUGGING TRACE
				;INTO "DEBUG.FIL".  THIS INCLUDES
				;EACH CHARACTER READ AND SENT.


IFE FTDEBUG,<			;DEFINE NULL MACRO IF SWITCH IS 0
DEFINE DEBUG(A)
<>>

IFN FTDEBUG,<			;DEFINE MACRO FOR WHEN SWITCH IS ON
DEFINE DEBUG(A)
<IFNDEF CHANEL,<EXTERNAL	DEBPNT>
	PUSH	P,0		;SAVE AC 0
	MOVSI	111111		;SET UP LEFT HALF WORD
	HRRI	A		;SET UP DEBUG NUMBER
	PUSHJ	P,DEBPNT	;WRITE OUT DEBUG ENTRY POINT
	POP	P,0		;RESTORE 0
>>				;END OF DEFINE






	ASUPPRESS		;REMOVE UNREFERENCED SYMBOLS FROM LISTINGS

IFDEF P..LST,<	END>		;GET CLEAN LISTING