IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Working of TRT


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
er_neo

New User


Joined: 10 Jan 2006
Posts: 18
Location: Indore

PostPosted: Fri Jan 04, 2008 5:43 pm
Reply with quote

Can anyone help me out in understanding how the command TRT actually works.
Explaination with example will be more than welcome.

Actually i am trying to understand following set of command :

PHCODEIT EX REG4,SCAN
.
.
.
.
SCAN TRT 0(,REG1),0(REG5)

thanks a ton in advance
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Jan 04, 2008 6:06 pm
Reply with quote

Quote:
7.5.100 TRANSLATE AND TEST
TRT D1(L,B1),D2(B2) [SS]
The bytes of the first operand are used as eight-bit arguments to select
function bytes from a list designated by the second-operand address. The
first nonzero function byte is inserted in general register 2, and the
related argument address in general register 1.
The L field specifies the length of only the first operand.
The bytes of the first operand are selected one by one for translation, proceeding from left to right. The first operand remains unchanged in storage. Calculation of the address of the function byte is performed as in the TRANSLATE instruction. The function byte retrieved from the list is inspected for a value of zero.
When the function byte is zero, the operation proceeds with the next byte of the first operand. When the first-operand field is exhausted before a nonzero function byte is encountered, the operation is completed by setting condition code 0. The contents of general registers 1 and 2 remain unchanged.
When the function byte is nonzero, the operation is completed by inserting the function byte in general register 2 and the related argument address in general register 1. This address points to the argument byte last translated. The function byte replaces bits 24-31 of general register 2, and bits 0-23 of this register remain unchanged. In the 24-bit addressing mode, the address replaces bits 8-31 of general register 1, and bits 0-7 of this register remain unchanged. In the 31-bit addressing mode, the address replaces bits 1-31 of general register 1, and bit 0 of this register is set to zero.
When the function byte is nonzero, either condition code 1 or 2 is set, depending on whether the argument byte is the rightmost byte of the first operand. Condition code 1 is set if one or more argument bytes remain to be translated. Condition code 2 is set if no more argument bytes remain.
The contents of access register 1 always remain unchanged.
Access exceptions are recognized only for those bytes in the second operand which are actually required. Access exceptions are not recognized for those bytes in the first operand which are to the right of the first byte for which a nonzero function byte is obtained.
Resulting Condition Code:
0
All function bytes zero
1
Nonzero function byte; first-operand field not exhausted
2
Nonzero function byte; first-operand field exhausted
3
--
Program Exceptions:
* Access (fetch, operands 1 and 2)

Programming Notes:
1. An example of the use of the TRANSLATE AND TEST instruction is given in Appendix A, "Number Representation and Instruction-Use Examples."
2. TRANSLATE AND TEST may be used to scan the first operand for characters with special meaning. The second operand, or list, is set up with all-zero function bytes for those characters to be skipped over and with nonzero function bytes for the characters to be detected.


taken from
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DZ9AR006/7.5.100?SHELF=HAS1BK40&DT=19990630131355
Back to top
View user's profile Send private message
er_neo

New User


Joined: 10 Jan 2006
Posts: 18
Location: Indore

PostPosted: Sat Jan 05, 2008 8:48 pm
Reply with quote

thanks a lot that really made matters lot simple for me......
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts PD not working for unsigned packed JO... DFSORT/ICETOOL 5
No new posts Def PD not working for unsigned packe... JCL & VSAM 3
No new posts ICETOOL with JOINKEY for Big record l... DFSORT/ICETOOL 12
No new posts JCL JOB Cancel/Purge Not Working JCL & VSAM 6
No new posts OMVS Shell Script not working properly. All Other Mainframe Topics 1
Search our Forums:

Back to Top