HLASM Language Reference
HLASM Language Reference HLASM Language Reference
Terms, Literals, and Expressions Self-Defining Terms A self-defining term lets you specify a value explicitly. With self-defining terms, you can also specify decimal, binary, hexadecimal, or character data. If the DBCS assembler option is specified, you can specify a graphic self-defining term that contains pure double-byte data, or include double-byte data in character self-defining terms. These terms have absolute values and can be used as absolute terms in expressions to represent bit configurations, absolute addresses, displacements, length or other modifiers, or duplication factors. Using Self-Defining Terms: Self-defining terms represent machine language binary values and are absolute terms. Their values do not change upon program relocation. Some examples of self-defining terms and the binary values they represent are given below: Self-Defining Term Decimal Value Binary Value 15 15 1111 241 241 1111 1 B'1111' 15 1111 B'11111' 241 1111 1 B'11' 257 1 1 X'F' 15 1111 X'F1' 241 1111 1 X'11' 257 1 1 C'1' 241 1111 1 C'A' 193 11 1 C'AB' 49,62 11 1 11 1 G'' 17,89 1 1 11 1 The assembler carries the values represented by self-defining terms to 4 bytes or 32 bits, the high-order bit of which is the sign bit. (A '1' in the sign bit indicates a negative value; a '0' indicates a positive value.) The use of a self-defining term is distinct from the use of data constants or literals. When you use a self-defining term in a machine instruction statement, its value is used to determine the binary value that is assembled into the instruction. When a data constant is referred to or a literal is specified in the operand of an instruction, its address is assembled into the instruction. Self-defining terms are always right-justified. Truncation or padding with zeros, if necessary, occurs on the left. Decimal Self-Defining Term: A decimal self-defining term is simply an unsigned decimal number written as a sequence of decimal digits. High-order zeros may be used (for example, 7). Limitations on the value of the term depend on its use. For example, a decimal term that designates a general register should have a value between 0 and 15. A decimal term that represents an address should not exceed the size of storage. In any case, a decimal term may not consist of more than 10 digits, nor exceed 2,147,483,647 (2 31 −1). A decimal self-defining term is assembled as its binary equivalent. Some examples of decimal self-defining terms are: 8, 147, 492, and 21. 34 HLASM V1R5 Language Reference
Terms, Literals, and Expressions Hexadecimal Self-Defining Term: A hexadecimal self-defining term consists of 1-to-8 hexadecimal digits enclosed in single quotation marks and preceded by the letter X; for example, X'C49'. Each hexadecimal digit is assembled as its 4-bit binary equivalent. Thus, a hexadecimal term used to represent an 8-bit mask would consist of 2 hexadecimal digits. The maximum value of a hexadecimal term is X'FFFFFFFF'; this allows a range of values from −2,147,483,648 through 2,147,483,647. The hexadecimal digits and their bit patterns are as follows: - 4 - 1 8 - 1 C - 11 1 - 1 5 - 11 9 - 11 D - 111 2 - 1 6 - 11 A - 11 E - 111 3 - 11 7 - 111 B - 111 F - 1111 When used as an absolute term in an expression, a hexadecimal self-defining term has a negative value if the high-order bit is 1. Binary Self-Defining Term: A binary self-defining term is written as an unsigned sequence of 1s and 0s enclosed in single quotation marks and preceded by the letter B; for example, B'1111'. A binary term may have up to 32 bits. This allows a range of values from −2,147,483,648 through 2,147,483,647. When used as an absolute term in an expression, a binary self-defining term has a negative value if the term is 32 bits long and the high-order bit is 1. Binary representation is used primarily in designating bit patterns of masks or in logical operations. The following shows a binary term used as a mask in a Test Under Mask (TM) instruction. The contents of GAMMA are to be tested, bit by bit, against the pattern of bits represented by the binary term. ALPHA TM GAMMA,B'11111' Character Self-Defining Term: A character self-defining term consists of 1-to-4 characters enclosed in single quotation marks, and must be preceded by the letter C. All letters, decimal digits, and special characters may be used in a character self-defining term. In addition, any of the remaining EBCDIC characters may be designated in a character self-defining term. Examples of character self-defining terms are: C'/' C' ' (space) C'ABC' C'13' Because of the use of single quotation marks in the assembler language and ampersands in the macro language as syntactic characters, the following rule must be observed when using these characters in a character self-defining term: For each single quotation mark or ampersand you want in a character self-defining term, two single quotation marks or ampersands must be written. For example, the character value A'# would be written as 'A''#', while a single quotation mark followed by a space and another single quotation mark would be written as ''' '''. Chapter 2. Coding and Structure 35
- Page 4 and 5: Note! Before using this information
- Page 6 and 7: Contents Source Module . . . . . .
- Page 8 and 9: Contents Ordinary USING Instruction
- Page 10 and 11: Contents Sublists in Operands . . .
- Page 12 and 13: About this Manual This manual descr
- Page 14 and 15: IBM High Level Assembler for MVS &
- Page 16 and 17: | The Internet. You can access IBM
- Page 18 and 19: ▌C▐ The item referred to by ▌
- Page 20 and 21: Miscellany The ASCII translation t
- Page 22 and 23: Part 1. Assembler Language—Struct
- Page 24 and 25: Language Compatibility Language Com
- Page 26 and 27: Assembler Program Assembler Program
- Page 28 and 29: Relationship of Assembler to Operat
- Page 30 and 31: Coding Made Easier Linkage between
- Page 32 and 33: Character Set Compatibility with Ea
- Page 34 and 35: Assembler Language Coding Conventio
- Page 36 and 37: Assembler Language Coding Conventio
- Page 38 and 39: Assembler Language Coding Conventio
- Page 40 and 41: Assembler Language Coding Conventio
- Page 42 and 43: Assembler Language Structure Condit
- Page 44 and 45: Assembler Language Structure Machin
- Page 46 and 47: Assembler Language Structure Condit
- Page 48 and 49: Terms, Literals, and Expressions Te
- Page 50 and 51: Terms, Literals, and Expressions -
- Page 52 and 53: Terms, Literals, and Expressions As
- Page 56 and 57: Terms, Literals, and Expressions Fo
- Page 58 and 59: Terms, Literals, and Expressions I
- Page 60 and 61: Terms, Literals, and Expressions Th
- Page 62 and 63: Terms, Literals, and Expressions 1.
- Page 64 and 65: Terms, Literals, and Expressions
- Page 66 and 67: Terms, Literals, and Expressions
- Page 68 and 69: Terms, Literals, and Expressions Th
- Page 70 and 71: | Chapter 3. Program Structures and
- Page 72 and 73: Source Module A source module is co
- Page 74 and 75: The CSECT instruction can be used a
- Page 76 and 77: | in linker control statements for
- Page 78 and 79: This is not only convenient, but it
- Page 80 and 81: | SECT_A CSECT , Define section SEC
- Page 82 and 83: | For executable sections, the loca
- Page 84 and 85: Addressing | The System/390® and z
- Page 86 and 87: Addressing | Parts must always be r
- Page 88 and 89: Addressing Literal Pools ALPHA LR 3
- Page 90 and 91: Addressing If the symbol is the nam
- Page 92 and 93: Addressing External Symbol Dictiona
- Page 94 and 95: Addressing 74 HLASM V1R5 Language R
- Page 96 and 97: Part 2. Machine and Assembler Instr
- Page 98 and 99: General Instructions Chapter 4. Mac
- Page 100 and 101: Input/Output Operations For further
- Page 102 and 103: Branching with Extended Mnemonic Co
Terms, Literals, and Expressions<br />
Self-Defining Terms<br />
A self-defining term lets you specify a value explicitly. With self-defining terms, you<br />
can also specify decimal, binary, hexadecimal, or character data. If the DBCS<br />
assembler option is specified, you can specify a graphic self-defining term that<br />
contains pure double-byte data, or include double-byte data in character<br />
self-defining terms. These terms have absolute values and can be used as<br />
absolute terms in expressions to represent bit configurations, absolute addresses,<br />
displacements, length or other modifiers, or duplication factors.<br />
Using Self-Defining Terms: Self-defining terms represent machine language<br />
binary values and are absolute terms. Their values do not change upon program<br />
relocation. Some examples of self-defining terms and the binary values they<br />
represent are given below:<br />
Self-Defining Term Decimal Value Binary Value<br />
15 15 1111<br />
241 241 1111 1<br />
B'1111' 15 1111<br />
B'11111' 241 1111 1<br />
B'11' 257 1 1<br />
X'F' 15 1111<br />
X'F1' 241 1111 1<br />
X'11' 257 1 1<br />
C'1' 241 1111 1<br />
C'A' 193 11 1<br />
C'AB' 49,62 11 1 11 1<br />
G'' 17,89 1 1 11 1<br />
The assembler carries the values represented by self-defining terms to 4 bytes or<br />
32 bits, the high-order bit of which is the sign bit. (A '1' in the sign bit indicates a<br />
negative value; a '0' indicates a positive value.)<br />
The use of a self-defining term is distinct from the use of data constants or literals.<br />
When you use a self-defining term in a machine instruction statement, its value is<br />
used to determine the binary value that is assembled into the instruction. When a<br />
data constant is referred to or a literal is specified in the operand of an instruction,<br />
its address is assembled into the instruction. Self-defining terms are always<br />
right-justified. Truncation or padding with zeros, if necessary, occurs on the left.<br />
Decimal Self-Defining Term: A decimal self-defining term is simply an unsigned<br />
decimal number written as a sequence of decimal digits. High-order zeros may be<br />
used (for example, 7). Limitations on the value of the term depend on its use.<br />
For example, a decimal term that designates a general register should have a value<br />
between 0 and 15. A decimal term that represents an address should not exceed<br />
the size of storage. In any case, a decimal term may not consist of more than 10<br />
digits, nor exceed 2,147,483,647 (2 31 −1). A decimal self-defining term is<br />
assembled as its binary equivalent. Some examples of decimal self-defining terms<br />
are: 8, 147, 492, and 21.<br />
34 <strong>HLASM</strong> V1R5 <strong>Language</strong> <strong>Reference</strong>