I understand that LA can cause an "address generation interrupt" in 
the pipeline on some "z" models and as a rule of thumb, LHI is better 
to use when you can.  Similar nasties occur with things like BCTR Rx,0
(typically used to decrement a register), such that AHI Rx,-1 tends to 
work better.  (In the early look-ahead processing that occurs in the 
pipeline, the never-branch nature of the BCTR isn't (yet) recognized, 
only that there is a branch.  This stalls the pipeline's pre-processing 
and parallel execution capabilities until the full nature of the branch 
is interpreted.


At 11:44 PM 12/12/2007, Rick Fochtman wrote:
  
>------------------------<snip>-------------------
>
>>Well, just for the sport of it, I think this requires even less
>>(not tested):
>>
>>        LHI   R1,8
>>        IC    R2,BYTE
>>STC      STC   R2,RESULT-1(R1)
>>        SRL   R2,1
>>        BCT   R1,STC
>>        NC    RESULT,=8X'01'
>>        OC    RESULT,=8X'F0'
>>*
>>BYTE     DC    B'01110101'        Sample input
>>RESULT   DS    CL8                Output
>>
>>  32  Instructions
>>  16  Literals
>>   1  Input Area
>>   8  Output Area
>>
>>  57  Total Bytes
>>   7  Total Instructions
>>
>>BTW, John, your second instruction below refers to WORK8, which
>>doesn't seem to be defined.
>> 
>-------------------------<snip>---------------------------
>Why not:
>
>               LA   R1,8
>instead of
>               LHI  R1,8
>
>Inquiring minds want to know....... <G>
>



==================================================
Art Celestini       Celestini Development Services
Phone: 201-670-1674                    Wyckoff, NJ
=============  http://celestini.com  =============
Mail sent to the "From" address  used in this post
will be rejected by our server.   Please send off-
list email to:  ibmmain<at-sign>celestini<dot>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

Reply via email to