Previous Table of Contents Next


The purpose for having both programs and service programs is to support two types of static calls. The two types are bound by copy and bound by reference. Bound-by-copy calls allow multiple modules to be copied together into a single program. As we just saw, the program itself is called with a dynamic call, but then the procedures within any of the modules are called with static calls. Because all procedure names are resolved to addresses at compile time, this type of static call within the program is much faster than a dynamic call. The downside of bound-by-copy calls is that multiple copies of the same module may exist in memory if the module is bound into multiple programs. Memory utilization is traded off for better call performance.

Bound-by-reference calls use a service program to store the modules. Unlike bound-by-copy calls, which copy the modules into the program, bound-by-reference calls store in the program symbolic links to the modules in the service program. With this type of call, there is only a single copy of the service program. When a program is activated, those links are resolved to the address of a table in the service program that contains the addresses of the called procedures. There is some additional overhead when a program is activated, because other functions such as authority resolution (covered in Chapter 7) are also performed. During execution of the program, however, the performance is about the same as a bound-by-copy call.

For both early bound methods, the system uses a new call bound procedure (CALLB) instruction. Another new instruction, call program (CALLPGM), supports late binding and replaces the OPM call external instruction. Figure 4.3 on the following page shows the structure of the ILE program model compilers.


Figure 4.3  ILE Program Model Compilers

The ILE compiler front end produces a common intermediate form called W-code. W-code is a more modern intermediate form than is U-code. The back end of these compilers is called CUBE-3. The 3 designates this as the third, and latest, generation of IBM compiler technology. CUBE-3 and W-code are designed to very efficiently support RISC processors. Other IBM systems, most notably the RS/6000, use the same technologies. The back end of the ILE compiler generates the ILE program template directly, eliminating IRP and the PRM step. To provide the necessary optimization for the RISC processors, W-code-like computation and branching instructions were added to the MI, as we discuss in a later section.

The ILE program model is an extension to the MI architecture. It is the only program model for the RISC processors. On the IMPI systems, the ILE and the OPM/EPM program models coexist, so that compiled code from the earlier compilers, as well as the compilers themselves, can be on the same system.

Moving an OPM/EPM program to a RISC-based system causes the program to be converted internally to the ILE program model. Figure 4.4 on page 73 shows the compile steps for an OPM or an EPM compiler on a V4 RISC-based system. When one of these earlier language compilers is used on the new RISC models, an extra step is involved. The output of these compilers (Original MI template) has to be converted to the ILE MI template. The component that does this conversion is called Magic because the conversion happens as if by magic.


Figure 4.4  OPM and EPM Compilers on V4 RISC

Characteristics of the Machine Interface

Because many MI instructions are very high function, we often describe the MI as a high-level machine interface when we are comparing it with a conventional machine interface. For example, not too many conventional machine interfaces have call instructions that support both early and late binding. A conventional interface is more likely to have just branch instructions.

To see the difference, consider an instruction for the conventional machine interface in Figure 4.5 on page 74. An instruction has both an operation code (op-code) and one or more operand fields. The types of instructions supported are computational (every computer has an add instruction), branching, and data manipulation. More important than the operations performed are the operands that the instructions use.


Figure 4.5  Conventional Machine Interface

Conventional machine interfaces work on the contents of registers, memory, or immediate data in the instruction itself. In other words, they do not know about application or operating-system data. Take a standard “add register” instruction. The instruction identifies two specific registers in the hardware. The operation performed is to take the bits from one register, add them to the bits in the other register, and put the result someplace. The bits have no meaning to the instruction. The software cares about the meaning of the bits, but the instruction doesn’t. The machine does not care what is there; it is just a bit configuration that runs through an algorithm called add. The fact that the two registers contain the names of two employees, so that treating them as operands for an add instruction makes no sense, is of no consequence. Operations at this level are simply working on the contents of the registers or memory.

As discussed earlier, this structure has the problem that it is very hardware-technology dependent. Because the instructions see the address space, the I/O space, and the register space, they are tied to these physical structures. Changes to these physical structures can cause changes to the instructions. Therefore, existing programs could have major conversion problems.

The AS/400 machine interface in Figure 4.6 is different. It has an instruction set with op-codes and operands similar to the conventional machine. The AS/400 machine interface also has various types of operations for computation (add instructions) and branching that work on traditional operands. Unlike the conventional machine, it has instructions similar to the intermediate representations found in a modern HLL compiler, and data structures (objects) as part of the machine design.


Figure 4.6  AS/400 Machine Interface

The most important difference here relates not to the instructions or operations themselves, but to the operands that the instructions use. The conventional machine has memory, registers, and immediate data. On the AS/400, we still have immediate data but no registers or memory. Instead, there are objects.


Previous Table of Contents Next

Copyright © NEWS/400 Books