Google
 

Trailing-Edge - PDP-10 Archives - BB-H348C-RM_1982 - swskit-v21/debugging-tools/dts/dtsprt.mac
There are no other files named dtsprt.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 DTSPRT - PRINT OUT DTS TEST CONTROL BLOCK OPTIONS

	SUBTTL SYMBOL DEFINITIONS AND MACROS

	SEARCH DTSUNV,MACSYM,MONSYM
	SALL

	ENTRY DTSPRT		;EXTERNAL ENTRY POINT
	ENTRY PRNUMV

	PAGE
	SUBTTL DTSPRT - MAIN ENTRY POINT AND ROUTINE

;THIS ROUTINE ACTS AS A COROUTINE TO EACH OF THE TEST ROUTINES WHICH
; CALL IT. IT PRINTS THE STARTING AND ENDING MESSAGES FOR EACH OF THE
; TESTS AS WELL AS THE PARTICULAR TEST OPTIONS. EACH TEST ROUTINE MUST
; CALL THIS ROUTINE AT ENTRY, AND RETURN +1 TO INDICATE TEST FAILURE, AND
; +2 TO INDICATE TEST SUCCESS. THIS ROUTINE ALSO RANGE AND ARGUMENT CHECKS
; THE ARGUMENT BLOCK AND WILL CAUSE A RETURN FROM THE TEST ROUTINE IF
; ARGUMENTS ARE IMPROPER.
;
;ACCEPTS: T1/ ARGUMENT BLOCK ADDRESS
;
;	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
;			(.DTFCO) FLOW CONTROL OPTION
;			(.DTFCV) FLOW CONTROL VALUE
;			(.DTNAK) NAK VALUE
;			(.DTBPV) BACK-PRESSURE VALUE
;			(.DTMSG) MESSAGE LENGTH BYTE # 0
;				 MESSAGE LENGTH BYTE # 1
;				 USER DATA
;
;
;	CALL DTSPRT
;
;RETURNS+1: ALWAYS
;

DTSPRT:				;MAIN ENTRY POINT

;MAKE THIS A COROUTINE

	PUSH P,T1		;SAVE SOME AC'S
	CALL DTSPR1		;CALL THE WORK ROUTINE
	JRST NOTEST		;DON'T LET TEST RUN
	EXCH T1,-1(P)		;SWAP CALLERS ADDRESS AND COROUTINE RETURN 
	EXCH T1,(P)		;RESTORE T1 AND SWAP WITH CALLERS ADDRESS
	POP P,(P)		;POP STACK POINTER
	JRST @1(P)		;GO BACK TO CALLER

NOTEST:				;HERE TO CAUSE RETURN FROM TEST ROUTINE
	POP P,T1		;RESTORE T1
	POP P,(P)		;POP RETURN OF CALLER
	SETONE LCBABT		;ABORT LINK
	SETZRO LCBRJF		;RELEASE JFN ON CLOSE
	CALL CLZLNK		;GO DO ABORT CLOSE
	RETBAD ERXLNK		;IF FAILED....
	RET			;RETURN ON CALLERS BEHALF

	PAGE
	SUBTTL DTSPRT - MAIN ENTRY POINT AND ROUTINE

;THIS IS THE CODE TO DO ALL THE WORK

DTSPR1:				;ENTRY FOR THE WORK ROUTINE
	SAVEAC <P1,P2>		;SAVE AC'S
	TRVAR <ARGPTR>		;TEMP FOR ARGUMENT POINTER
	MOVEM T1,ARGPTR		;SAVE OUR ARG ADDRESS
	LDB T2,[POINT 7,.DTTYP(T1),35] ;GET TEST TYPE
	CAIL T2,0		;RANGE CHECK TEST TYPE
	CAILE T2,3		;0 TO 3 ALLOWED
	PRTERR <INVALID TEST TYPE>,,<$RET>
	CALL @TSTTYP(T2)	;DISPATCH TO TEST SPECIFIC ROUTINE
	RET			;PROPOGATE +1 RETURN
	RETSKP			;LET TEST RUN

TSTTYP:				;TEST TYPE TABLE
	PRCONN			;CONNECT TEST
	PRDATA			;DATA TEST
	PRDISC			;DISCONNECT TEST
	PRINTR			;INTERRUPT TEST

	PAGE
	SUBTTL PRCONN - PRINT CONTENTS OF TCB FOR CONNECT TEST

;CONNECT TEST ROUTINE

PRCONN:				;ENTRY POINT
	PRTINF <CONNECT TEST STARTING>
	CALL PRNODE		;GO PRINT NODE NAME WE'RE TESTING WITH
	MOVE T1,ARGPTR		;RESTORE ARG PTR
	MOVE P1,.DTSUB(T1)	;GET CONNTYP
	CAIL P1,0		;RANGE CHECK CONTYPE
	CAILE P1,5		;0 TO 6 VALID
	PRTERR <CONTYPE INVALID>,,<$RET>
	IDIVI P1,2		;SEPARATE TEST TYPE AND DATA TYPE
	CALL @CONTYP(P2)	;PRINT CONNECT TYPE
	CALL @OPTTYP(P1)	;PRINT OPTIONAL DATA TYPE
	JSP T1,[RETSKP]		;TRAIL RETURN ADDRESS AND RUN TEST
	PRTERR <CONNECT TEST FAILED>,,<$RET>
	PRTINF <CONNECT TEST COMPLETE>
	RET

CONTYP:				;CONNECT TEST TYPE TABLE
	PRCORJ
	PRCOAC

OPTTYP:				;OPT DATA TYPE TABLE
	PROPNO
	PROPST
	PROPUS

PRCOAC:				;HERE TO PRINT CONNECT ACCEPT TEST
	PRTINF <ACCEPT TEST>
	RET

PRCORJ:
	PRTINF <REJECT TEST>
	RET

PROPNO:
	PRTINF <NO OPTIONAL DATA>
	RET

PROPST:
	PRTINF <STANDARD OPTIONAL DATA>
	RET

PROPUS:
	PRTINF <USER OPTIONAL DATA>
	RET

	PAGE
	SUBTTL PRDATA - PRINT CONTENTS OF TCB FOR DATA TEST

;DATA TEST ROUTINE

PRDATA:				;ENTRY POINT
	PRTINF <DATA TEST STARTING>
	MOVE T1,ARGPTR
	MOVE T1,.DTBUF(T1)	;GET BUFFER VALUE
	CAIE T1,1		;RANGE CHECK, ONLY BUFS=1 SUPPORTED
	PRTERR <UNSUPPORTED BUFFER VALUE SPECIFIED>,,<$RET>
	CALL PRNODE		;GO PRINT NODE NAME WE'RE TESTING WITH
	CALL PRDATY		;GO PRINT DATA TEST TYPE
	CALL PRTIMT		;GO PRINT ELAPSED TEST TIME
	MOVE T1,ARGPTR
	MOVE T1,.DTFCO(T1)	;GET FLOW CONTROL OPTION
	CAIL T1,0
	CAILE T1,2
	PRTERR <INVALID FLOW CONTROL OPTION>,,<$RET>
	CALL @FCOTAB(T1)	;GO PRINT IT
	MOVE T1,ARGPTR
	MOVE T2,.DTFCV(T1)	;GET FLOW CONTROL VALUE
	CAIL T2,1		;RANGE CHECK IT
	CAILE T2,^D255		;1 TO 255 VALID
	PRTERR <FLOW CONTROL VALUE INVALID>,,<$RET>
	PRTINF <FLOW CONTROL VALUE - >
	MOVE T1,ARGPTR
	MOVE T2,.DTFCV(T1)	;GET FLOW CONTROL VALUE
	CALL PRNUMV		;PRINT VALUE
	MOVE T1,ARGPTR
	MOVE T2,.DTNAK(T1)	;GET NAK CONTROL VALUE
	CAIL T2,0		;RANGE CHECK IT
	CAILE T2,^D128		;0 TO 128 VALID
	PRTERR <NAK CONTROL VALUE INVALID>,,<$RET>
	PRTINF <NAK CONTROL VALUE - >
	MOVE T1,ARGPTR
	MOVE T2,.DTNAK(T1)	;GET NAK CONTROL VALUE
	CALL PRNUMV		;PRINT VALUE
	MOVE T1,ARGPTR
	MOVE T2,.DTBPV(T1)	;GET BACKPRESSURE CONTROL VALUE
	CAIL T2,0		;RANGE CHECK IT
	CAILE T2,^D128		;0 TO 128 VALID
	PRTERR <BACKPRESSURE CONTROL VALUE INVALID>,,<$RET>
	PRTINF <BACKPRESSURE CONTROL VALUE - >
	MOVE T1,ARGPTR
	MOVE T2,.DTBPV(T1)	;GET BACKPRESSURE CONTROL VALUE
	CALL PRNUMV		;PRINT VALUE
	PRTINF <MESSAGE LENGTH - >
	MOVE T2,P1		;RESTORE MESSAGE LENGTH
	CALL PRNUMV		;PRINT VALUE
;	CALL PRMSGL		;GO PRINT MESSAGE LENGTH
	PRTINF <BAUD RATE OF LINE - >
	MOVE T1,ARGPTR
	MOVE T2,.DTBAU(T1)	;GET BAUD RATE
	CALL PRNUMV		;PRINT VALUE
	JSP T1,[RETSKP]		;TRAIL RETURN ADDRESS AND RUN TEST
	PRTERR <DATA TEST FAILED>,,<$RET>
	PRTINF <DATA TEST COMPLETE>
	RET

FCOTAB:
	PRNOFL
	PRSGFL
	PRMSFL

PRNOFL:
	PRTINF <NO FLOW CONTROL>
	RET
PRSGFL:
	PRTINF <SEGMENT FLOW CONTROL>
	RET
PRMSFL:
	PRTINF <MESSAGE FLOW CONTROL>
	RET

	PAGE
	SUBTTL PRDISC - PRINT CONTENTS OF TCB FOR DISCONNECT TEST

;DISCONNECT TEST ROUTINE

PRDISC:				;ENTRY POINT
	PRTINF <DISCONNECT TEST STARTING>
	CALL PRNODE		;GO PRINT NODE NAME WE'RE TESTING WITH
	MOVE T1,ARGPTR		;RESTORE ARG PTR
	MOVE P1,.DTSUB(T1)	;GET DATATYP
	CAIL P1,0		;RANGE CHECK DISTYPE
	CAILE P1,5		;0 TO 5 VALID
	PRTERR <DISTYPE INVALID>,,<$RET>
	IDIVI P1,2		;SEPARATE TEST TYPE AND DATA TYPE
	CALL @DISTYP(P2)	;PRINT DISCONNECT TYPE
	CALL @OPTTYP(P1)	;PRINT OPTIONAL DATA TYPE
	JSP T1,[RETSKP]		;TRAIL RETURN ADDRESS AND RUN TEST
	PRTERR <DISCONNECT TEST FAILED>,,<$RET>
	PRTINF <DISCONNECT TEST COMPLETE>
	RET

DISTYP:
	PRDISY
	PRDIAB

PRDISY:
	PRTINF <DISCONNECT TEST>
	RET

PRDIAB:
	PRTINF <ABORT TEST>
	RET

	PAGE
	SUBTTL PRINTR - PRINT CONTENTS OF TCB FOR INTERRUPT TEST

;INTERRUPT TEST ROUTINE

PRINTR:				;ENTRY POINT
	PRTINF <INTERRUPT TEST STARTING>
	CALL PRNODE		;GO PRINT NODE NAME WE'RE TESTING WITH
	CALL PRDATY		;GO PRINT DATA TEST TYPE
	CALL PRTIMT		;GO PRINT ELAPSED TEST TIME
	MOVE T1,ARGPTR
	MOVE T2,.DTFOP(T1)	;GET FLOW CONTROL VALUE
	CAIL T2,1		;RANGE CHECK IT
	CAILE T2,^D255		;1 TO 255 VALID
	PRTERR <FLOW CONTROL VALUE INVALID>,,<$RET>
	PRTINF <FLOW CONTROL VALUE - >
	MOVE T1,ARGPTR
	MOVE T2,.DTFOP(T1)	;GET FLOW CONTROL VALUE
	CALL PRNUMV		;PRINT VALUE
	PRTINF <INTERRUPT MESSAGE LENGTH - >
	CALL PRMSGL		;GO PRINT MESSAGE LENGTH
	JSP T1,[RETSKP]		;TRAIL RETURN ADDRESS AND RUN TEST
	PRTERR <INTERRUPT TEST FAILED>,,<$RET>
	PRTINF <INTERRUPT TEST COMPLETE>
	RET

	PAGE
	SUBTTL PRNODE - PRINT NODE NAME

PRNODE:				;HERE TO PRINT NODE NAME IN TCB
	PRTINF <NODE NAME - >
	MOVE T1,ARGPTR		;RESTORE ARG PTR
	MOVE T1,.DTNOD(T1)	;GET NODE NAME POINTER
	CALL SNDSTR		;PRINT IT
	RET

	PAGE
	SUBTTL PRDATY - PRINT DATA TEST TYPE

PRDATY:				;HERE TO PRINT DATA & INTERRUPT TEST TYPE
	MOVE T1,ARGPTR		;RESTORE ARG PTR
	MOVE T2,.DTMSG+1(T1)	;GET BYTE 1 OF MSG LENGTH
	LSH T2,^D8		;IN BYTE 1 POS
	ADD T2,.DTMSG(T1)	;ADD IN BYTE 0
	MOVE P1,T2		;SAVE MSG LENGTH
	MOVE T1,.DTSUB(T1)	;GET DATATYP
	CAIL T1,0		;RANGE CHECK DATTYPE/INTTYPE
	CAILE T1,3		;0 TO 3 VALID
	SKIPA
	JRST @DATTYP(T1)	;GO PRINT DATA TEST TYPE
	PRTERR <DATTYPE/INTTYPE INVALID>
	POP P,(P)		;RETURN FOR CALLER
	RET

DATTYP:
	PRSINK
	PRSEQU
	PRPATT
	PRECHO

PRSINK:
	CAIL P1,1		;RANGE CHECK MESSAGE LENGTH
	PRTINF <SINK TEST>,,<$RET> ; > 1 FOR SINK TEST
	PRTERR <INVALID MESSAGE LENGTH>
	POP P,(P)
	RET

PRSEQU:
	CAIL P1,4		;RANGE CHECK MESSAGE LENGTH
	PRTINF <SEQUENCE TEST>,,<$RET> ; > 4 FOR SEQUENCE TEST
	PRTERR <INVALID MESSAGE LENGTH>
	POP P,(P)
	RET

PRPATT:
	CAIL P1,5		;RANGE CHECK MESSAGE LENGTH
	PRTINF <PATTERN TEST>,,<$RET> ; > 5 FOR PATTERN TEST
	PRTERR <INVALID MESSAGE LENGTH>
	POP P,(P)
	RET

PRECHO:
	CAIL P1,5		;RANGE CHECK MESSAGE LENGTH
	PRTINF <ECHO TEST>,,<$RET> ; > 5 FOR ECHO TEST
	PRTERR <INVALID MESSAGE LENGTH>
	POP P,(P)
	RET

	PAGE
	SUBTTL PRTIMT - PRINT ELAPSED TIME TO TEST

PRTIMT:				;HERE TO PRINT TEST TIME
	MOVE T1,ARGPTR
	MOVE T4,.DTTIM(T1)	;GET TIME
	HRROI T1,BUFFER		;STORE IN BUFFER
	SETZI T2,		;NO YEAR/MONTH
	SETZI T3,		;NO DAY
	PUSH P,5		;SAVE AC 5
	MOVX 5,<OT%NDA!OT%SCL>	;NO DATE, NO COL
	ODTNC
	 JSCONT
	POP P,5			;RESTORE AC 5
	PRTINF <TEST TIME - >
	HRROI T1,BUFFER
	CALL SNDSTR
	RET

	PAGE
	SUBTTL PRMSGL - PRINT MESSAGE LENGTH

PRMSGL:				;PRINT OUT MESSAGE LENGTH
	MOVE T1,ARGPTR
	MOVE T2,.DTMSG+1(T1)	;GET BYTE 1 OF MSG LENGTH
	LSH T2,^D8		;IN BYTE 1 POS
	ADD T2,.DTMSG(T1)	;ADD IN BYTE 0
	CALL PRNUMV		;PRINT VALUE
	RET

	PAGE
	SUBTTL PRNUMV - PRINT NUMERIC VALUE

PRNUMV:				;HERE TO PRINT VALUE IN DECIMAL IN T2
	HRROI T1,BUFFER
	MOVEI T3,^D10		;IN DECIMAL
	NOUT
	 JSCONT
	HRROI T1,BUFFER
	CALL SNDSTR
	RET

	PAGE
	SUBTTL STORAGE

BUFFER:	BLOCK 50

	END