Browse Prior Art Database

Instruction for Text Manipulation (Find Long)

IP.com Disclosure Number: IPCOM000044427D
Original Publication Date: 1984-Dec-01
Included in the Prior Art Database: 2005-Feb-05
Document File: 4 page(s) / 49K

Publishing Venue

IBM

Related People

Brady, JT: AUTHOR

Abstract

As computing becomes more and more interactive, the need to communicate in natural languages increases. The ease of that communication directly affects the productivity of the user. In the case of a programming language (APL), the parsing of the user inputs may consume 29% of the processor cycles used by APL. This high percentage is for a very formal language definition and does not require the depth of analysis required of a natural language parser. The IBM System/370 instruction set and its extensions are rich enough to allow the byte manipulation required for any language but suffer from two deficiencies. The first is most byte manipulation routines require the use of the TRANSLATE AND TEST instruction (in IBM System/370 instruction set) to achieve reasonable efficiency.

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 37% of the total text.

Page 1 of 4

Instruction for Text Manipulation (Find Long)

As computing becomes more and more interactive, the need to communicate in natural languages increases. The ease of that communication directly affects the productivity of the user. In the case of a programming language (APL), the parsing of the user inputs may consume 29% of the processor cycles used by APL. This high percentage is for a very formal language definition and does not require the depth of analysis required of a natural language parser. The IBM System/370 instruction set and its extensions are rich enough to allow the byte manipulation required for any language but suffer from two deficiencies. The first is most byte manipulation routines require the use of the TRANSLATE AND TEST instruction (in IBM System/370 instruction set) to achieve reasonable efficiency. This instruction is very general and allows the programming of numerous functions by using somewhat tricky techniques. As a matter of good programming practice, tricky code should be avoided for quality and maintenance reasons. The second reason is more persuasive - performance. The operation of the TRANSLATE AND TEST instruction may process less than one byte per machine cycle. This article describes a FIND LONG instruction which is naturally adaptable to a serial-by-byte or a parallel machine. An examination of a typical use of the instruction indicates that it is able to process the data at a rate, at least proportional to the number of bytes in its bus, faster than a well-written assembler language program. The FIND LONG instruction may be used in program editors, applications, language processors (compilers, interpreters, query, etc.), expert systems, etc. Referring to Fig. 1, the first operand is searched for first occurrence of the second operand, and the result is indicated in the condition code. The R1 and R2 fields (Fig.1) each specify an odd-even pair of general registers (regs) and must designate an even-numbered register; otherwise, a specification exception is recognized. The location of the leftmost (address) byte of the first operand and second operand is designated by bits 1- 31 (31-bit mode) or 8-31 (24-bit mode) of the general regs specified by the R1 and R2 fields, respectively. The number of bytes (length) in the first operand and second operand locations is specified by bits 1-31 or 8-31 of the general reg R1+1 and bits 24-31 of R2+1, respectively (Fig.1). The contents of bit 0 or bits 0- 7 of regs R1, R1+1 and R2 are ignored, as well as bits 0-23 of R2+1. The search proceeds from left to right, byte by byte, and ends as soon as a string of bytes is found in the first operand that exactly matches the second operand or the end of the first operand is reached. If the second operand is longer, the search will proceed as above; however, only condition codes 0 and 2 can be set. (The condition codes have been selected to conform to the Translate and Test condition codes.) If both operands are of zero...