| Previous | Table of Contents | Next |
The formats for three OPM MI instructions are shown in Figures 4.9a, 4.9b, and 4.9c, respectively. The basic Add Numeric (ADDN) instruction has the hexadecimal5 op-code 1043. Being a computational instruction, the basic add function is specified by the 43 in the op-code. This instruction also has three operands.
5Hexadecimal is a number system to the base 16. The 16 digits used in this number system are 0 - 9 and A - F. Hexadecimal is often used as a shorthand notation instead of showing bit patterns. Each four-bit field can be represented as a hex digit. Thus, 0001 is a hex digit 1 and 1111 is a hex digit F.
Figure 4.9a Add Numeric (ADDN) Instruction
Figure 4.9b Branch (B) Instruction
Figure 4.9c Copy Bytes Left-Adjusted with Pad (CPYBLAP) Instruction
Table 4.2 shows the other 11 forms of Add Numeric. The various forms are created by combining the options of short, round, indicator, and branch. Note that the basic function is still 43.
| ADDNS | 1143 | Short | |
| ADDNR | 1243 | Round | |
| ADDNSR | 1343 | Short, Round | |
| ADDNI | 1843 | Indicator | |
| ADDNIS | 1943 | Indicator, Short | |
| ADDNIR | 1A43 | Indicator, Round | |
| ADDNISR | 1B43 | Indicator, Short, Round | |
| ADDNB | 1C43 | Branch | |
| ADDNBS | 1D43 | Branch, Short | |
| ADDNBR | 1E43 | Branch, Round | |
| ADDNBSR | 1F43 | Branch, Short, Round | |
The Branch instruction (Figure 4.9b) has only one operand, the branch target. This is an unconditional branch. MI does not have a separate conditional branch. All conditional branching is done in conjunction with a computational instruction. Because Branch is a noncomputational instruction, it does not have optional forms like Add Numeric does.
The third instruction shown (Figure 4.9c) has the wonderful name Copy Bytes Left-Adjusted with Pad, or CPYBLAP for short. This instruction provides the capability to copy a string of bytes from one field to another. The bytes are left-adjusted in the receiver field, and if the source has fewer bytes than the receiver, the pad is used to fill the remaining bytes. As expected, this is but one of many copy instructions at the MI. Copying data is a function that is heavily used in most commercial applications. Readers might recognize that CPYBLAP is equivalent to the Cobol MOVE statement and the RPG MOVEL with a P in the half-adjust column.
These are but three of the MI instructions; there are hundreds and hundreds of others. In this section we have examined only the OPM computation and branching types of MI instructions. As mentioned earlier, there are also computational and branching types to support the ILE. Later chapters show how many of the instructions that operate on objects, which we did not discuss, are used.
The technology independence that the MI provides is extremely important because it doesnt force changes to user applications or to OS/400. New hardware can be added and fully exploited immediately. But if this were all the benefit the MI provided, it wouldnt be enough. Computing environments change over time the rise of client/server and network computing are prime examples. If the AS/400, which was initially designed for interactive processing, could not have adjusted to the role of a server, it soon would have become obsolete.
The MI is a very powerful interface, not just because it is technology independent, but also because it is so expandable. New instructions and functions are added at just about every new release of the system. The MI is an application-centric interface because it supports the APIs applications need. As new applications are desired, their APIs can easily be added. Because it is so expandable, the MI still has a long life ahead.
| Previous | Table of Contents | Next |