11.07.2015 Views

HLASM: V1R6 Language Ref

HLASM: V1R6 Language Ref

HLASM: V1R6 Language Ref

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Object program structuresThe following figure illustrates the differences between the object-program models.┌─────────────┐ Class Class Class ─ ─ ─│ │ ┌─────────┬─────────┬─────────┬ ─ ─ ─┐│ Control │ │ │ │ part │ ││ Section │ Section │ element │ element ├─────────┤ ││ │ │ │ │ part │ │├─────────────┤ ├─────────┼─────────┼─────────┼ ─ ─ ─┤│ Control │ │ │ │ │ ││ Section │ Section │ element │ element │ part │ │├─────────────┤ │ │ │ │ │: : ├─────────┼─────────┼─────────┼ ─ ─ ─┤: : : : : : :: : : : : : :└─────────────┘ └─────────┴─────────┴─────────┴ ─ ─ ─┘Load Module Model Program Object ModelSource program structures50 <strong>HLASM</strong>: <strong>V1R6</strong> <strong>Language</strong> <strong>Ref</strong>Figure 12. Load module and Program Object structuresThis part of the chapter explains how to subdivide a large program into smallerparts that are easier to understand and maintain. It also explains how to dividethese smaller parts such as one section or element to contain executableinstructions, and another to contain data constants and work areas.You should consider two different subdivisions when writing an assemblerlanguage program:v The source modulev The control section (load module model), or sections, elements, and parts(program object model)You can divide a program into two or more source modules. Each source moduleis assembled into a separate object module. The object modules can then becombined to form an executable program.You can also divide a source module into two or more sections, or (in the programobject model) into sections containing multiple classes. Each section is assembledas part of the same object module. By writing the correct linker control statements,you can select a complete object module or any individual section of the objectmodule to be linked and later loaded as an executable program.Size of Program ComponentsIf a source module becomes so large that its logic is not easily understood,divide it into smaller modules. For some instructions, at most 4096 bytescan be addressed by one base register. Long-displacement instructionsallow you to address 1048576 bytes with one base register.Communication between Program ComponentsYou must be able to communicate between the components of yourprogram; that is, be able to refer to data in a different component orbranch to an instruction in another component.To communicate between two or more source modules, you must linkthem together with applicable symbolic references.To communicate between two or more sections or elements within a sourcemodule, you must correctly establish the addressability of each to theothers.

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

Saved successfully!

Ooh no, something went wrong!