HLASM Language Reference

HLASM Language Reference HLASM Language Reference

faculty.cs.niu.edu
from faculty.cs.niu.edu More from this publisher
22.02.2015 Views

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

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>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!