Machine Format 90 I E I 1 I 6 050 Assembler Format Op Code R
1
, R
3
,02 (B2) STM 14,1,X'50'(6)
After the instruction is executed:
Locations40504053 contain 00 00 25 63
Locations40544057 contain 00 01 27 36
Locations4058405B contain 12 43 00 62
Locations405C405F contain 73 26 12 57
Test Under Mask (TM)
The TESTUNDER MASK instruction examines specific bits
within a byte and sets the condition code according to what
it finds. For example, assume that:
Storage location 9999 contains FB
Register 9 contains000099 90 Execution of the instruction
Machine FormatOp Code '2
91C3 Assembler Format Op Code 01 (B
1
), '2
TM 9(9) ,X'C3'009 produces the following result:
FB 11111011 2 Mask (C3) 1100 00112 Result llxx XX112 Condition code 3 is set: all selected bits are ones.
I[location 9999 had contained B9, the result would have
been:
B9
Mask (C3)
Result1011 10012 1100 00112 10xx xx012 Condition code 1 is set: the selected bits are both zeros and
ones.
If location 9999 had contained3C, the result would have
been:
3C
Mask (C3)
Result0011 11002 1100 00112 OOxx XX002 Condition code 0 is set; all selected bits are zeros.
Note: Storage location 9999 remains unchanged.Translate (TR)
With the TRANSLATE instruction, System/370 can trans
late data from any code to any other desired code, provided
that each coded character consists of eight bits or fewer. In
the following exampleEBCDIC is translated to ASCII. The
first step is to create a 256-byte table in storage locations1000-10FF. This table contains the characters of the code
into which you are translating (the function bytes). The
table must be in order, not by the binary values of the char
acters it contains, but by the binary sequence of thecharac ters of the original code (the argument bytes). For example,
note in the following table that the characters are in the
normalEBCDIC collating sequence.
Translate Table:100F 1000 1010 1020 - - --- -- -'- 1030 -- -- - - f---- -- - 1040 b + ---1--- ----- I-- ... -- - -- 1050 & $ * - -- -".- -- -- - -- -- .- 1060 / %
-- ,- 1070 #
@
- - -
----f.-- 1080 ! b .£ d e !! h
- - - - 1--- - - - --- 1090 j k m n 0 .r: - -- - f--.--- --f-- -- 10AO u v w
x y z.- .-- 10BO --.-- --_.- - - -- ---,-- lOCO A B C D
E F G H, - - - - --- (= 1000 J K L M N 0 P Q R - 10EO S T U
V W X YZ -
--10FO 0 1 2 3 4 5 6 7 8 9 -1-- - 10FF Notes:
1. The underscores are used to indicate theASCII representations
of theEBCDIC characters shown.
2.I f the character codes in the statement being translated occupy
a rangesmaller than 00 through FF 16. a table of fewer than 256
bytes can be used.
Now, assume that starting at storage location2100 there
is a sequence of20
1 0 EBCDIC characters to be translated to ASCII: Locations 2100-2113: JOHNbJONESb257bW.b95
Also assume:
Register 12 contains00 00 21 00 Register 15 contains 00 00 10 00 Appendix I. Number Representation and Instruction-Use Examples 303
1
, R
3
,
After the instruction is executed:
Locations
Locations
Locations
Locations
Test Under Mask (TM)
The TEST
within a byte and sets the condition code according to what
it finds. For example, assume that:
Storage location 9999 contains FB
Register 9 contains
Machine Format
91
1
), '2
TM 9(9) ,X'C3'
FB 1111
I[location 9999 had contained B9, the result would have
been:
B9
Mask (C3)
Result
ones.
If location 9999 had contained
been:
3C
Mask (C3)
Result
Note: Storage location 9999 remains unchanged.
With the TRANSLATE instruction, System/370 can trans
late data from any code to any other desired code, provided
that each coded character consists of eight bits or fewer. In
the following example
first step is to create a 256-byte table in storage locations
into which you are translating (the function bytes). The
table must be in order, not by the binary values of the char
acters it contains, but by the binary sequence of the
note in the following table that the characters are in the
normal
Translate Table:
-
@
- - -
---
- - -
x y z
E F G H
V W X Y
--
1. The underscores are used to indicate the
of the
2.
a range
bytes can be used.
Now, assume that starting at storage location
is a sequence of
1
Also assume:
Register 12 contains








































































































































































































































































































































