5. The characteristic is developed from the exponent and
converted to binary.
base + = characteristic
64 + 2 =66 =1000010 6. The fraction is converted to binary and grouped hexa decimally. 0.954 16 == .1001 0101 0100 7. The characteristic and the fraction are stored in the
short format. The sign position contains the sign of the
fraction.SChar Fraction
o1000010 1001 0101 0100 0000 0000 0000 The following are sample normalized short floating-point
numbers. The last two numbers represent the smallest and
the largest positive normalized numbers.
Number Powers of 76.E Fraction 1.0 = +1/16 x 16
1
=0 100 0001 0001 0000 0000 0000 0000 0000 0.5 = +8/16 x 16° = 0 100 0000 1000 0000 0000 0000 0000 0000 1/64 = +4/16 x 16-
1
=0 011 1111 0100 0000 0000 0000 0000 0000 0.0 = +0 x 16-
64= 0 000 0000 0000 0000 0000 0000 0000 0000 -15.0 =-15/16x16
1
=110000011111000000000000 0000 0000 5.4 x 10-
79 = 0 000 0000 000100000000 0000 0000 0000 7.2xl0
75 ';t (1-16-
6
)x16
630 1111111111111111111111111111111
Instruction-Use Examples
The following examples illustrate the use of many System/370
instructions. Before studying one of these examples, the
reader should first consult the instruction description in this
manual for the particular instruction of interest to him.Please note that this publication, and the instruction-use
examples, are written principally for assembly-languagepro grammers, to be used in conjunction with the appropriate
assembly-language manuals.
For clarity, and for ease in programming, each example in
this section presents the instruction both as it is written in
an assembly-language statement and as it appears when
assembled in storage (machine format).
Machine Format
As a rule, all machine format numerical operands are written
in hexadecimal notation unless otherwise specified.Hexa decimal operands are shown converted into binary, decimal,
or both, if such conversion helps to clarify the example for
the reader. Storage addresses are also given in hexadecimal.
Assembly-Language Format
In assembly-language statements, registers, lengths, and
masks are all presented in decimal, but displacements may
be in hexadecimal or decimal. (A hexadecimal displacement
is indicated by X'n', where n can rangefrom OOO-FFF.) Im mediate operands are normally shown in hexadecimal. When-
ever the value in a register or storage location is referred to
as"not significant," this value is replaced during the execu tion of the instruction.
WhenSS-format instructions are written in System/370
assembly language, lengths are given as the total number of
bytes in the field. This differs from the machine definition,
in which the length field specifies the number of bytes to
be added to the field address to obtain the address of the
last byte of the field. Thus, the machine length is one less
than the assembly-language length. The assembly program
automatically subtracts one from the length specified when
the instruction is assembled.
In some of the examples, symbolic addresses are used in
order to simplify the examples. In assembly-languagestate ments, a symbolic address is represented as a mnemonic
term written in all capitals, such as FLAGS, which is used
to denote the address of a storage location used to contain
data or program-control information. When symbolicad dresses are used, the assembler supplies actual base and dis placement values according to the USING and DROP assembler instructions.
When symbolic addresses are used in the example, the
values for base and displacement are not shown in the
assembly-language format or in the machine-language format.
For assembly-language formats, the letterS in the labels
that designate instruction fields is used to indicate thecom bination of base and displacement fields for an operand
address. (For example,S 1 represents the combination of
Bl and Dl.) In the machine-language format, the base and
displacement address components are shown as asterisks (*).
Add Halfword (AH)
The ADD HALFWORD instruction algebraically adds the
halfword contents of a storage location to the contents of a
register. The halfword storage operand is expanded to 32
bits after it is fetched and before it is used in the addoper ation. The expansion consists in propagating the leftmost
(sign) bit 16 positions to the left. For example, assume that
the contents of storage locations2000-2001 are to be added
to register 5. Initially:
Register 5 contains00 00 00 19 = 2510 Storage locations 2000-2001 contain FF FE == -2 1 0 Register 12 contains 00 00 18 00. Register 13 contains 00 00 01 50. The format of the required instruction is:
Machine FormatOp Code R1 X
2
8
202 4A I 5 I ° I C 6
8
9 Assembler Format Op Code R
1
,02 (X2, 82)
AH 5, X'680'(13,12)
Appendix I. Number Representation and Instruction-Use Examples 291
converted to binary.
base +
64 + 2 =66 =
short format. The sign position contains the sign of the
fraction.
o
numbers. The last two numbers represent the smallest and
the largest positive normalized numbers.
Number Powers of 76
1
=
1
=
64
1
=
79
75
6
)x16
63
Instruction-Use Examples
The following examples illustrate the use of many System/370
instructions. Before studying one of these examples, the
reader should first consult the instruction description in this
manual for the particular instruction of interest to him.
examples, are written principally for assembly-language
assembly-language manuals.
For clarity, and for ease in programming, each example in
this section presents the instruction both as it is written in
an assembly-language statement and as it appears when
assembled in storage (machine format).
Machine Format
As a rule, all machine format numerical operands are written
in hexadecimal notation unless otherwise specified.
or both, if such conversion helps to clarify the example for
the reader. Storage addresses are also given in hexadecimal.
Assembly-Language Format
In assembly-language statements, registers, lengths, and
masks are all presented in decimal, but displacements may
be in hexadecimal or decimal. (A hexadecimal displacement
is indicated by X'n', where n can range
ever the value in a register or storage location is referred to
as
When
assembly language, lengths are given as the total number of
bytes in the field. This differs from the machine definition,
in which the length field specifies the number of bytes to
be added to the field address to obtain the address of the
last byte of the field. Thus, the machine length is one less
than the assembly-language length. The assembly program
automatically subtracts one from the length specified when
the instruction is assembled.
In some of the examples, symbolic addresses are used in
order to simplify the examples. In assembly-language
term written in all capitals, such as FLAGS, which is used
to denote the address of a storage location used to contain
data or program-control information. When symbolic
When symbolic addresses are used in the example, the
values for base and displacement are not shown in the
assembly-language format or in the machine-language format.
For assembly-language formats, the letter
that designate instruction fields is used to indicate the
address. (For example,
Bl and Dl.) In the machine-language format, the base and
displacement address components are shown as asterisks (*).
Add Halfword (AH)
The ADD HALFWORD instruction algebraically adds the
halfword contents of a storage location to the contents of a
register. The halfword storage operand is expanded to 32
bits after it is fetched and before it is used in the add
(sign) bit 16 positions to the left. For example, assume that
the contents of storage locations
to register 5. Initially:
Register 5 contains
Machine Format
2
8
2
8
9
1
,
AH 5, X'680'(13,12)
Appendix I. Number Representation and Instruction-Use Examples 291








































































































































































































































































































































