|
If you have ever looked at POPs (GA22-7000 S/370 Principles of Operation)
before, you might think it should have the following warning prominently
displayed on the cover
Here Be Dragons
POPs is some of the most difficult technical reading you will ever
encounter in an IBM publication. As we said earlier, POPs is a kind
of contract between the hardware designers and software developers.
Like all good contracts, it is precise. Fortunately, unlike contracts,
POPs (mostly) defines it's terms. Therein lies one of the main difficulties: term
definitions are scattered throughout POPs, in no readily apparent order.
Fortunately for us, POPs is graced with an excellent Index section, and
a very thorough Contents section.
Let's begin our journey through POPs by looking at how it is laid out.
Unfortunately, the authors of POPs hide this layout in the Contents section
by listing every section in the manual. This is really a pity, as POPs is
well laid-out once you see the forest for the trees.
Cover Page
Revision Page
Preface
Contents
Chapters
1 - Introduction
2 - Organization
3 - Storage
4 - Control
5 - Program Execution
6 - Interruptions
7 - General Instructions
8 - Decimal Instructions
9 - Floating-Point Instructions
10 - Control Instructions
11 - Machine-Check Handling
12 - Operator Facilities
13 - Input/Output Operations
Appendices
A - Number Representation and Instruction-Use Examples
B - List of Instructions
C - Condition-Code Settings
D - Facilities
E - Table of Powers of 2
F - Hexadecimal Tables
G - EBCDIC Chart
H - Changes Affecting Compatibility between System/360 and System/370
I - Changes Affecting Compatibility within System/370
Index
In terms of the concepts discussed, POPs basically divides into even
fewer sections.
Introduction
Storage
Control
Program Execution
Interrupts
Instructions
Miscellaneous (Machine-Check Handling, Operator Facilities)
I/O
Appendices and Index
As we begin delving into POPs, we'll start at the front and work our way
to the back, commenting on each major section.
Cover Page
As usual, the cover page gives the Publication Number GA22-7000, as well as
the publication's title "IBM System/370 Principles of Operation".
Revision Page
This page gives the Edition number and the date of that edition. Usually when
you received a new copy of the manual, you would want to read this page (the
first paragraph in particular) so that you could determine whether old copies
of the same manual were obsolete or not. Almost everyone that regularly
uses IBM manuals has read the rest of the page at least once; most never
look at it again. I find it interesting because IBM clearly describes how
they do business. Finally, the Copyright date(s) appear at the end of the page.
This main value of this page is to tell you how current the manual is, and
frequently to what operating system, program product, or facility the publication
applies.
Preface
This is one of the most important sections in the manual, and usually is likewise
for other IBM manuals. It usually tells you, when you first pick up a manual,
what you can hope to find in the manual. Here is the first paragraph from the
hardcopy manual I have on my desk, GA22-7000-10:
This publication provides, for reference purposes, a detailed definition
of the machine functions performed by System/370.
Note the "for reference purposes" and the word "detailed". POPs is not a
tutorial, it's a reference manual.
POPs is extremely detailed, probably to
the level of detail which you've never before seen. Finally, note this
paragraph also contains the word "definition". This is the very heart of
POPs (and programming in general): definition. Definition is what declares
that a byte will contain 8 bits, and that the SLR instruction sets the
condition code. Without precise definition of terms, there is no value to
a reference manual. In this regard, POPs is supremely valuable. It defines
its terms in excruciating detail. Once you know the "trick" to reading POPs
you will come to appreciate and depend upon this detail.
Had we skipped the Preface, we would have missed out on another valuable
resource: a summary of each Chapter and Appendix. Finally, the Preface is
rounded out with
Size Notation (KB and MB)
Bytes, Characters, and Codes
Other Publications
I strongly encourage you to read the entire Preface. Now is a good time.
We'll wait.
Reading
Contents
Having read the Preface, we now see that it is not necessary to summarize
the manual's contents; it was covered in the Preface. Had we skipped the
Preface, we'd already be confused and we're not even up to numbered pages.
Here we observe the Contents is laid out in an Indented Outline format.
This is the same format your teachers taught you to use in your English
(or other language) Composition class. Each new level of indentation shows
a refinement on the higher levels of indentation. Although POPs makes an
attempt to vary the font size of each section, sometimes it is not quite
distinct enough to be clear. If you look ahead to the opening page of an
individual Chapter, you will note that this same Indented Outline format
is preserved there. Sometimes it can be helpful to flip back to the Contents
section or the Chapter's opening page to reveal the indention level to
grasp the context in which a section is being presented.
Parsing POPs
As long as we're talking about tips on reading POPs, allow me to pass
along a valuable technique that many of us learned but long ago forgot.
When faced with a difficult sentence, it is sometimes useful to parse
the sentence using the noun - verb - noun - prepositional-phrase methodology.
In this methodology, you find the sentence's main noun (the subject of the
sentence). Next locate the main verb. For complicated sentences, there may
be several prepositional phrases. If you know the difference, identify the
direct and indirect objects (nouns). Full credit for this reminder goes
to one of my High School English teachers, Mr. DeMartini.
Let me warn you, there are some quite complicated sentences in POPs so keep
this technique in mind. POPs was written by some very intelligent people,
and they were not at all afraid to use the language to its full capabilities.
Another technique you might find valuable is to consider each sentence
as a string of terms or symbols. Once you've parsed the sentence using the
noun-verb-noun technique, see how the symbols are related or manipulated
in the sentence. This technique doesn't always pay off, but if you're stuck
it might prove useful.
Chapter 1 - Introduction
The first two paragraphs are introductory, the remainder of the first section
consists mainly of features that make the S/370 more advanced than the S/360.
Don't get bogged down on these features. Read them until you start to get lost
and then start skimming until you get to another feature; repeat.
It is this early in our introduction to POPs that most of you will
experience confusion (if it hasn't already happened). Because POPs is
a reference manual, sometimes terms are introduced without being defined.
Those of you that actually read the Preface will recall the authors said
as much.
General Approach
Alternatively, if you want to skip the rest of the tutorial and strike off on
your own, proceed using the General Approach:
Identify a term you don't understand.
Find the term or something like it in the Index.
Read the section(s) referred to in the Index listed under that term. This
reading will almost certainly cause you to identify new terms you don't understand.
Repeat until comprehension occurs or you run out of new terms (or time).
As a variation on the General Approach theme, if you can identify a specific
chapter or section that deals with the term in question, read as much of that
chapter or section as you can understand.
Don't be discouraged. POPs is complicated. When you read POPs, you're on
a kind of Easter Egg hunt, but instead of eggs you seek understanding.
If you're a beginner, you are not yet well suited to the General Approach so
stick with us unless you're extremely confident in your abilities to pick up
technical material on your own. However, once you've mastered the fundamentals
the General Approach or a variation thereof could serve you well.
It is here that we need to take a "gut check". Do you have what it takes to
learn S/370 Assembler? Did you read the Preface like I recommended?
If you didn't, I'm not optimistic about your chances for success. I can't
instill the desire to succeed into you. You either want to learn this or you
don't. You're certainly welcome to read through the tutorial without reading
any of the recommended materials, but you frankly won't learn that much if
you skip the reading.
The tutorial will not be long enough to cover every
instruction you'll need to program in assembler. Instead I plan to teach
you "how to fish" rather than "feed you".
But let's be realistic. Maybe you
don't have time to read everything I point out. That's OK, the tutorial is
online (subject of course to Link Rot); you can come back later. But don't
fool yourself. Reading the tutorial alone isn't going to teach you S/370 assembler.
The IBM manuals are a key resource. The hercules-s370asm group is another
key resource. Use them wisely, and you'll probably be pleasantly surprised
at how quickly you pick up the subject matter. Romp through your key resources
(or ignore them altogether) and you'll get as much out of the experience as
any other romp: time passes, perhaps pleasantly, but not much else happens.
Finally, keep in mind that newsgroups wax and wane. The level of enthusiasm
in the S370ASM group is high right now. No one knows what the future holds,
so if you're serious about learning S/370 assembler making the most of these
key resources now rather than later might be prudent. Almost all of the
experienced people answering questions in the group have full plates, and
other demands on their time so they might well wander off. Try to keep
them interested. You have what may well be an unprecedented opportunity
here, act accordingly.
Enough motivational spewage, back to the subject at hand.
Chapter 2 - Organization
Now we're starting to get to the good stuff. Normal humans might think of
Chapter Two as an introduction, rather than what we saw in Chapter One. The
pseudo-explanation for why this occured has to do with the history of IBM
mainframes. When the S/370 was introduced, many customer sites were already
running a S/360 system. Chapter One was for them. It regaled them with all
the new features they could expect to exploit if they would only send IBM
another big pile of cash. Believe me, back in those days Chapter One was
compelling reading.
Would you like to hear what might be another reason why the introduction is in
Chapter Two rather than Chapter One? I think the authors of POPs, knowing the
pivotal role the publication would have on future participants in the field would
have, used a bit of subterfuge to filter out the less capable candidates. Call it
Social Darwinism if you like. These were smart people, and smart people like
working with other smart people. Do the math. Of course I could be completely
wrong on this.
And here, dear reader, you are. You've passed the gut check, you're dealing
with the reading as best you can, and you're about to enter the Promised Land.
Chapter Two. Read it. That's it. It's as close to English as POPs ever gets.
In Chapter Two, you learn about the main S/370 system components all in six
short, sweet pages. Here they are:
Main storage
CPU
PSW
General Registers
Floating-Point Registers
Control Registers
Vector Facility
I/O
Channel Sets
Channels
I/O Devices and Control Units
Operator Facilities
No dragons so far. Just some hardware components, some of them quite similar
to those we introduced in our Imaginary S/370 Design History. CPU, same. PSW,
similar. General Regisers, we called them General Purpose Registers [GPRs] (and so
will POPs, quite soon). Floating-Point Registers [FPRs], new. Control Registers [CRs],
also new. Vector Facility, forget about it; I'll probably not mention it again.
I/O, oh yes, we'll want some of that. And how will we go about that? Channel
sets (optional), channels (required), and I/O devices and Control Units (mixed bag).
Operator Facilities, that would be Hercules (with or without the Fish GUI).
I know you're anxious to hear about Floating-Point and Control Registers, so
I'll draw a distinction between GPRs, FPRs, and CRs.
GPRs are used for integer numbers
FPRs are used for fractional numbers (think Scientific Notation);
numbers with a decimal point and some trailing digits
CRs are used to control the S/370 system itself
Initially, you can think of the CRs as bit flags and/or numbers that specify
options for the S/370 system. As an application programmer coding in S/370 assembler,
you will have ready access to GPRs and FPRs but not CRs. Systems programmers,
if they write code, might want to manipulate CRs (but maybe not). The IBM
developers that wrote MVS itself were sometimes required to manipulate the CRs.
Now is a good a time as any to introduce the reason normal applications don't
have access to CRs. The S/370 hardware design makes a big deal about system
integrity. Not only does the hardware protect one application from another
(assuming the operating system fully exploits the hardware features), the
hardware protects the system from all the applications as well.
The primary method used to provide this protection is a single bit in the PSW,
indicating something like "restrictions in effect" when the bit is on, and "you own
the machine" when the bit is off. I can't help myself, it's bit 15 in the PSW
(which you can promptly forget). It is only when bit 15 is off (called
"being in supervisor state") that a program can succeed in manipulating the
CRs. In terms of symmetry, when bit 15 is on (called "being in problem state")
and a program attempts to manipulate the CRs it will "fail". This "failure" is
called an interrupt, about which we'll hear more later.
Chapter 3 - Storage
With Chapter Three, POPs dives right into its normal mode as a
reference manual. This would be an excellent place to take a break.
If you have time before we're ready to begin again, feel free to
review the opening page (page 3-1) and skim the chapter.
If you get as far as the ASN stuff, skip it.
It's advanced material and the Turnkey system doesn't support it
(from which you might deduce that software is required
to make some of these features work).
The Dynamic Address Translation, Address Summary, and Assigned Storage
Locations sections are interesting. Dynamic Address Translation (DAT)
is what makes virtual addresses happen. The Address Summary describes
the various kinds of addresses in the terms POPs refers to them.
Finally, Assigned Storage Locations specifies the portion of main storage
the CPU reserves for architecturally defined data areas in "low storage".
Break Time
Interacting with the S370ASM group
You might well have some questions at this point. Here's where the wonder of
the Internet comes in. Feel free to post your questions in the S370ASM group.
|
|