Rob,

here is a simple sample for SRST:

         L     R15,SAVE   point in string for cont
         LA    R14,256(R15)
         LA    R0,C'/'
         SRST  R14,R15
*     R14 is now on the first /
         LA    R15,1(R14)
         SRST  R14,R15
*     R14 is now on the second /

Two hints:

1.) SRST should be followed by a JO *-4, but POP says min
length scanned is 255. So it can be omitted in certain cases.

2.) A found condition is indicated by a L (L_located).
A not found condition is indicated by a H (not L_ocated) -
so an extra JH NOT_FOUND might be usefull (or JL LOCATED_CHAR).

I had a hard time getting used to SRSTs way of using/wanting the
registers- but then... It does an excellent job on searching for one
(and only one) character in a string.

--
Martin

Pi_cap_CPU - all you ever need around MWLC/SCRT/CMT in z/VSE
more at http://www.picapcpu.de

Reply via email to