Browse Prior Art Database

Searching for an EQUAL or NOT EQUAL Comparison

IP.com Disclosure Number: IPCOM000061216D
Original Publication Date: 1986-Jul-01
Included in the Prior Art Database: 2005-Mar-09
Document File: 1 page(s) / 12K

Publishing Venue

IBM

Related People

Plambeck, KE: AUTHOR

Abstract

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.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 53% of the total text.

Page 1 of 1

Searching for an EQUAL or NOT EQUAL Comparison

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. The length of the first operand, in bytes, is in bit positions 8-31 of the general register designated by the R2 field, and the comparand byte is in bit positions 0-7 of this register. The search is made by comparing each byte of the first operand, from left to right, to the comparand byte until an ending condition is met. When the ending condition is a successful comparison (an equal comparison for SEARCH FOR EQUAL, or an unequal comparison for SEARCH FOR NOT EQUAL), condition code 0 is set. When the ending condition is that all bytes of the first operand have been compared without success, condition code 1 is set. When the ending condition is that 256 bytes of the first operand have been comp...