Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
Hexadecimal constant—X HLASM Language Reference SC26-4940-06 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Hexadecimal constants generate large bit patterns more conveniently than binary constants. Also, the hexadecimal values you specify in a source module let you compare them directly with the hexadecimal values generated for the object code and address locations printed in the program listing. Each hexadecimal digit (see 1 in Table 1) specified in the nominal value subfield is assembled into four bits (their binary patterns can be found in Self-defining terms). The implicit length in bytes of a hexadecimal constant is then half the number of hexadecimal digits specified (assuming that a high-order hexadecimal zero is added to an odd number of digits). See 2 and 3 in Table 1. An 8-digit hexadecimal constant provides a convenient way to set
the bit pattern of a full binary word. The constant in the following
example sets the first and third bytes of a word with all 1 bits.
The DS instruction sets the location counter to a fullword boundary. (See DS instruction.) The next example uses a hexadecimal constant as a literal and inserts
a byte of all 1 bits into the rightmost 8 bits of register 5.
In the following example, the digit A is dropped, because 5 hexadecimal
digits are specified for a length of 2 bytes:
The resulting constant is 6F4E, which occupies the specified 2
bytes. It is duplicated three times, as requested by the duplication
factor. If it is specified as:
the
resulting constant has a hexadecimal zero in the leftmost position.
|
Copyright IBM Corporation 1990, 2014
|