Chapter

7. Machine

Interface

Programming

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

This

chapter

is

for

programmers

interested

in

creating

machine

interf

 

grams. While

some

MI instructions are discussed within the context of

 

develop MI programs, this chapter makes no attempt to review the ful

 

instructions. The

goal

of this chapter is to provide a

sufficient ba

 

so

that

you

can

begin

to

use

the

MI

language. After

reading

this

 

should

be

able

to develop, create, run, and debug an

AS/400

MI

prog

 

reading

this

chapter,

you

will

need SystemaccessAPItoRefthe,rence

 

 

 

 

SC41-5801, and theMachine Interface Functional ,ReferenceSC41-5810, because

 

 

 

these

two

books

are

referred

to extensively.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Machine

Interface Instructions—Introduction

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Programs and procedures are the two

basic

units of

execution

on

the

 

grams come in two flavors: the

original

program

model

(OPM)

and

the

Int

 

Language

Environment

(ILE). MI programs can be created only for the OP

 

ronment. If

you

require

ILE support

in

the

development

of your

appli

 

ILE

C

and

its built-in

MI

support.

 

 

 

 

 

 

 

 

 

 

In the OPM environment, a program is comprised of two basic components object definition table (ODT) and an instruction stream. In the case grams, the program is created using the Create Program (QPRCRTPG) API. API is documented inSystemthe API Reference.

 

1

 

 

 

 

the

MI

The ODT is the means for defining thatall objarectsreferred to by

instruction stream. An ODT definition

of an object does not actually a

storage

for the object. It does,

however,

define when

and

how

muc

be allocated and also the attributes of the storage

(for

example,

object). The ODT is built from the

declare

(DCL) statements found

in

used to create a program. Because

DCL statements are actually instru

QPRCRTPG

API and not MI instructions,

they are

defined

in

the

QPRCRTPG

The types of objects that can be declared are:

Scalar

Pointer

Machine space pointer

Operand list

Instruction definition list

Exception description

Space

Constant

The instruction stream defines the set of operations to be performe program. The instruction stream is built from the MI instructions found source used to create a program. The various MI instructions that y

defined in Machinethe Interface Functional .Reference

1

The

term objectsin this

chapter refers to program

data elements and not OS/400 object types such as a *F

 

and

so on.

 

 

Copyright IBM Corp.

1997

7-1

Page 141
Image 141
IBM Version 4 manual Interface Instructions-Introduction, Machine