As the instruction
Machine FormatOp Code L __ __ __ __ oo_0 ____ __ ____ Assembler Format OpCode 0
1
(L,B
1
),02(B
2
)
TR0(20,12) ,O( 15)
is executed, the binary value of each argument byte is added
to the starting address of the table, and the resulting address
is used to fetch a function byte:
Table starting address:1000 First argument byte (J): Dl
Address of function byte: lODI
Because the table is arranged so that everyEBCDIC charĀ acter is replaced by the corresponding ASCII character, the
result is:
Locations2100-2113: JOHNbJONESb257bW.b95
Note: To verify that this example is correct, find in appenĀ
dix H the hexadecimal values for the remainingEBCDIC characters and add them to the starting address of the table (1000). The sums should be the addresses within the table
of the correspondingASCII characters. Translate and Test (TRT)
The TRANSLATE AND TEST instruction is used to scan a
data field {the argument bytes) for characters with a special
meaning. To indicate which characters have special meaning,
first set up a table similar to the one used for the TRANS-
Translate-and-Test Table:2000 2010 2020 2030 2040 2050 2060 2070 2080 2090 20AO 20BO 20CO 2000 20EO 20FO 00 00 00 00 00 90 80 00 00 00 I-- 00 00 00 00 00 - 00 00 00 00 00 00 00 .. ) 00 00 00 r- 00 00 00 00 00 -- -- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ,_.- .. -- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f-- - 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 _. - 00 00 00 00 c---- --- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 30 00 00 00 50 00 00 00 60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - 00 00 00 00 r-- -_ .... 00 00 00 00 304 System/370 Principles of Operation 200F 00 00 00 00 00 00 00 00 --- 00 00 00 00 -- 00 00 00 00 --- 10 20 25 00 --
3540 45 00 --
5500 00 00 .-- ._-
6570 75 00 00 00 00 00 00 00 00 00 ._- 00 00 00 00 00 00 00 00 00 00 00 00 r- - ._- 00 00 00 00 -- 00 00 00 00 -- 00 00 00 00 20FF LATE instruction. (See the preceding example.) Once again
the table must be in order by the binary sequence of the
code of the argument bytes. This time, however, put zeros
in the table to indicate characters without any special
meaning and nonzero values to indicate characters with
special meaning.
This example deals withEBCDIC characters; the characĀ
ters with special meaning in the argument field are a selected
set of punctuation marks. The Translate-and-Test Table was
set up accordingly.
Note: If the character codes in the statement being transĀ
lated occupy a range smaller than00 through FF 16, a table
of fewer than 256 bytes can be used.
Now, assume that starting at storage location3000 you
have the following sequence of30
1 0 EBCDIC characters:
Locations3000-301D: bbbbbUNPKbbbbbPROUT(9),WORD(5) Also assume:
Register 1 contains00 00 2F FF
Register 2 contains00 00 00 00 Register 15 contains 00 00 20 00 As the instruction
Machine FormatOp Code L B1 0
100 10 I 001 Assembler Format Op Code 0
1
(L, B
1
), O
2
(B2)
TRT 1(30,1),0(15) 000 is executed, the value of the first argument byte, a blank, is
added to the starting address of the table to produce theadĀ dress of the function byte to be examined:
Table starting address
First argument byte (blank)
Address of function byte2000 40 2040 Because zeros were originally placed in storage location 2040, no special action occurs, and the operation continues
with the second argument byte. The operation will thus
continue until it reaches the symbol ( (left parenthesis) in
location3013. When this symbol is reached, its value is
added to the starting address of the table, as usual:
Table starting address
Argument byte (left parenthesis)
Address of function byte2000 4D 204D Because location 204D contains a nonzero value, the folĀ lowing actions occur:
1. The address of the argument byte,003013, is placed in
the low-order 24 bits of register 1.
2. The function byte,20, is placed in the low-order eight
bits of register 2.
3.Condition code 1 is set (scan not completed).
Machine Format
1
(L,B
1
),02(B
2
)
TR
is executed, the binary value of each argument byte is added
to the starting address of the table, and the resulting address
is used to fetch a function byte:
Table starting address:
Address of function byte: lODI
Because the table is arranged so that every
result is:
Locations
Note: To verify that this example is correct, find in appenĀ
dix H the hexadecimal values for the remaining
of the corresponding
The TRANSLATE AND TEST instruction is used to scan a
data field {the argument bytes) for characters with a special
meaning. To indicate which characters have special meaning,
first set up a table similar to the one used for the TRANS-
Translate-and-Test Table:
35
55
65
the table must be in order by the binary sequence of the
code of the argument bytes. This time, however, put zeros
in the table to indicate characters without any special
meaning and nonzero values to indicate characters with
special meaning.
This example deals with
ters with special meaning in the argument field are a selected
set of punctuation marks. The Translate-and-Test Table was
set up accordingly.
Note: If the character codes in the statement being transĀ
lated occupy a range smaller than
of fewer than 256 bytes can be used.
Now, assume that starting at storage location
have the following sequence of
1
Locations
Register 1 contains
Register 2 contains
Machine Format
1
1
(L, B
1
), O
2
(B2)
TRT 1
added to the starting address of the table to produce the
Table starting address
First argument byte (blank)
Address of function byte
with the second argument byte. The operation will thus
continue until it reaches the symbol ( (left parenthesis) in
location
added to the starting address of the table, as usual:
Table starting address
Argument byte (left parenthesis)
Address of function byte
1. The address of the argument byte,
the low-order 24 bits of register 1.
2. The function byte,
bits of register 2.
3.