22.02.2015 Views

HLASM Language Reference

HLASM Language Reference

HLASM Language Reference

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Addressing<br />

| reassembling with the NOTHREAD option may avoid the location counter overflow<br />

| condition.<br />

Use of Multiple Location Counters<br />

High Level Assembler lets you use multiple location counters for each individual<br />

control section. Use the LOCTR instruction (see “LOCTR Instruction” on page 191)<br />

to assign different location counters to different parts of a control section. The<br />

assembler then rearranges and assembles the coding together, according to the<br />

different location counters you have specified: all coding using the first location<br />

counter is assembled together, then the coding using the second location counter is<br />

assembled together, and so forth.<br />

An example of the use of multiple location counters is shown in Figure 19. In the<br />

example, executable instructions and data areas have been interspersed<br />

throughout the coding in their logical sequence, each group of instructions<br />

preceded by a LOCTR instruction identifying the location counter under which it is<br />

to be assembled. The assembler rearranges the control section so that the<br />

executable instructions are grouped together and the data areas are grouped<br />

together. Symbols are not resolved in the order they appear in the source<br />

program, but in location counter sequence.<br />

SOURCE MODULE<br />

LINKED MODULE<br />

(shown in source code format)<br />

┌──────────────────────────────────┐ ┌──────────────────────────────────┐ ─┐<br />

│ INST CSECT │ │ │ controlled │<br />

│ LR 12,15 ├──────────────────►│ LR 12,15 │ by INST │<br />

│ USING INST,12 ├──────────────────►│ USING INST,12 │ location │<br />

│ . │ │ . │ counter │<br />

│ . │┌─────────────────►│ TM CODE,X'3' │ │<br />

│ DATA LOCTR ││┌────────────────►│ BM NEWREC │ │<br />

│ INPUTREC DS CL8 ├┼┼───────────┐ │ │ │<br />

│ RECCODE DS CL1 ├┼┼─────────┐ │ │ │ │ control<br />

│ . │││ │ │ │ │ ├── section<br />

│ INST LOCTR │││ │ │ │ │ │ INST<br />

│ TM CODE,X'3' ├┘│ │ │ ├ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ── ─ ┤ │<br />

│ BM NEWREC ├─┘ │ └────►│ INPUTREC DS CL8 │ controlled │<br />

│ . │ └──────►│ RECCODE DS CL1 │ by DATA │<br />

│ DATA LOCTR │ │ . │ location │<br />

│ VAL1 DC F'56' ├──────────────────►│ VAL1 DC F'56' │ counter │<br />

│ VAL2 DC F'84' ├──────────────────►│ VAL2 DC F'84' │ │<br />

│ . │ │ . │ │<br />

│ . │ ├──────────────────────────────────┤ ─┘<br />

│ NEXT CSECT │ │ │ control<br />

│ │ │ │ section<br />

│ │ │ │ NEXT<br />

Figure 19. Use of Multiple Location Counters<br />

| The interactions of the LOCTR instruction with sections, classes, and parts is<br />

| described at “LOCTR Instruction” on page 191.<br />

Addressing<br />

This part of the chapter describes the techniques and introduces the instructions<br />

that let you use symbolic addresses when referring to instructions and data. You<br />

can address code and data that is defined within the same source module, or code<br />

and data that is defined in another source module. Symbolic addresses are more<br />

meaningful and easier to use than the corresponding object code addresses<br />

required for machine instructions. The assembler can convert the symbolic<br />

addresses you specify into their object code form.<br />

Chapter 3. Program Structures and Addressing 63

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

Saved successfully!

Ooh no, something went wrong!