PREVIOUS
CONTENTS
NEXT


Instructions


The S/370 machine instructions are divided into two broad categories: those which require the CPU be in supervisor state, and those that don't. The instructions which do not require supervisor state are normally referred to as "problem state" instructions. As you might recall, we said that bit 15 of the S/370 PSW controls which state (supervisor or problem) the CPU is in.

Generally speaking, most operating systems execute the user's program in problem state, with VM's CMS operating system being a notable exception. Running the user's program in problem state prevents one user's program from adversely affecting another user's program and data, or the operating system's programs and data.

The MVS operating system, which normally executes the user's program in problem state, goes to great lengths to prevent unauthorized entry into supervisor state. The only defined interface MVS provides for a user program to enter supervisor state is called the Authorized Program Facility (APF). Normally, only systems programmers write programs that use this APF facility.

Programs that are running in problem state are restricted to executing problem state instructions. Programs that are running in supervisor state may execute either problem program instructions or supervisor state instructions. That is to say, supervisor state programs may execute all the valid instructions.

Before you're ready to start writing programs that execute in supervisor state, you'll need to master most of the instructions that execute in problem state.

Since we're going to lump several chapters into this section, I've laid out how the S/370 hardware views the various categories of instructions:


Problem state instructions

  • Chapter 7 - General Instructions
  • Chapter 8 - Decimal Instructions
  • Chapter 9 - Floating Point Instructions
  • Supervisor state instructions

  • Chapter 10 - Control Instructions

  • The category "General Instructions" is a bit broader than I've indicated above; there are some instructions related to decimal instructions in this category, largely having to do with conversion between decimal and binary, and vice versa. Additionally, there are some miscellaneous instructions included in Chapter Seven that don't really fit anywhere else. But in general, most of the instructions in Chapter 7 relate to binary data.

    As you begin your assembly language coding career, Chapter Seven is where you'll spend most of your time. Sometimes even experienced programmers never open Chapter Ten, and relatively few coders ever bother to read Chapter Nine. When you've got a lot of floating point math to perform, most people select another language in which to code.

    Data Format

    At this point, I recommend everyone read the following sections in Chapter Seven:

    Data Format
    Binary-Integer Representation
    Binary Arithmetic
    Signed and Logical Comparison

    You might have a little trouble understanding the material, but you'll get at least some notion of the different ways different instructions can treat data. Glance down the list of General Instructions at the beginning of Chapter Seven, just to get a feel for what's included.

    This tutorial will mostly focus on binary numbers; by the time you've gotten through handling binary numbers you should be familiar enough with POPs to figure out the decimal and floating point numbers by yourself.

    Next, read the Decimal-Number Formats section in Chapter Eight, and glance at the list of Decimal Instructions.

    After that, you might glance at the Floating-Point Number Representation section in Chapter Nine, and the list of Floating Point Instructions.

    In Chapter Ten, you can briefly examine the unlabeled section before the first Control Instruction: CONNECT CHANNEL SET. Read down the list of instructions in the table, just to get a feel for the types of control operations the S/370 provides.

    Binary Numbers

    Dealing with Binary Numbers

    If you're a little rusty on dealing with Binary, Decimal, and/or Hexadecimal numbers, this might be a good time to take a detour to the Numbers page, which also gives some introductory material on converting between binary, decimal, and hexadecimal.


    Before we leave our discussion of instructions, keep in mind that we're just surveying POPs to get a sense of what's contained in the manual, and where it might be located.

    We've still got our IEFBR14 program to discuss, and we'll starting using POPs just as soon as we get back to it.


    PREVIOUS
    CONTENTS
    NEXT

     

     
    Contact Us