What is the use of TRT instruction and how it is working?
Answer Posted / phils
TRT is used to scan a string of characters byte by byte,
using the hexadecimal value of each character to 'index'
into a 256 byte translate table, If the resultant table byte
is set to X'00', then processing continues with the next
input character, and so on until end of input string, or a
non-zero table byte is encountered.
TRT sets the condition code to indicate the results
of the scanning operation as follows:
Condition Code Indications
0 ( Zero ) All table bytes X’00’.
1 ( Minus ) nonzero tabl found before the end
of operand 1
2 ( Positive ) A nonzero table byte was found at
the end of the operand 1
The condition code can be tested using BZ, BNZ, BM, BNM,
BP, or BNP.
In this way we can test that a string contains only
'desirable values' by setting the equivalent bytes in the
translate table to X'00' e.g. testing for numerics as in
answer 4.
| Is This Answer Correct ? | 3 Yes | 2 No |
Post New Answer View All Answers
Explain how to produce soc7 abend?
What is need of start 0?
Explain the difference between various read and find statement and which one should be used when for better adabas performance?
What is house keeping in assembler?
Explain how to access vsam file?
Explain about house keeping in assembler?
What is maximum displacement and how to cross this limit?
How many maximum base registers we can have in a single program?
explain icm instruction?
Explain about base register?
Why do we use "drop"?
Explain the difference in data type "x" and "p"?
how to retrieve the instream data in sysin?
Ap wkur,=p5 where wkur is a label?
How to pass the parameters from jcl to assembler program?