Patent ID: 7516304

Claim:
A computer program product for executing an extended translate and test instruction, the computer program product comprising a storage medium readable by a processing circuit and storing instructions for execution by the processing circuit for performing a method comprising: fetching for execution said extended translate and test instruction, said extended translate and test instruction comprising an opcode field identifying said instruction, a bit significant field for controlling execution of said instruction, a first register field for identifying a first register used to provide the location of an argument character to be translated and a second register field for identifying a second register for saving a nonzero function code obtained from a function code table, said bit significant field comprising a first bit, a second bit, and a third bit; executing said fetched extended translate and test instruction, the executing comprising: decoding the bit significant field wherein the first bit determines the size of the argument characters to be translated, the second bit determines the size of the function codes in said function code table, and the third bit determines, when argument characters have a value greater than 255, whether or not the argument character to be translated is used to select function codes from said function code table; based on the first register identified by said first register field, obtaining an argument character to be translated, said argument character having a size determined by the first bit; i. based on the first bit and the third bit either using a predefined value for a function code for the argument character to be translated or using the argument character to be translated as an index into said function code table to locate a function code corresponding to the argument character, the function code table being designated by the contents of a predetermined register associated with the extended translate and test instruction, and the function code having a size determined by the second bit; and ii. if said function code is nonzero, storing said nonzero function code in said second register; or iii. if said function code is zero, obtaining a next argument character to be translated and repeating steps i through iii, unless an ending condition exists.