HLASM Language Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Source program structures

HLASM Language Reference
SC26-4940-06

This part of the chapter explains how to subdivide a large program into smaller parts that are easier to understand and maintain. It also explains how to divide these smaller parts such as one section or element to contain executable instructions, and another to contain data constants and work areas.

You should consider two different subdivisions when writing an assembler language program:
  • The source module
  • 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 module is assembled into a separate object module. The object modules can then be combined to form an executable program.

You can also divide a source module into two or more sections, or (in the program object model) into sections containing multiple classes. Each section is assembled as 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 object module to be linked and later loaded as an executable program.

Size of Program Components
If a source module becomes so large that its logic is not easily understood, divide it into smaller modules. For some instructions, at most 4096 bytes can be addressed by one base register. Long-displacement instructions allow you to address 1048576 bytes with one base register.
Communication between Program Components
You must be able to communicate between the components of your program; that is, be able to refer to data in a different component or branch to an instruction in another component.

To communicate between two or more source modules, you must link them together with applicable symbolic references.

To communicate between two or more sections or elements within a source module, you must correctly establish the addressability of each to the others.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014