Machine interface instructions

Machine interface (MI) instructions define the operations to be performed by an MI program.

Programs and procedures are the two basic units of execution on the System i® product. Programs come in two flavors: the original program model (OPM) and the Integrated Language Environment® (ILE). MI programs can be created only for the OPM environment. If you require ILE support in the development of your applications, use ILE C, ILE COBOL, ILE CL, or ILE RPG and the built-in MI support provided by the languages.

In the OPM environment, a program consists of two basic components: the object definition table (ODT) and an instruction stream. MI programs are created by using the Create Program (QPRCRTPG) API.

The ODT is the means for defining all objects (program data elements) that are referred to by the MI instruction stream. An ODT definition of an object does not actually allocate storage for the object. It does, however, define when and how much storage is to be allocated and also the attributes of the storage (for example, the data type of the object). The ODT is built from the declare (DCL) statements found in the source used to create a program. Because DCL statements are actually instructions to the QPRCRTPG API and not MI instructions, they are defined in the QPRCRTPG API.

The following types of objects can be declared:
  • Scalar
  • Pointer
  • Machine space pointer
  • Operand list
  • Instruction definition list
  • Exception description
  • Space
  • Constant

The instruction stream defines the set of operations to be performed by the program. The instruction stream is built from the MI instructions found in the source used to create a program. The various MI instructions that you can use are defined in the machine interface information.

Within the source used to create a program, there is a type of statement called a directive. Directive statements can be found in the QPRCRTPG API and are used to do the following:

The program end (PEND) directive must be the last statement in the source, and it functions as a return external (RTX) MI instruction if logically processed as part of the instruction stream.

Noncomment source statements (declares, instructions, and directives) are always ended by a semicolon (;). Comments always begin with a slash and asterisk (/*) and end with an asterisk and slash (*/).