On 3/9/2014 4:53 AM, Donald Russell wrote:
Re ICM vs IC ...
Is it possible for the TIOT to have no entries?
I'm not seeing the advantage of ICM over IC, because at that point the code
knows the length is not zero, so what's the point of setting the condition
code? Adding the length at the bottom of the loop points to the next
(possible) item... then at the top of the loop the CLI checks if there is
an item.

It's trivially easy to get a TIOT with no DD entries, though rarely is it intentional. Typically I use two registers not otherwise used in the loop (typed from memory, so I might have names wrong):

        L       R,TCBTIO
        LA      S,TIOENTRY-TIOT1
        USING   TIOENTRY,R
LOOP    ALR     R,S
        ICM     S,1,TIOELNGH
        BZ      endtiot
        ...
        B       LOOP

endtiot ...

While you may consider this inelegant due to the branch near the top, it has the advantage that the code can have multiple branches to LOOP, rather than branching to the bottom of the loop followed by another branch.


Gerhard Postpischil
Bradford, Vermont

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to