Text preview for : C20-1620-0_360pgmPtrs.pdf part of IBM C20-1620-0 360pgmPtrs IBM 360 training C20-1620-0_360pgmPtrs.pdf



Back to : C20-1620-0_360pgmPtrs.pdf | Home

Form C20-1620-0




Analysis

System/360 Pointers
Programming Techniques



This manual of System/360 pointers is devoted to examples
illustrating various coding techniques. It not only shows the
use of some of the features of the assembly language but more
importantly points out the power of the System/360 organization
in the solution of common problems or parts thereof. Although
many of the examples are slanted toward the mathematician,
there are those of sufficiently general interest to provide Programming
knowledge for the commercially oriented.




Scientific
FOREWORD


The examples presented in this manual are small in size and are intended for a reader
who is interested in an introduction to System/360 programming. While studying the
various pieces of code, it is advisable to have access to the following manuals:

System/360 Principles of Operation (A22-6821-1) -- referred to as "OM"

System/360 Operating System -- Assembly Language (C28-6514-1) -- referred to as "AM"

References are made to these manuals in the subsequent pages.

There are three basic sections in this document. In the first two sections, the basic
instruction set is illustrated through simple examples. It is intended that the examples
increase in complexity, each tending to illustrate some particular point relative to a
coding technique. Pertinent comments are included. The final section shows complete
problems, including the necessary assembly language parameters to produce a running
program. The problems of this section have actually been run on a machine.

The programs shown represent "good" coding practices. They have not been optimized
to their fullest. This optimization is left as an exercise to the reader. Where optional
methods of approach can be taken, they are shown and discussed.




Copies of this and other IBM publications can be obtained through IBM branch
offices. Address comments concerning the contents of this publication to
IBM, Technical Publications Department, 112 East Post Road, White Plains, N. Y. 10601
CONTENTS

1. Fixed-Point, Logical and Branch Instructions. . . . . . . . . . . . . . . 1
1. 1 Use of Multiple Registers for Storing Intermediate Results. 1
1. 2 Evaluation of a Simple Arithmetic Expression. . . . . . . . 1
1. 3 Cyclic Purmutation of a Word Group Using Multiple Register Commands. 2
1.4 Clearing of a Space in Storage Using Loop Control Techniques . . . . . 3
1. 5 Extraction of one Element of a Matrix - Two Dimensional Table Lookup. 5
1. 6 Cyclic Bit Shifting. . . . . . . . . . . . . . . . . . . . . 5
1. 7 Sum of Squares Using Double-Precision Fixed-Point Arithmetic 6
1. 8 Transposition of a Square Matrix Using Address Constants. . . . 7
1. 9 Length of an Unknown File Using Byte-Handling Capabilities and
Multiple Registers. . . . . . . . . . . . . . ... . 8
1. 10 Table Lookup Using the Translate Instruction . ... . 10
2. Floating-Point Instructions . . . . . . . . . . . 12
2. 1 Polynomial Evaluation . . . . . . . . . . . . . . . . . . . 12
2. 2 Separation of Integer and Fraction Parts of Floating-Point Numbers
Using Unnormalized Instructions. . . . . . . . . . . 12
2.3 Extracting the Integer Part of a Floating-Point Number . . . .