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

| For executable sections, the location values that appear in the listings depend on | the THREAD option: | If you specify NOTHREAD, the location counter values for each section, | element, or part restart at 0, except possibly those associated with a first | section initiated by a START instruction with a nonzero address. | If you specify THREAD, location counter values do not restart at 0 for each | subsequent section, element, or part. They continue, after suitable alignment, | from the end of the previous section, element, or part. For reference control sections, the location values that appear in the listings always start from 0. You can continue a control section, element, or part that has been discontinued and, thereby, intersperse code sequences from different control sections, elements, or parts. Note that the location values that appear in the listings for such discontiguous sequences are divided into segments that follow from the end of one segment to the beginning of the subsequent segment. The location values, listed for the next defined control section, element, or part, begin after the last location value assigned to the preceding such item. On VSE, or when you specify the NOGOFF assembler option on MVS and CMS, the maximum value of the location counter and the maximum length of a control | section is 2 24 −1, or X'FFFFFF' bytes. If LIST(133) is in force, then the high-order | is shown as zero. When you specify the GOFF assembler option, the maximum value of the location counter and the maximum length of an element or part is 2 31 −1, or X'7FFFFFFF' bytes. Location Counter and Length Limits | The assembler also maintains a length counter for each individually relocatable | component of the program: executable and reference control sections, elements, | and parts. | If any location counter overflows its maximum value, High Level Assembler issues | the severe error message: | ASMA39S Location counter error | and continues assembling with the location counter value “wrapping” around to | zero. | The length of a section, element, or part cannot exceed the maximum allowed | length described above. If the length counter reaches this maximum value, it stays | fixed at that value without an error condition or error message. Exceeding the | length counter will cause overflow of the location counter, producing the ASMA39S | message. | The location counter setting is relative to the beginning of the location it represents, | and the length counter represents the cumulative length of the control section. This | means that the length counter is nearly always greater than the location counter, | and can exceed its maximum value before the location counter. Even if the | location counter overflows, the length counter value may be correct, and 62 HLASM V1R5 Language Reference

Addressing | reassembling with the NOTHREAD option may avoid the location counter overflow | condition. Use of Multiple Location Counters High Level Assembler lets you use multiple location counters for each individual control section. Use the LOCTR instruction (see “LOCTR Instruction” on page 191) to assign different location counters to different parts of a control section. The assembler then rearranges and assembles the coding together, according to the different location counters you have specified: all coding using the first location counter is assembled together, then the coding using the second location counter is assembled together, and so forth. An example of the use of multiple location counters is shown in Figure 19. In the example, executable instructions and data areas have been interspersed throughout the coding in their logical sequence, each group of instructions preceded by a LOCTR instruction identifying the location counter under which it is to be assembled. The assembler rearranges the control section so that the executable instructions are grouped together and the data areas are grouped together. Symbols are not resolved in the order they appear in the source program, but in location counter sequence. SOURCE MODULE LINKED MODULE (shown in source code format) ┌──────────────────────────────────┐ ┌──────────────────────────────────┐ ─┐ │ INST CSECT │ │ │ controlled │ │ LR 12,15 ├──────────────────►│ LR 12,15 │ by INST │ │ USING INST,12 ├──────────────────►│ USING INST,12 │ location │ │ . │ │ . │ counter │ │ . │┌─────────────────►│ TM CODE,X'3' │ │ │ DATA LOCTR ││┌────────────────►│ BM NEWREC │ │ │ INPUTREC DS CL8 ├┼┼───────────┐ │ │ │ │ RECCODE DS CL1 ├┼┼─────────┐ │ │ │ │ control │ . │││ │ │ │ │ ├── section │ INST LOCTR │││ │ │ │ │ │ INST │ TM CODE,X'3' ├┘│ │ │ ├ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ── ─ ┤ │ │ BM NEWREC ├─┘ │ └────►│ INPUTREC DS CL8 │ controlled │ │ . │ └──────►│ RECCODE DS CL1 │ by DATA │ │ DATA LOCTR │ │ . │ location │ │ VAL1 DC F'56' ├──────────────────►│ VAL1 DC F'56' │ counter │ │ VAL2 DC F'84' ├──────────────────►│ VAL2 DC F'84' │ │ │ . │ │ . │ │ │ . │ ├──────────────────────────────────┤ ─┘ │ NEXT CSECT │ │ │ control │ │ │ │ section │ │ │ │ NEXT Figure 19. Use of Multiple Location Counters | The interactions of the LOCTR instruction with sections, classes, and parts is | described at “LOCTR Instruction” on page 191. Addressing This part of the chapter describes the techniques and introduces the instructions that let you use symbolic addresses when referring to instructions and data. You can address code and data that is defined within the same source module, or code and data that is defined in another source module. Symbolic addresses are more meaningful and easier to use than the corresponding object code addresses required for machine instructions. The assembler can convert the symbolic addresses you specify into their object code form. Chapter 3. Program Structures and Addressing 63

| For executable sections, the location values that appear in the listings depend on<br />

| the THREAD option:<br />

| If you specify NOTHREAD, the location counter values for each section,<br />

| element, or part restart at 0, except possibly those associated with a first<br />

| section initiated by a START instruction with a nonzero address.<br />

| If you specify THREAD, location counter values do not restart at 0 for each<br />

| subsequent section, element, or part. They continue, after suitable alignment,<br />

| from the end of the previous section, element, or part.<br />

For reference control sections, the location values that appear in the listings always<br />

start from 0.<br />

You can continue a control section, element, or part that has been discontinued<br />

and, thereby, intersperse code sequences from different control sections, elements,<br />

or parts. Note that the location values that appear in the listings for such<br />

discontiguous sequences are divided into segments that follow from the end of one<br />

segment to the beginning of the subsequent segment.<br />

The location values, listed for the next defined control section, element, or part,<br />

begin after the last location value assigned to the preceding such item.<br />

On VSE, or when you specify the NOGOFF assembler option on MVS and CMS,<br />

the maximum value of the location counter and the maximum length of a control<br />

| section is 2 24 −1, or X'FFFFFF' bytes. If LIST(133) is in force, then the high-order<br />

| is shown as zero.<br />

When you specify the GOFF assembler option, the maximum value of<br />

the location counter and the maximum length of an element or part is 2 31 −1, or<br />

X'7FFFFFFF' bytes.<br />

Location Counter and Length Limits<br />

| The assembler also maintains a length counter for each individually relocatable<br />

| component of the program: executable and reference control sections, elements,<br />

| and parts.<br />

| If any location counter overflows its maximum value, High Level Assembler issues<br />

| the severe error message:<br />

| ASMA39S Location counter error<br />

| and continues assembling with the location counter value “wrapping” around to<br />

| zero.<br />

| The length of a section, element, or part cannot exceed the maximum allowed<br />

| length described above. If the length counter reaches this maximum value, it stays<br />

| fixed at that value without an error condition or error message. Exceeding the<br />

| length counter will cause overflow of the location counter, producing the ASMA39S<br />

| message.<br />

| The location counter setting is relative to the beginning of the location it represents,<br />

| and the length counter represents the cumulative length of the control section. This<br />

| means that the length counter is nearly always greater than the location counter,<br />

| and can exceed its maximum value before the location counter. Even if the<br />

| location counter overflows, the length counter value may be correct, and<br />

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