next up previous index
Next: M429 Number of Up: CERNLIB Previous: M427 Pack/Unpack Continuous

M428 Search for Byte-Content

Routine ID: M428
Author(s): J. ZollLibrary: KERNLIB
Submitter: Submitted: 01.06.1973
Language: Fortran or AssemblerRevised: 15.09.1978

LOCBYT searches through a vector in steps of 1 or more words looking for the first word which has a certain bit configuration in a certain part of the word.

Structure:

FUNCTION subprogram
User Entry Names: LOCBYT

Usage:

    J = LOCBYT(IT,VECT,N,INC,L,NBITS)
searches through the N element vector VECT, but only looking every INC words for the first word which contains IT in the byte (L,NBITS), and returns its address in J which may be 1, INC+1, 2*INC+1, 3*INC+1, etc.

IT must contain the desired byte value right-justified with zero-fill.

J=0 is returned if such a word is not found, or if N=0 .

The byte (L,NBITS) is a byte of NBITS bits, occupying the bits L,L+1,...,L+NBITS-1. The bits are numbered as with the routines of BITBYT (M421) / PACBYT (M422): L = 1,2,3,... ; bit 1 is the least significant bit of the word.

M429


Janne Saarela
Mon Apr 3 15:06:23 METDST 1995