Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-08 - 43,50512/chknod.b36
There are no other files named chknod.b36 in the archive.
MODULE CHKNOD (				!Low-seg module for checking node info
		  IDENT = '1'
		  ) =
BEGIN


! REMAIN IN DEC.
!
! THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE
! AND SHOULD  NOT BE CONSTRUED  AS A COMMITMENT  BY DIGITAL  EQUIPMENT
! CORPORATION.
!
! DEC ASSUMES  NO  RESPONSIBLILTY  FOR  THE USE OR  RELIABILITY OF ITS
! SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.
!
!++
! FACILITY:
!	RMCOPY for TOPS-10
!
! ABSTRACT:
!	This module will lookup information in the NODTBL.
!	It, and its utility routines from MSCMAC.MAC, must reside in
!	the low segment.
!
! ENVIRONMENT:
!	RMCOPY under TOPS-10
!
! AUTHOR:Dave Cornelius	, CREATION DATE: Mar 23 1978
!	(The LKNODE routine is stolen from Andy's SETNOD module)
!
! MODIFIED BY:
!     , : VERSION
! 01   - Dave Cornelius... in the beginning
! 02  - 05-May-78 D Cornelius
!	Added Limit word address to CHK_NODEID
!--
!
! TABLE OF CONTENTS:
!

FORWARD ROUTINE
	CHK_NODEID,
	LKNODE;		!Stolen from Andy

!
! INCLUDE FILES:
!
LIBRARY 'RMCOPY';	!For the return value definitions
LIBRARY 'NODTBL';	!For the NODE entry field defn's

!
! MACROS:
!

!
! EQUATED SYMBOLS:
!

!
! OWN STORAGE:
!

!
! EXTERNAL REFERENCES:
!

EXTERNAL ROUTINE
	RDSIX,		!In IO.B36 to read and convert ASCII to SIXBIT
	GETSEG;		!In MSCMAC, this routine pulls a GETSEG UUO

EXTERNAL GSTBND,	!Defined in MAIN10, these are GETSEG tables
	GSTBRM;		!  for NODTBL and RMCOPY
GLOBAL ROUTINE CHK_NODEID (PTR, CNT, DAP_ADR, FLG_ADR, LIM_ADR)  =		!

!++
! FUNCTIONAL DESCRIPTION:
!
!	This routine GETSEGs the NODTBL, looks up the desired node,
!	Fetches the DAP code and flag bits for that node, and returns this
!	info in DAP_ADR and FLG_ADR.  The node's limit information is
!	also stored in the same fashion.
!
! FORMAL PARAMETERS:
!
!	PTR - A CH$PTR to an ASCIZ string that is the node name to be looked up
!	CNT - The count of the number of chars in the string (unused)
!	DAP_ADR - The address into which we will store the DAP code for the node
!	FLG_ADR - The address into which we will store the on-line flags
!	LIM_ADR - The address into which we will store the maximum number
!		of blocks which may be moved to/from this node
!
! IMPLICIT INPUTS:
!
!	The contents of the NODTBL
!
! IMPLICIT OUTPUTS:
!
!	NONE
!
! ROUTINE VALUE:
!
!	CHK$NO, if the specified node name was not found in the node table,
!	CHK$YES, if it was found, (the info has been extracted)
!
! SIDE EFFECTS:
!
!	NONE
!
!--

BEGIN

	MAP FLG_ADR:REF BITVECTOR;
	LOCAL
		NODE_NAME,		!Holds the SIXBIT node name
		VAL_NOD: REF NODTBL_ENTRY;			!

	NODE_NAME = RDSIX (PTR);	!Convert the node name
	IF .NODE_NAME EQL 0 THEN RETURN CHK$NO;	!We never know about 0 name
	GETSEG (GSTBND);		!Pull in the NODTBL
		IF (VAL_NOD = LKNODE (.NODE_NAME)) NEQ 0 THEN
			BEGIN
				.DAP_ADR = .VAL_NOD [NOD$SYSTEM];
				!Translate the NODTBL flags into RMCOPY flags
				FLG_ADR [CHK_NOD$QSND] = .VAL_NOD [NOD$F_QSND];
				FLG_ADR [CHK_NOD$QRTV] = .VAL_NOD [NOD$F_QRTV];
				.LIM_ADR = .VAL_NOD [NOD$LIMIT]
			END;
	GETSEG (GSTBRM);		!Get back to RMCOPY
	IF .VAL_NOD EQL 0 THEN CHK$NO ELSE CHK$OK
END;
GLOBAL ROUTINE LKNODE(NODEID)=
!Find a node in NODTBL
!NODEID: SIXBIT name of node
BEGIN
INCR I FROM NODTBL$BASE BY .NODTBL$ENTLEN DO
	BEGIN
	IF .NODEID EQL ..I THEN RETURN .I;	!Found it
	IF ..I EQL 0 THEN RETURN 0;		!Didn't find it
	END
END; !LKNODE
END ELUDOM