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 For C-type character self-defining terms, each character in the character sequence is assembled as its 8-bit code equivalent (see Appendix D, “Standard Character Set Code Table” on page 421). The two single quotation marks or ampersands that must be used to represent a single quotation mark or ampersand within the character sequence are assembled as a single quotation mark or ampersand. Double-byte data may appear in a character self-defining term, if the DBCS assembler option is specified. The assembled value includes the SO and SI delimiters. Hence a character self-defining term containing double-byte data is limited to one double-byte character delimited by SO and SI. For example, C''. Since the SO and SI are stored, the null double-byte character string, C'', is also a valid character self-defining term. Note: The assembler will not support character self-defining terms of the form CU'x' because self-defining terms are required by definition of the Assembler Language to have fixed values. Graphic Self-Defining Term: If the DBCS assembler option is specified, a graphic self-defining term can be specified. A graphic self-defining term consists of 1 or 2 double-byte characters delimited by SO and SI, enclosed in single quotation marks and preceded by the letter G. Any valid double-byte characters may be used. Examples of graphic self-defining terms are: G'' G'' G'' G'' The SO and SI are not represented in the assembled value of the self-defining term, hence the assembled value is pure double-byte data. A redundant SI/SO pair can be present between two double-byte characters, as shown in the last of the above examples. However, if SO and SI are used without an intervening double-byte character, this error is issued: ASMA148E Self-defining term lacks ending quote or has bad character Location Counter The assembler maintains a location counter to assign storage addresses to your | program statements. It is the assembler's equivalent of the execution-time instruction counter in the computer. You can refer to the current value of the | location counter at any place in a source module by specifying an asterisk () as a term in an operand. As the instructions and constants of a source module are being assembled, the location counter has a value that indicates a location in the program. The assembler increments the location counter according to the following: 1. After an instruction or constant has been assembled, the location counter indicates the next available location. 2. Before assembling the current instruction or constant, the assembler checks the boundary alignment required for it and adjusts the location counter, if necessary, to the correct boundary. 3. While the instruction or constant is being assembled, the location counter value does not change. It indicates the location of the current data after boundary 36 HLASM V1R5 Language Reference

Terms, Literals, and Expressions alignment and is the value assigned to the symbol, if present, in the name field of the statement. 4. After assembling the instruction or constant, the assembler increments the location counter by the length of the assembled data to indicate the next available location. These rules are shown below: Location in Source Hexadecimal Statements 4 DONE DC CL3'ABC' 7 BEFORE EQU 8 DURING DC F'2' C AFTER EQU 1 NEXT DS D You can specify multiple location counters for each control section in a source module; for more details about the location counter setting in control sections, see “Location Counter Setting” on page 61. Maximum Location Counter Value: The assembler carries internal location | counter values as 4-byte (31-bit unsigned) values. When you specify the NOGOFF assembler option, the assembler uses only the low-order 3 bytes for the location | counter, and prints only the low-order 3 bytes in the assembly source and object | code listing if the LIST(121) option is active. All four bytes are displayed if the | LIST(133) option is active. In this case the maximum valid location counter value is 2 24 −1. | When you specify the GOFF assembler option, the assembler requires | the LIST(133) option, and uses the entire 4-byte value for the location counter and prints the 4-byte value in the assembly listings. In this case the maximum valid location counter value is 2 31 −1. If the location counter exceeds its valid maximum value the assembler issues error message ASMA39S Location counter error Controlling the Location Counter Value: You can control the setting of the location counter in a particular control section by using the START or ORG instruction, described in Chapter 3, “Program Structures and Addressing” and Chapter 5, “Assembler Instruction Statements,” respectively. The counter affected by either of these assembler instructions is the counter for the control section in which they appear. Location Counter Reference: You can refer to the current value of the location counter at any place in a program by using an asterisk as a term in an operand. The asterisk is a relocatable term, specified according to the following rules: The asterisk can be specified only in the operands of: – Machine instructions – DC and DS instructions – EQU, ORG, and USING instructions Chapter 2. Coding and Structure 37

Terms, Literals, and Expressions<br />

For C-type character self-defining terms, each character in the character sequence<br />

is assembled as its 8-bit code equivalent (see Appendix D, “Standard Character<br />

Set Code Table” on page 421). The two single quotation marks or ampersands<br />

that must be used to represent a single quotation mark or ampersand within the<br />

character sequence are assembled as a single quotation mark or ampersand.<br />

Double-byte data may appear in a character self-defining term, if the DBCS<br />

assembler option is specified. The assembled value includes the SO and SI<br />

delimiters. Hence a character self-defining term containing double-byte data is<br />

limited to one double-byte character delimited by SO and SI. For example,<br />

C''.<br />

Since the SO and SI are stored, the null double-byte character string, C'', is also<br />

a valid character self-defining term.<br />

Note: The assembler will not support character self-defining terms of the form<br />

CU'x' because self-defining terms are required by definition of the Assembler<br />

<strong>Language</strong> to have fixed values.<br />

Graphic Self-Defining Term: If the DBCS assembler option is specified, a<br />

graphic self-defining term can be specified. A graphic self-defining term consists of<br />

1 or 2 double-byte characters delimited by SO and SI, enclosed in single quotation<br />

marks and preceded by the letter G. Any valid double-byte characters may be<br />

used. Examples of graphic self-defining terms are:<br />

G''<br />

G''<br />

G''<br />

G''<br />

The SO and SI are not represented in the assembled value of the self-defining<br />

term, hence the assembled value is pure double-byte data. A redundant SI/SO pair<br />

can be present between two double-byte characters, as shown in the last of the<br />

above examples. However, if SO and SI are used without an intervening<br />

double-byte character, this error is issued:<br />

ASMA148E Self-defining term lacks ending quote or has bad character<br />

Location Counter<br />

The assembler maintains a location counter to assign storage addresses to your<br />

| program statements. It is the assembler's equivalent of the execution-time<br />

instruction counter in the computer. You can refer to the current value of the<br />

| location counter at any place in a source module by specifying an asterisk () as a<br />

term in an operand.<br />

As the instructions and constants of a source module are being assembled, the<br />

location counter has a value that indicates a location in the program. The<br />

assembler increments the location counter according to the following:<br />

1. After an instruction or constant has been assembled, the location counter<br />

indicates the next available location.<br />

2. Before assembling the current instruction or constant, the assembler checks the<br />

boundary alignment required for it and adjusts the location counter, if<br />

necessary, to the correct boundary.<br />

3. While the instruction or constant is being assembled, the location counter value<br />

does not change. It indicates the location of the current data after boundary<br />

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