Dismiss
InnovationQ will be updated on Sunday, Oct. 22, from 10am ET - noon. You may experience brief service interruptions during that time.
Browse Prior Art Database

Coding Technique to Change Random Alphabetic Letters into a Bit Mask

IP.com Disclosure Number: IPCOM000051433D
Original Publication Date: 1981-Jan-01
Included in the Prior Art Database: 2005-Feb-10
Document File: 2 page(s) / 32K

Publishing Venue

IBM

Related People

Ogden, WR: AUTHOR

Abstract

There is a frequent need to change a parameter string of characters (in random order) into a corresponding bit mask. For example, the parameter 'C=KXGH34' might be represented by the bit mask X'D010C0'. Another aspect of this conversion might be to change a single character into a bit within a bit mask. If this conversion must be done many thousands of times during, for example, a database search, then performance becomes critical. The following code represents a fast and compact algorithm (using IBM System/370 assembly language) for converting a character into a bit mask.

This text was extracted from a PDF file.
At least one non-text object (such as an image or picture) has been suppressed.
This is the abbreviated version, containing approximately 77% of the total text.

Page 1 of 2

Coding Technique to Change Random Alphabetic Letters into a Bit Mask

There is a frequent need to change a parameter string of characters (in random order) into a corresponding bit mask. For example, the parameter 'C=KXGH34' might be represented by the bit mask X'D010C0'. Another aspect of this conversion might be to change a single character into a bit within a bit mask. If this conversion must be done many thousands of times during, for example, a database search, then performance becomes critical. The following code represents a fast and compact algorithm (using IBM System/370 assembly language) for converting a character into a bit mask.

The characters and corresponding bit positions for this example are:
See Original. output mask is 24 bits long. Only the above characters (in the left columns) are allowed.

Any other input character will produce all zero output.

When this code is called, the general register R1 points to the character to be converted to a bit mask. Output is in general register R2. See Original.

The one-byte entry in the table corresponding to each letter is the number of positions a bit must be shifted left from the low-order bit of R2 in order to be placed in the correct mask position. A multiple letter mask can be developed by calling this routine once for each letter and ORing the results. The control table can be altered dynamically and will work for masks up to 32 bits. Minor changes would allow for masks up to 64 bits. If no parameter er...