True, I believe it is the SRST instruction:

Instruction Format:   SRST  R1,R2           Operation Code (Hex): B25E
 
          Examples:   SRST  R9,R2           SEARCH STARTING AT ADDRESS IN
                                            R2 UNTIL ADDRESS IN R9 IS REACHED,
                                            OR A CPU-DETERMINED NUMBER OF
                                            BYTES ARE PROCESSED, OR THE
                                            CHARACTER SPECIFIED IN BITS 56-63
                                            OF GENERAL REGISTER 0 IS FOUND
 
       Description:   The SEARCH STRING instruction searches for a specified
                      character starting at the address in the second operand
                      register. The search stops when:
 
                      1) the desired character is found, OR
                      2) the end of the string being searched is reached, OR
                      3) a CPU-determined number of bytes (at least 256) has
                         been searched.
 
                      When SRST begins execution, the second operand register
                      contains the address of the starting (leftmost) byte of
                      the string of bytes to search. The first operand
                      register contains the address of the first byte after
                      the end of the string of bytes to search. The character
                      to search for is contained in bits 56 through 63
                      (rightmost byte) of general register zero.
 
                      As the search progresses, the address in the second
                      operand register is incremented one byte at a time. When
                      the address in the second operand register is equal to
                      the address in the first operand register, then the end
                      of the string has been reached.
 
                      Bits 0 through 55 of register zero must be zero when
                      SRST executes; if they are not, a specification
                      exception (S0C6 ABEND) will occur.
 
                      The addresses in the first and second operand
                      even-numbered registers are handled differently,
                      depending upon the current addressing mode. In 24-bit
                      addressing mode, bits 40 through 63 of the first and
                      second operand registers contain the addresses of the
                      data and bits 0 through 39 of both registers are
                      ignored. In 31-bit addressing mode, the contents of bits
                      33-63 contain the addresses and bits 0-32 are ignored.
                      In 64-bit addressing mode, the full contents (bits 0-64)
                      of the registers contain the addresses of the bytes to
                      be operated upon.
 
                      In access register mode, the address space containing
                      the second operand is specified by the access register
                      associated with the R2 operand only. The access register
                      associated with the R1 operand is ignored.
 
                      When condition code 3 is set, you can resume execution
                      of SRST by simply branching back to execute the
                      instruction again. No registers need to be modified
                      before execution can resume.
 
                      Both the first and/or second operand may specify general
                      register 0; if either or both does, then register 0 is
                      considered to contain both an address and the character
                      to search for.
 
                      You can search a string of unknown length for a
                      particular character using only two registers by making
                      the first operand register zero; this will work only if:
 
                      1) the string to search does not start below location
                      256 in virtual storage,
                      2) the string does not wrap around to location 0 in
                      virtual storage, and
                      3) the end-of-string character in register zero does not
                         need to be preserved.
 
    Condition Code:   0 - not set, (N/A)
                      1 - desired character found, address of found character
                          is in first operand register
                      2 - desired character not found, registers not changed
                      3 - CPU-determined number of bytes have been searched
                          but desired character was not found; address of next
                          string byte to start search with is in second
                          operand register

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf 
Of Charles Mills
Sent: Friday, March 13, 2015 1:44 PM
To: [email protected]
Subject: Re: Need assembler trick to quickly get second and third DS qualifiers

The classic approach is TRT, which is a little bit of a PITA (R2 anyone?) but 
does the job. It is a single machine instruction but that does not mean it's 
fast!

There is a new instruction (new relative to a lot of us LOL) "search string" 
(as I recall) that is more straightforward and might be faster. Again, 
fundamentally a loop whether you code it or the machine does it under the 
covers, so not as fast as you might guess. Faster than a CLI/JE loop I would 
guess.

Watch out for the "no second qualifier" special case. FOOBAR is a valid dataset 
name.

Charles

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf 
Of Pinnacle
Sent: Friday, March 13, 2015 10:28 AM
To: [email protected]
Subject: Need assembler trick to quickly get second and third DS qualifiers

I have a dataset FIRST.SECOND.THIRD, and I want to get SECOND.THIRD.  
Normally I would loop to one character at a time to get to the '.', but I need 
performance here.  I sure some of you assembler gurus could give me some 
inscrutable assembler to get there in like one or two instructions.  Thanks in 
advance!

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions, send email to 
[email protected] with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to