a
Application Program H20-0241-3
1130 Commercial Subroutine Package (1130-SE-25X), Version 3 Program Reference Manual
The IBM 1130 Commercial Subroutine Package is for IBM 1130 users with a knowledge of FORTRAN. The package is not intended to make FORTRAN a complete commercial language, but to supply commercial capability to users of IBM 1130 FORTRAN.
This manual is a combined user s, operator s, and system manual.
Kristofer Sweger Fourth Edition
This edition, H20-0241-3, is a major revision obsoleting H20-0241-2.
A form is provided at the back of this publication for reader s comments. If the form has been removed, comments may be addressed to IBM Corporation, Technical Publications Department, 112 East Post Road, White Plains, N.Y. 10601 CI International Business Machines Corporation 1966, 1967, 1968 CONTENTS
Introduction 1
Use of the Commercial Subroutine Package 3
Machine Requirements 4
Special Considerations--Arithmetic 5
Special Considerations--Input/Output 6
FORTRAN Format I/O 6
CSP Overlapped I/O 6
Data Formats Used 7
Al Format 7
A2 Format 8
A3 Format 8
Dl Format 8
D4 Format 9
Format Requirements 11
Detailed Descriptions 12
ADD 13
AlA3 15
A1DEC 18
A3A1 21
CARRY 24
DECA1 26
DIV 28
DPACK 31
DUNPK 34 EDIT o • I 4 36
FILL 41
GET 42
I COMP 45
IOND 47
KE YBD 48
MOVE 50
MPY 52
NCOMP 54
NSIGN 56
NZ ONE 58
PACK 60
PRINT 62
PUNCH 64
PUT 66
P1403 68
P1442 70
READ 73
R2501 76
SKIP 79
STACK 81
SUB 82 S1403 84
TYPER 86
UNPAC 89
WHOLE 91 Sample Problems 93
Problem 1 93
Problem 2 104
Problem 3 116
Flowcharts 124
Listings 152
Appendix 190
Core Allocation 190
EBCDIC Characters and Decimal Equivalents 192
Timing Data 193
Programmer s Reference Card 195
Operating Instructions 197
Halt Listing 198
Bibliography 199 a INTRODUCTION
The 1130 Commercial Subroutine Package has been written to facilitate the use of FORTRAN in basic commercial programming. Included in the package are the following items:
• The GET routine, which allows the programmer to decode input records after they have been read. This eliminates the common FORTRAN-associated problem that occurs when input cards enter the system in an unknown sequence. Input records that vary in this way may be read with the Al format and converted to real numbers (using GET) after the program has determined which type record was just read.
• An editing routine, EDIT, for the preparation of output in special formats. With EDIT it is possible to insert commas, supply leading blanks, float dollar signs, display a CR symbol after negative numbers, etc. EDIT is especially useful in the preparation of invoices, checks, and other commercial documents.
• Code conversion routines for data manipulation and more efficient data packing:
GET - Al format to Real PUT - Real to Al format PACK - Al to A2 format UNPAC - A2 to Al format A1A3 - Al to A3 format A3A1 - A3 to Al format DPACK - Dl to D4 format DUNPK - D4 to D1 format A1DEC - Al to decimal format DECA1 - Decimal to Al format
• A variable-length decimal arithmetic package. In this system, all arithmetic is done with integer or decimal numbers, with field lengths chosen by the user. This subset of the Commercial Subroutine Package includes routines for variable-length decimal add (ADD), subtract (SUB), multiply (MPY), divide (DIV), compare (ICOMP), and sign test (NSIGN).
Use of this system eliminates two of the arithmetic problems associated with FORTRAN: the accuracy problem (the inexact representation of fractions) and the magnitude problem (extended precision values limited to nine digits, etc.).
• Subroutines for improved speed and control of I/O devices. By taking advantage of the 1130 s cycle-stealing capability, the overlapped I/O routines can substantially speed the throughput rates of many jobs. Subroutines are supplied for the
IBM 1442 Card Read Punch IBM 1442-5 Card Punch IBM 2501 Card Reader IBM 1132 Printer IBM 1403 Printer Console Keyboard Console Typewriter
-1-
1.1.1.1111111111$11111E HHIcilil 1111111111n 11111 1111111111111111111111111 1111111111111111111111111 In addition to input/output, subroutines are supplied for control of the 1132 and 1403 carriage and the 1442 stacker select mechanism.
• Several utility routines for common tasks:
NCOMP for comparing two variable-length alphameric (Al) fields MOVE for moving data from one area to another FILL to fill an area with a specified value WHOLE to truncate the fractional portion of a real number NZONE for testing and modifying zone punches USE OF THE COMMERCIAL SUBROUTINE PACKAGE
CSP is modular in design -- the user may use whichever routines he needs and ignore the others.
The routines may be assembled on any 4K card 1130 system, but an 8K system will prob- ably be required for any extensive usage. The desired subroutines may be inserted in the FORTRAN execute deck (card systems) or stored in the Subroutine Library on the disk cartridge. In addition, some of the CSP routines use certain parts of the IBM 1130 Sub- routine Library. (See "Core Allocation" in the Appendix.)
All of the routines are written in the 1130 Assembler Language.
The control statement