Google
 

Trailing-Edge - PDP-10 Archives - decuslib20-01 - decus/20-0001/flip.for
There is 1 other file named flip.for in the archive. Click here to see a list.
C
C
C
C            COPYRIGHT (c) 1977 BY
C    DIGITAL EQUIPMENT CORPORTATION, MAYNARD, MASS.
C   
C  THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND  COPIED
C  ONLY  IN  ACCORDANCE  WITH  THE  TERMS  OF  SUCH  LICENSE AND WITH THE
C  INCLUSION OF THE  ABOVE COPYRIGHT NOTICE.  THIS  SOFTWARE OR ANY OTHER
C  COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE  MADE AVAILABLE TO ANY
C  OTHER PERSON.  NO TITLE TO AND OWNERSHIP OF  THE  SOFTWARE  IS  HEREBY
C  TRANSFERRED.
C 
C  THE INFORMATION IN THIS  SOFTWARE IS SUBJECT TO CHANGE  WITHOUT NOTICE
C  AND  SHOULD  NOT  BE  CONSTRUED AS A COMMITMENT BY  DIGITAL  EQUIPMENT
C  CORPORATION.
C 
C  DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS
C  SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL.
C 
C 
C 
C
C
C
C
C
C   ++++++++++++++++++++++++++++++++++++++++++++++++++
C   +                                                +
C   +            CALC    VERSION  X01-01             +
C   +                                                +
C   +  PETER BAUM  1-SEP-77                          +
C   +  DIGITAL EQUIPMENT CORPORATION                 +
C   +  146 MAIN STREET                               +
C   +  MAYNARD, MASSACHUSETTS  01754                 +
C   +                                                +
C   ++++++++++++++++++++++++++++++++++++++++++++++++++
C
C
C
C **************************************************
C *                                                *
C *         SUBROUTINE FLIP(VEC,SIZE,PT)           *
C *                                                *
C **************************************************
C
C
C  FLIPS THE NON-ZERO DIGITS UP TO PT IN VECTOR VEC IN REVERSE
C  ORDER.  USED TO PLACE NUMBERS IN PROPER ORDER INTO VBLS THAT 
C  HAVE BEEN READ IN HIGH ORDER FIRST.
C
C
C
C
C FLIP IS CALLED BY NEXTEL
C
C MODIFICATION CLASSES: -
C
C
C
C
C   VARIABLE   USE
C
C     H1     TEMPORARILY HOLDS A LOGICAL*1 VALUE
C     I      INDEXES DIGITS THAT ARE FLIPPED.
C     K      THE MIDPOINT OF THE FLIPPING ACTION.
C     PT     HOLDS THE RANGE OF THE FLIPPING ACTION.
C            (USUALLY THE HIGH ORDER NON-ZERO DIGIT)
C
C
C
C
C
C
C
C
C
C
	SUBROUTINE FLIP (VEC,SIZE,PT)
C
C
	INTEGER*2 SIZE,PT
	INTEGER*2 K
C
	LOGICAL*1 VEC(SIZE), H1
C
C
	K=PT/2
	IF (K.EQ.0) GOTO 20
	DO 10 I=1,K
	H1=VEC(I)
	VEC(I)=VEC(PT+1-I)
10	VEC(PT+1-I)=H1
20	RETURN
	END