Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
Using structured programming macros HLASM Toolkit Feature User's Guide GC26-8710-10 |
|
The complexity of control flow in a program strongly affects its
readability, the early detection of coding errors, and the
effort needed to modify it later.
You can generally simplify control flow
(though sometimes at the cost of less efficiency and
more redundant code) by restricting the ways in which branches
occur.
One way to restrict branches is to use only those
necessary to implement a few basic structures such as:
If statements exist for all these structures in a programming language, then they are used exclusively. If some are missing, then simple branches are used to simulate those structures but only in standard patterns. In the case of OS assembler language, only the basic branch and branch-and-link instructions are implemented but macros that simulate the first three structures are available. The first two structures are sufficient to implement any "proper" program (that is, with one entry point and one exit) if its blocks of code are suitably ordered. It is assumed that the structures may be nested to any depth. The technique of writing programs using only these structures for branching is known as "structured programming". The standard structured programming figures have been implemented
for the assembler language programmer through the following five
sets of related macros.
|
Copyright IBM Corporation 1990, 2014
|