Searching for an EQUAL or NOT EQUAL Comparison
Original Publication Date: 1986-Jul-01
Included in the Prior Art Database: 2005-Mar-09
Current IBM System/370 architecture permits the CPU to compare a comparand byte to only one byte at a time. This article describes a technique that permits comparison to multiple bytes at a time. A first operand is searched left to right until an ending condition is met, and the result is indicated by setting the condition code and by providing the address and length of the residual first operand. The ending condition may be a byte equal to a comparand byte found, or a byte not equal to the comparand byte found, or the entire first operand or 256 bytes, whichever is the lesser number of bytes searched. The address of the leftmost byte of the first operand is in the general register designated by the R1 field of an instruction.