> -----Original Message-----
> From: IBM Mainframe Discussion List On Behalf Of Rick Fochtman
> 
> Tom Marchant wrote:
> 
> >On Thu, 13 Dec 2007 17:13:09 -0800, Tom Simons wrote:
> >
> >>Here's 8 instructions to translate 8 bits to 8 chars of 1's or 0's:
> >>
> >>        LA    R3,8
> >>        IC    R5,INBYTE
> >>        SLL   R5,24
> >>LOOP     SLL   R4,3
> >>        SLDL  R4,1
> >>        BCT   R3,LOOP
> >>        ST    R4,OUTCHAR
> >>        UNPK  OUTCHAR(9),OUTCHAR(5)
> >>
> >>OUTCHAR  DS    CL8
> >>        DS    X
> >>INBYTE   DC    B'10101011'
> >>    
> >>
> >
> >Cool.  Here's a minor improvement
> >
> >         LA    R3,8
> >         ICM   R5,8,INBYTE
> >LOOP     SLL   R4,3
> >         SLDL  R4,1
> >         BCT   R3,LOOP
> >         ST    R4,OUTCHAR
> >         UNPK  OUTCHAR(9),OUTCHAR(5)
> >
> >OUTCHAR  DS    CL8
> >         DS    X
> >INBYTE   DC    B'10101011'
> >
> >  
> >
> Don't you want a STM R4,R5,OUTCHAR ??? Instead of a ST R4,OUTCHAR ???

This routine is storing the output in "packed" format, so it only needs
4 bytes.  The UNPK following makes it "readable".

    -jc-

----------------------------------------------------------------------
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