From: "Robert A. Rosenberg" <[email protected]>
Sent: Sunday, 10 October 2010 8:25 AM
At 17:56 +1100 on 10/08/2010, robin wrote about Re: TRT:
Quite useful if desiring to remove trailing blanks from a record.
This was done in the days of punch cards, in order to speed up
data transfers to/from disk, and to reduce disk storage requirements.
Alas, in those days, there was no TRTR instruction.
As I commented in a prior reply, you can use a TR (or later a MVCI)
to reverse the order of the bytes (while copying into a workarea).
Then using a TRT on the work area finds the last non-blank and you
can then use the location to find the offset into the original
version. This was, I think, the method used by HASP and JES2 to
reduce print line lengths by stripping the trailing blanks.
At the time when HASP originally came out, the S/360 didn't have
MVCI. Stripping trailing blanks was needed for fixed block lengths,
but not for variable lengths (such as produced by PL/I).
As to whether the data was reversed using TR, I don't know,
but TR + TRT sounds like overkill with little or no perfornmance improvement
over the loop method.
From the manual, times for TR were 6.24+5N,
and for TRT were 11+4B.
Comparable times for C were 8.4 and CLI were 6 (all microseconds).
Total time for TR+TRT thus was: 17.24 + 13N.
Comparing 4 bytes at a time:
C 8.4
BCR 3.36
SR 5.28
BCTR 5.76
Total for 4 bytes = 22.8, or 5.7 uS per byte.
Of course, an LM may well have been quickest, at 6 + 2.88W,
accompanied by explicit tests for each register.