next up previous index
Next: M437 Set or Up: CERNLIB Previous: M434 Fast VAX

M436 Pack Bytes into Full Words

Routine ID: M436
Author(s): CDC: J. Blake, IBM: A.BerglundLibrary: KERNLIB
Submitter: Submitted: 20.10.1975
Language: Fortran or AssemblerRevised: 01.02.1982

BUNCH converts a source array containing NBYTES bytes of NBITS bits per byte (where each byte is stored right-adjusted in a full word), into a target array in which the bytes follow each other contiguously without intermediate padding. The last word of the target array, if incomplete, is however padded with binary zero. BUNCH is the inverse of BLOW (M426).

Structure:

SUBROUTINE subprogram
User Entry Names: BUNCH
External References: PKCHAR (M427)

Usage:

    CALL BUNCH(SOURCE,TARGET,NBYTES,NBITS)
SOURCE
Source array containing NBYTES bytes, each right-adjusted in a full word.
TARGET
Target array, which must be at least NBYTES*NBITS/nbpw (rounded up to an integral value) words long, where nbpw=60 on CDC and nbpw=32 on IBM.
NBYTES
Number of bytes in the source array (NBYTES>0) .
NBITS
Number of bits per byte (0 < NBITS ≤nbpw) .

Restrictions:

The arrays SOURCE and TARGET must not overlap in any way.

Error handling:

BUNCH ignores calls with erroneous parameter values.

Examples:

IBM:

    CALL BUNCH(SOURCE,TARGET,200,16)
The array SOURCE contains 200 words, each containing an 16-bit byte, right-adjusted. After returning from BUNCH, the array TARGET will contain 100 32-bit words, in which the 200 16-bit bytes are stored contiguously.

M437


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