Thanks everyone for all the advice.

Kirk

On Mon, Mar 24, 2008 at 2:42 PM, Edward Jaffe <[EMAIL PROTECTED]>
wrote:

> McKown, John wrote:
> > I don't think you have a choice, in the general case. That is because
> > all the new TRxx type instructions seem to terminate when the data in
> > your buffer equals to the contents of the low order byte general
> > register 0. I.e. they stop at an "end of buffer" type character, like a
> > <null> in a C string. If you can tolerate this behaviour, then I'd look
> > at the TRE or TROO instruction. The TRE seems easier to use, to me.
> >
>
> The following fragment should work if you prefer looping TRE over
> traditional TR. TRE requires you to manually translate the so-called
> "stop" character with an MVC. But, at least there's no EXecute for the
> final segment.
>
>    LM   R14,R15,xxxxxx           Load string ptr and its length
>    LA   R1,xxxxxx                Ptr to translation table
>    XR   R0,R0                    Set stop char = x'00'
>    DO INF                        Do for translate
>      TRE   R14,R1                  Translate the string
>      DOEXIT Z                      Exit if no more data
>      IF O                          If iterate needed
>        ITERATE ,                     Process another segment
>      ENDIF ,                       EndIf
>      MVC   0(1,R14),0(R1)          Translate x'00' to whatever
>      LA    R14,1(,R14)             Advance past stop character
>      AHI   R15,-1                 Decrement length remaining
>      DOEXIT NP                    Exit if no more data
>    ENDDO ,                       EndDo for translate
>
> --
> Edward E Jaffe
> Phoenix Software International, Inc
> 5200 W Century Blvd, Suite 800
> Los Angeles, CA 90045
> 310-338-0400 x318
> [EMAIL PROTECTED]
> http://www.phoenixsoftware.com/
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
> Search the archives at http://bama.ua.edu/archives/ibm-main.html
>

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to