Google
 

Trailing-Edge - PDP-10 Archives - BB-H348C-RM_1982 - swskit-v21/debugging-tools/dts/dtscon.mac
There are no other files named dtscon.mac in the archive.


;THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY ONLY BE USED
;  OR COPIED IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE.
;
;COPYRIGHT (C) 1978 BY DIGITAL EQUIPMENT CORPORATION
;
	TITLE DTSCON - DTS CONNECT TEST EXECUTION MODULE

	SEARCH DTSUNV,MACSYM,MONSYM
	SALL
	LIST

	ENTRY DTSCON

	PRINT==200

	PAGE
	SUBTTL DTSCON - DTS CONNECT TEST 

;+
;DTSCON - THIS ROUTINE PERFORMS THE DTS CONNECT TEST TO A DTR SERVER ON
; ANOTHER NODE IN THE NETWORK. THE ROUTINE IS CALLED BY THE DTS DRIVER
; AFTER THE CONNECT INTERRUPT HAS OCCURED AND THE LINK HAS A ZERO
; REASON CODE. THE CONNECT INTERRUPT COULD HAVE BEEN THE RESULT OF THE
; MONITOR RECEIVING EITHER AN NSP CONNECT CONFIRM OR DISCONNECT INITIATE.
;
;ACCEPTS:	T1/ ADDRESS OF ARGUMENT BLOCK
;		LCBPTR/ ADDRESS OF LCB
;
;	ARGUMENT BLOCK/ (.DTTIM) ELAPSED TIME TO RUN TEST
;			(.DTBUF) NUMBER OF SEND BUFFERS TO USE
;			(.DTBAU) BAUD RATE
;			(.DTNOD) POINTER TO NODE NAME
;			(.DTCNT) OPTIONAL DATA BYTE COUNT
;			(.DTTYP) TEST TYPE + PRINT OPTION
;			(.DTSUB) TEST SUBTYPE
;				 USER DATA
;
;CALLED BY: CALL DTSCON
;
;RETURNS+1: SUCCESS
;	+2: FAILURE
;-



DTSCON:				;ENTRY ON CONNECT INTERRUPT
	TRVAR <ARGPTR>		;MAKE A STACK VARIABLE TO SAVE ARGUMENT
	MOVEM T1,ARGPTR		;SAVE ADDRESS OF ARGUMENT BLOCK
	CALL DTSPRT		;PRINT MESSAGE
	SETZM COFAIL		;CLEAR FAIL FLAG

;READ CURRENT LINK STATUS AND OPTIONAL DATA

	CALL RDALNK		;READ OPTIONAL DATA RETURNED
	RETBAD ERXLNK
	MOVE T1,ARGPTR		;GET POINTER TO ARGUMENT BLOCK
	MOVE T2,.DTSUB(T1)	;GET CONTYPE
	IDIVI T2,2		;GET ACCEPT/REJECT IN T3
				;AND NODATA/STDATA/USDATA IN T2
	LOAD T1,LCBSTS		;GET LINK STATUS

;DISPATCH BASED ON CONTYPE, FIRST CHECK FOR ACCEPT/REJECT

	CALL @CONTB1(T3)
	SETOM COFAIL		;FAILED IF RETURNS HERE

CONIN2:				;HERE TO CHECK RETURNED OPTIONAL DATA
	MOVE T1,ARGPTR		;GET POINTER TO ARGUMENT BLOCK
	MOVE T2,.DTSUB(T1)	;GET CONTYPE
	IDIVI T2,2		;GET ACCEPT/REJECT IN T3
				;AND NODATA/STDATA/USDATA IN T2
	LOAD T1,LCBROC		;GET NUMBER OF BYTES READ

;DISPATCH BASED ON CONTYPE DATA TEST NODATA=0, STDATA=1, USDATA=2

	CALL @CONTB2(T2)	;GO VERIFY RETURNED OPT DATA
	SETOM COFAIL		;FAILED IF RETURNS HERE

;ABORT AND CLOSE THE LINK

	SETONE LCBABT
	CALL CLZLNK		;ABORT THE LINK AND GET RID OF JFN
	PRTERR <COULDN'T CLOSE LINK JFN>,,<$RET>
	SKIPE COFAIL		;CONNECT TEST FAILED ?
	RET			;YES
	RETSKP			;NO

CONTB2:				;CONNECT DATA TYPE DISPATCH TABLE
	CONNOD
	CONSTD
	CONUSD

CONTB1:				;ACCEPT/REJECT DISPATCH TABLE
	CONREJ
	CONACC

	PAGE
	SUBTTL CONREJ - CONNECT REJECT TEST

CONREJ:				;CHECK FOR REJECT

;WE CAN GET AN ABORT FOR REASONS OTHER THAN THE RESULT OF THE TEST
; BY DTR, SO MUST TRY TO ENSURE WE ANALYZE THE RESULTS PROPERLY.
; DTR IS SUPPOSED TO RETURN A REASON CODE OF ZERO ON A REJECT.
; IF WE GET A NON-ZERO REASON CODE ON AN ABORT WE ASSUME THIS IS
; THE RESULT OF SOME CAUSE OTHER THAN ACTION BY DTR, I.E., DTR
; IS NOT RUNNING OR THE PHYSICAL LINK IS NOT AVAILABLE.
; NOTE ALSO THAT THE DTR/DTS SPEC SAYS DTR WILL REJECT A CONNECTION
; WITH A ZERO REASON CODE FOR ANY TEST THAT IT DOES NOT SUPPORT
; SO THIS IMPLIES ALL DTR'S MUST IMPLEMENT A REJECT TEST.

	TXNE T1,^-<MO%ABT>	;ANYTHING STATUS OTHER THAN ABORT ?
	PRTERR <INVALID LINK STATUS>,,<$RET> ;YES, IT'S ERROR
	TXNN T1,MO%ABT		;ABORTED ?
	PRTERR <NOT ABORTED>,,<$RET> ;NO, ERROR...

	RETSKP			;OK, RETURN GOOD

	PAGE
	SUBTTL CONACC - CONNECT ACCEPT TEST

CONACC:				;HERE TO CHECK FOR LINK ACCEPTED
	TXNE T1,^-<MO%CON!MO%LWC> ;ANYTHING STATUS OTHER THAN CONNECT ?
	PRTERR <INVALID LINK STATUS>,,<$RET> ;YES, IT'S ERROR
	TXNE T1,MO%LWC		;WAS IT ACCEPTED ?
	TXNN T1,MO%CON		;CONNECTED NOW ?
	PRTERR <NOT ACCEPTED OR CONNECTED>,,<$RET> ;NO...

	RETSKP			;OK, RETURN GOOD

	PAGE
	SUBTTL OPTIONAL DATA VERIFICATION ROUTINES

CONNOD:				;CONNECT WITH NO DATA RETURNED
	CAIE T1,0		;RECEIVED OPTIONAL DATA BYTE COUNT MUST BE ZERO
	PRTERR <NODATA FAILED>,,<$RET>
	RETSKP			;OK, RETURN GOOD

CONSTD:				;CONNECT WITH STANDARD DATA RETURNED
	CAIE T1,^D16		;MUST GET 16 BYTES
	PRTERR <INVALID OPTIONAL DATA LENGTH RECEIVED>,,<$RET>
	MOVE T3,T1		;GET COUNT IN T3
	LOAD T1,LCBOPT		;GET POINTER TO OPTIONAL DATA
	MOVE T2,STDPAT		;AND POINTER TO STANDARD DATA
	CALL STRCMP		;COMPARE THE STRINGS
	PRTERR <INVALID OPTIONAL DATA RECEIVED>,,<$RET>
	RETSKP			;OK, RETURN GOOD

CONUSD:				;CONNECT WITH USER DATA RETURNED
	MOVE T2,ARGPTR		;GET POINTER TO ARGUMENT BLOCK
	CAME T1,.DTCNT(T2)	;SAME # BYTES WE SENT ?
	PRTERR <INVALID OPTIONAL DATA LENGTH RECEIVED>,,<$RET>
	MOVEI T1,.DTTYP(T2)	;GET ADDRESS OF WHAT WE SENT
	HRLI T1,(POINT 36,0)	;MAKE IT A 36 BIT BYTE POINTER
	MOVE T3,.DTCNT(T2)	;GET COUNT OF BYTES
	LOAD T2,LCBOPT		;GET POINTER TO OPTIONAL DATA RECEIVED
	CALL STRCMP		;COMPARE THE TWO STRINGS
	PRTERR <INVALID OPTIONAL DATA RETURNED>,,<$RET>
	RETSKP			;OK, RETURN GOOD


	PAGE
	SUBTTL STRCMP - STRING COMPARISON ROUTINE
;
;STRCMP - STRING COMPARE FOR ANY BYTE SIZE STRING, STRICTLY EQUAL COMPARE
;	  NO UPPER/LOWER CASE STUFF
;
;ACCEPTS: T1/ BYTE POINTER TO STRING 
;	  T2/ BYTE POINTER TO STING TO COMPARE WITH
;	  T3/ LENGTH TO COMPARE
;
;	CALL  STRCMP
;
;RETURNS+1: STRINGS UNEQUAL, T1,T2/ UPDATED
;	+2: STRINGS EQUAL
STRCMP:				;ENTRY
	STKVAR <STRPT1,STRPT2> ;VARIABLES
	MOVEM  T1,STRPT1	;SAVE POINTER TO FIRST STRING
	MOVEM  T2,STRPT2	;AND SECOND ALSO
STRCM1:				;LOOP THRU HERE FOR EACH BYTE OF STRINGS
	ILDB   T1,STRPT1	;GET BYTE FROM FIRST STRING
	ILDB   T2,STRPT2	;AND BYTE FROM SECOND
	CAME   T1,T2		;COMPARE THEM
	RET			;NOT EQUAL, RETURN +1
	SOJG   T3,STRCM1	;EQUAL, LOOP FOR NEXT BYTE
	MOVE   T1,STRPT1	;RESTORE UPDATED POINTERS
	MOVE   T2,STRPT2
	RETSKP			;DONE, RETURN

	PAGE
	SUBTTL LITERAL POOL AND CONSTANTS

	XLIST
LTPOOL:	LIT			;BEGINNING OF LITERAL POOL
	LIST

COFAIL:	BLOCK 1			;FLAG TO INDICATE TEST FAILED


STDPAT:				;STANDARD DATA PATTERN FOR DTR
STDINT:	POINT 8,.+1		;POINTER TO STANDARD INTERRUPT MESSAGE
	BYTE (8)"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P"
	BYTE (8)"Q","R","S","T","U","V","W","X","Y","Z","0","1","2","3","4","5"
	BYTE (8)"6","7","8","9"

	PAGE
	SUBTTL VARIABLE DATA STORAGE

;	RELOC   <<.+140>/1000+1>*1000-140	;ORG AT NEXT HIGHER PAGE BOUNDARY
	VAR


	END