IBMBBGC*

IBMBBGC is a PL/I resident library routine that compares two nonaligned bit strings. Corresponding portions of the two strings, up to 32 bits long, are aligned in even-odd register pairs, and then compared using the CLR instruction. A value is returned that indicates whether the two bit strings are equal, the first is greater than the second, or the second is greater than the first.

Hints

This routine will only be called if nonaligned bit strings are compared. You can avoid this processing by keeping the bit strings aligned.

The following example shows three methods to code a bit string comparison. The first way calls IBMBBGC, the other two ways do not and use less CPU.

line 28 shows the unaligned variable BIT_VECTOR compared. This generates a call to IBMBBGC.

 

 

27 1 0 IF_UNALIGNED_GC: PROCEDURE;

28 2 0 IF BIT_VECTOR(19) = TRUE THEN; ELSE;

29 2 0 END;

Line 32 compares to a constant. IBMBBGC is not called.

 

31 1 0 IF_LITERAL_NO_GC: PROCEDURE;

32 2 0 IF BIT_VECTOR(19) = '1'B THEN; ELSE;

34 2 0 END;

Line 36 shows a comparison of a variable declared as ALIGNED. IBMBBGC is not called.

 

35 1 0 IF_ALIGNED_NO_GC: PROCEDURE

36 2 0 IF BIT_VECTOR_ALIGNED(19) = TRUE THEN; ELSE;

38 2 0 END:

Use aligned variables or constants to eliminate processing in IBMBBGC.

Reference Sources

OS PL/I Resident Library: Program Logic, LY33-6008.