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 “Location Counter Reference” on page 37 describes how you can use the current location counter in a literal. | The rules for determining whether two literals are identical are: | 1. A literal which contains a location counter reference is not identical to any other | literal. | 2. Otherwise, two literals are identical (and will be generated only once), if their | source forms are identical. Contrast with Immediate Data: You should not confuse a literal with the immediate data in an SI instruction. Immediate data is assembled into the instruction. Literal Pool The literals processed by the assembler are collected and placed in a special area called the literal pool. You can control the positioning of the literal pool. Unless otherwise specified, the literal pool is placed at the end of the first control section. You can also specify that multiple literal pools be created. However, the assembler controls the sequence in which literals are ordered within the pool. Further information on positioning literal pools is in “LTORG Instruction” on page 193. Expressions This section discusses the expressions used in coding operand entries for source statements. You can use an expression to specify: An address An explicit length A modifier A duplication factor A complete operand Expressions have absolute and relocatable values. Whether an expression is absolute or relocatable depends on the value of the terms it contains. The assembler evaluates relocatable and absolute expressions at assembly time. Figure 16 on page 45 shows examples of valid expressions. | In addition to expressions used in coding operand entries, there are three types of expression that you can use only in conditional assembly instructions: arithmetic, logical, and character expressions. They are evaluated during conditional | assembly. For more information, see “Assigning Values to SET Symbols” on | page 347. An expression is composed of a single term or an arithmetic combination of terms. The assembler reduces multiterm expressions to single values. Thus, you do not have to compute these values yourself. The following are examples of valid expressions: 44 HLASM V1R5 Language Reference

Terms, Literals, and Expressions BETA1 AREA1+X'2D' B'11' +32 C'ABC' N–25 29 FIELD+332 L'FIELD FIELD LAMBDA+GAMMA (EXIT–ENTRY+1)+GO TEN/TWO ALPHA–BETA/(1+AREAL'FIELD)–1 =F'1234' =A(1,133,175,221)+8 Figure 16. Examples of Valid Expressions Rules for Coding Expressions The rules for coding an absolute or relocatable expression are: Unary (operating on one value) operators and binary (operating on two values) operators are allowed in expressions. An expression can have one or more unary operators preceding any term in the expression or at the beginning of the expression. An expression must not begin with a binary operator, nor can it contain two | binary operators in succession. When + and − are used as prefix operators, | then they are unary, and not binary, operators. | An expression starting with is interpreted as a location counter reference, and | not a multiplication operator. An expression must not contain two terms in succession. No spaces are allowed between an operator and a term, nor between two successive operators. An expression can contain any number of unary and binary operators, and any number of levels of parentheses. A single relocatable term is not allowed in a multiply or divide operation. Note that paired relocatable terms have absolute values and can be multiplied and divided if they are enclosed in parentheses. See “Paired Relocatable Terms” on page 47. Figure 17 on page 46 shows the definitions of absolute and relocatable expressions. Chapter 2. Coding and Structure 45

Terms, Literals, and Expressions<br />

“Location Counter <strong>Reference</strong>” on page 37 describes how you can use the current<br />

location counter in a literal.<br />

| The rules for determining whether two literals are identical are:<br />

| 1. A literal which contains a location counter reference is not identical to any other<br />

| literal.<br />

| 2. Otherwise, two literals are identical (and will be generated only once), if their<br />

| source forms are identical.<br />

Contrast with Immediate Data: You should not confuse a literal with the<br />

immediate data in an SI instruction. Immediate data is assembled into the<br />

instruction.<br />

Literal Pool<br />

The literals processed by the assembler are collected and placed in a special area<br />

called the literal pool. You can control the positioning of the literal pool. Unless<br />

otherwise specified, the literal pool is placed at the end of the first control section.<br />

You can also specify that multiple literal pools be created. However, the assembler<br />

controls the sequence in which literals are ordered within the pool. Further<br />

information on positioning literal pools is in “LTORG Instruction” on page 193.<br />

Expressions<br />

This section discusses the expressions used in coding operand entries for source<br />

statements. You can use an expression to specify:<br />

An address<br />

An explicit length<br />

A modifier<br />

A duplication factor<br />

A complete operand<br />

Expressions have absolute and relocatable values. Whether an expression is<br />

absolute or relocatable depends on the value of the terms it contains. The<br />

assembler evaluates relocatable and absolute expressions at assembly time.<br />

Figure 16 on page 45 shows examples of valid expressions.<br />

| In addition to expressions used in coding operand entries, there are three types of<br />

expression that you can use only in conditional assembly instructions: arithmetic,<br />

logical, and character expressions. They are evaluated during conditional<br />

| assembly. For more information, see “Assigning Values to SET Symbols” on<br />

| page 347.<br />

An expression is composed of a single term or an arithmetic combination of terms.<br />

The assembler reduces multiterm expressions to single values. Thus, you do not<br />

have to compute these values yourself. The following are examples of valid<br />

expressions:<br />

44 <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!