Google
 

Trailing-Edge - PDP-10 Archives - DEC_CMS-20_V1.0_SRC - cms/sources/stgcnt.bli
There are no other files named stgcnt.bli in the archive.
MODULE STGCNT	(
		IDENT = '1',
		%IF
		    %BLISS(BLISS32)
		%THEN
		    LANGUAGE(BLISS32),
		    ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE,
				    NONEXTERNAL=LONG_RELATIVE)
		%ELSE
		    LANGUAGE(BLISS36)
		%FI
		) =
BEGIN

!
!			  COPYRIGHT (C) 1982 BY
!	      DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
!
! THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND  COPIED
! ONLY  IN  ACCORDANCE  WITH  THE  TERMS  OF  SUCH  LICENSE AND WITH THE
! INCLUSION OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR  ANY  OTHER
! COPIES  THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY
! OTHER PERSON.  NO TITLE TO AND OWNERSHIP OF  THE  SOFTWARE  IS  HEREBY
! TRANSFERRED.
!
! THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT  NOTICE
! AND  SHOULD  NOT  BE  CONSTRUED  AS  A COMMITMENT BY DIGITAL EQUIPMENT
! CORPORATION.
!
! DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR  RELIABILITY  OF  ITS
! SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL.
!

!++
! FACILITY:	CMS Library Processor
!
! ABSTRACT:
!
!	Get and replace the string count from a CMS string.
!
! ENVIRONMENT:	VAX/VMS, DS-20
!
! AUTHOR: D. Knight , CREATION DATE: 19-Feb-80
!
!--
!
! TABLE OF CONTENTS
!

FORWARD ROUTINE
	GET_STG_CT,			!Get the string count from the string
	PUT_STG_CT : NOVALUE;		!Put the string count into the string

!
! INCLUDE FILES:
!

!
! MACROS:
!

!
! EQUATED SYMBOLS:
!

!
! OWN STORAGE:
!

!
! EXTERNAL REFERENCES:
!
GLOBAL ROUTINE GET_STG_CT (STG_PTR) =

!++
! FUNCTIONAL DESCRIPTION:
!
!	Pick up the length of the string from its head, which consists
!	of the low order value and high order value stored in the first
!	two bytes.
!
! FORMAL PARAMETERS:
!
!	STG_PTR - Address of character pointer to string head
!
! IMPLICIT INPUTS:
!
!	NONE.
!
! IMPLICIT OUTPUTS:
!
!	The string pointer is advanced
!
! ROUTINE VALUE:
! COMPLETION CODES:
!
!	The string length is returned
!
! SIDE EFFECTS:
!
!	NONE.
!
!--

    BEGIN

    LOCAL
	HIGH,
	LOW;

    !Get the low and high orders
    LOW=CH$RCHAR_A(.STG_PTR);
    HIGH=CH$RCHAR_A(.STG_PTR);

    !Now reassemble the value
    .HIGH*64+.LOW

    END;				!End of GET_STG_CT
GLOBAL ROUTINE PUT_STG_CT (SIZE,STG_PTR) : NOVALUE =

!++
! FUNCTIONAL DESCRIPTION:
!
!	Place a specified value at the head of a string in two bytes
!
! FORMAL PARAMETERS:
!
!	STG_PTR - Address of character pointer to string head
!	SIZE - Value to be placed in the string
!
! IMPLICIT INPUTS:
!
!	NONE.
!
! IMPLICIT OUTPUTS:
!
!	The string pointer is advanced.
!
! ROUTINE VALUE:
! COMPLETION CODES:
!
!	NONE.
!
! SIDE EFFECTS:
!
!	NONE.
!
!--

    BEGIN

    LOCAL
	HIGH,
	LOW;

    !Get the low and high orders separated
    LOW=.SIZE MOD 64;
    HIGH=(.SIZE-.LOW)/64;

    !Now store the value
    CH$WCHAR_A(.LOW,.STG_PTR);
    CH$WCHAR_A(.HIGH,.STG_PTR)

    END;				!End of PUT_STG_CT
END				!End of Module STGCNT
ELUDOM