10.07.2015 Views

1130 Commercial Subroutine Package - All about the IBM 1130 ...

1130 Commercial Subroutine Package - All about the IBM 1130 ...

1130 Commercial Subroutine Package - All about the IBM 1130 ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ADDFormat: CALL ADD(JCARD, J, JLAST, KCARD, K, KLAST, NER)Function: Sums two arbitrary-length decimal data fields, placing <strong>the</strong> result in <strong>the</strong>second data field.Parameter description:JCARD - The name of a one-dimensional integer array defined in a DIMENSIONstatement. This is <strong>the</strong> array which is added, <strong>the</strong> addend. The data mustbe stored in JCARD in decimal format, one digit per word.J - An integer constant, an integer expression, or an integer variable. Thisis <strong>the</strong> position of <strong>the</strong> first digit to be added (<strong>the</strong> left-hand end of a field).JLAST - An integer constant, an integer expression, or an integer variable,greater than or equal to J. This is <strong>the</strong> position of <strong>the</strong> last digit to beadded (<strong>the</strong> right-hand end of a field).KCARD - The name of a one-dimensional integer array defined in a DIMENSIONstatement. This is <strong>the</strong> augend, <strong>the</strong> array which is added to. It will contain<strong>the</strong> result in decimal format, one digit per word.K - An integer constant, an integer expression, or an integer variable. Thisis <strong>the</strong> position of <strong>the</strong> first digit of KCARD (<strong>the</strong> left-hand end of a field).KLAST - An integer constant, an integer expression, or an integer variable,greater than or equal to K. This is <strong>the</strong> position of <strong>the</strong> last character ofKCARD (<strong>the</strong> right-hand end of a field).NER - An integer variable. Upon completion of <strong>the</strong> subroutine, this variableindicates whe<strong>the</strong>r arithmetic overflow occurred.Detailed description: The corresponding digits, by place value, of JCARD and KCARD,are summed and placed back in KCARD. This operation is from left to right, with bothfields being right-adjusted. Next, all carries are set in order. If overflow occurred,it is indicated by NER being equal to KLAST. NER must be initialized and reset by <strong>the</strong>user. More detailed information may be found in <strong>the</strong> ADD flowchart and listing.–4- ADDA1A3A1DECA3A1CARRYDE CA1DIVDPACKDUNPKEDITFILLGETICOMPIONDKEYBDMOVEMPYNCOMPNSIGNNZONEPACKPRINTPUNCHPUTP1403P1442READR2501SKIPSTACKSUBS1403TYPERUNPACWHOLE-13-1,1 iiii III om .....MirmumnotHollum...mn. momommommonmonnommonmownomnorr,-

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!