
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 users, operators, 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 readers 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 Programmers 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 1130s 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 ONE WORD INTEGERS must be used in programs that call any of the Commercial subroutines. The control statement EXTENDED PRECISION must be used in any program that calls the GET or PUT subprograms. The other CSP routines are independent of the real number precision. In general, CSP will operate under either Version 1 or Version 2 of the 1130 Disk Monitor System. The exceptions are P1403, 51403, P1442, and R2501, which use subroutines supplied only with Version 2 (see the detailed descriptions for more particulars). The use of the overlapped I/O portion of CSP is an "either/or" proposition. For nondisk I/O, the programmer must choose either the CSP overlapped routines or the standard FORTRAN routines. The two systems cannot be intermixed within the same program. Note the emphasis on nondisk. This exclusion does not apply to disk I/O, which may be used regardless which of the two systems is selected. Use of the overlapped I/O routines also excludes the employment of the TRACE feature of FORTRAN, since it used portions of the FORTRAN package for output. A MACHINE REQUIREMENTS For execution, an 8K 1130 system, with any card reader, is necessary. In addition, the following I/O devices are supported: 1442 Card Read Punch, Model 6 or 7 1442 Card Punch, Model 5 2501 Card Reader, Model Al or A2 1403 Printer, Model 6 or 7 1132 Printer Console Keyboard Console Typewriter Other I/O devices may be utilized through standard FORTRAN. For assembly, any 1130 card system is sufficient. The subroutines may be card- or disk-resident. 6 SPECIAL CONSIDERATIONS — ARITHMETIC Real arithmetic. When using CSP, remember that the standard FORTRAN limitations apply to all real numbers. Extended precision numbers should not exceed ± 1,000,000,000. (or 9 digits). Fractions must be avoided if exact results are desired. All critical arithmetic should be done with whole numbers. For example, the extension 40.75 hours x $2.225 per hour should be carried out as 4075. hundredths of hours x 2225. mills per hour If this is not done, precision errors may appear in the results. Decimal arithmetic. If the nine-digit or fractional limitations of FORTRAN prove burden- some, the Decimal Arithmetic package may be used. In this system, all arithmetic is done with whole numbers (no fractions), and the number of digits in each variable is chosen by the user. A number in decimal format may be as long as desired; there is no practical limit to field length. SPECIAL CONSIDERATIONS — INPUT/OUTPUT FORTRAN FORMAT I/O In general, CSP works with arrays in Al format -- one alphameric character per word. For those routines that operate on other formats, conversion routines are supplied to ease the translation between Al and the other format. In this area, however, one complication may occur: the use of zone punches. In many commercial applications, it is customary to X-punch the units position of a credit or neg- ative field. Because the 11-0 Hollerith combination is not recognized by the conversion routines used with FORTRAN READs, it is necessary, when keypunching, to omit the 0- punch when an 11-punch is present in the same column. This is not a problem with 1130- produced cards that later serve as input to subsequent runs. No control X-punches, in any positions, will be recognized when the underpunched digit is a zero. "Not recognized" means that the character position is replaced with a blank. This is the case for both input and output when standard FORTRAN READs and WRITE s are used. A 12-punch is not recognized by the conversion routines with FORTRAN when the under- punched digit is a zero. Therefore, a plus zero (12-0 Hollerith) will be expressed as only a 0-punch. For this reason, plus fields should be left =zoned rather than 12-punched in the units position. When the input routines supplied with this package are used, this problem does not exist. All zone punches are recognized and are treated properly. CSP OVERLAPPED I/O The CSP overlapped I/O routines have been provided to take advantage of the cycle- stealing capability of the 1130. Because many allow processing to be resumed before the I/O is finished, their use will increase the throughput rates of many programs. The table below summarizes the overlap capabilities of the routines: This device is overlapped with this function Card reader (1442 or 2501) Conversion from card code to Al format Card punch nothing (not overlapped) Console keyboard nothing (not overlapped) Console printer anything but the console keyboard Printer (1132 or 1403) anything The CSP I/O routines also permit the reading and punching of the 11-0 and 12-0 punches, both of which must be avoided with standard FORTRAN I/O.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages210 Page
-
File Size-