U4BINDC

Table Of Contents
  • [00004] INTEGER BINARY TO DECIMAL CONVERSION
u4bindc.lst
ASM1130 CROSS ASSEMBLER V1.22 -- V2M12 -- Sun Nov  1 19:25:09 2020
 
Source File: \u4bindc.asm 
INTEGER BINARY TO DECIMAL CONVERSION
 
                             2 | *************************************************** U4B00020
                             3 | *                                                 * U4B00030
INTEGER BINARY TO DECIMAL CONVERSION
 
                             5 | *   SUBROUTINE NAME-                              * U4B00050
                             6 | *      FULL NAME- INTEGER BINARY TO DECIMAL CON-  * U4B00060
                             7 | *         VERSION SUBPROGRAM.                     * U4B00070
                             8 | *      CODE NAME- BINDC                           * U4B00080
                             9 | *   PURPOSE- THIS SUBPROGRAM CONVERTS A ONE-WORD  * U4B00090
                            10 | *      BINARY INTEGER TO A STRING OF EBCDIC       * U4B00100
                            11 | *      CHARACTERS REPRESENTING THE CORRESPONDING  * U4B00110
                            12 | *      DECIMAL VALUE.                             * U4B00120
                            13 | *   METHOD-                                       * U4B00130
                            14 | *         SEE IBM 1130 SUBROUTINE LIBRARY MANUAL  * U4B00140
                            15 | *   CAPABILITIES AND LIMITATIONS-                 * U4B00150
                            16 | *         SEE IBM 1130 SUBROUTINE LIBRARY MANUAL  * U4B00160
                            17 | *   SPECIAL FEATURES- N/A                         * U4B00170
                            18 | *   ADDITIONAL INFORMATION-                       * U4B00180
                            19 | *      ESTIMATED EXECUTION TIME-                  * U4B00190
                            20 | *         SEE IBM 1130 SUBROUTINE LIBRARY MANUAL  * U4B00200
                            21 | *                                                 * U4B00210
                            22 | *************************************************** U4B00220
                            23 | ***   HDNG    LIBF BINDC-V1.                        U4B00230
                            24 |       LIBR                                          U4B00240
                            25 |       ENT     BINDC                                 U4B00250
                            26 | *                                                   U4B00260
0000 6926                   27 | BINDC STX   1 BC20+1    CALL ENTRY POINT       (+0) U4B00270
0001 6580 0000              28 | LINK  LDX  I1 0         LOADER STORES TV ADDR  (+2) U4B00280
0003 2824                   29 |       STS     BC22      SAVE STATUS                 U4B00290
0004 D83D                   30 |       STD     SAVE      SAVE ACC AND EXT            U4B00300
0005 D040                   31 |       STO     VALUE     SAVE VALUE TO BE CONVERTED  U4B00310
0006 C100                   32 |       LD    1 0         XR1= ADDR OF OUTPUT PARAM   U4B00320
0007 D01B                   33 |       STO     BC16+1    SET UP OUTPUT ADDR          U4B00330
0008 7101                   34 |       MDX   1 +1        XR1= RETURN ADDR            U4B00340
0009 6921                   35 |       STX   1 BC26+1    SET UP RETURN ADDR          U4B00350
000A 6105                   36 |       LDX   1 +5        XR1= COUNT FOR 5 DIGITS     U4B00360
000B C03A                   37 |       LD      VALUE     GET BINARY NO. INPUT        U4B00370
000C 4C28 002CR             38 |       BSC  L  BC30,Z+   IF NEG, GO TO SET SIGN      U4B00380
000E C02F                   39 |       LD      H80A0     IF POS, GET CARD CODE &     U4B00390
000F D480 0023R             40 | BC06  STO  I  BC16+1    ST SIGN IN OUTPUT AREA      U4B00400
                            41 | *                                                   U4B00410
                            42 | *LOOP TO COMPUTE DECIMAL DIGITS                     U4B00420
                            43 | *                                                   U4B00430
0011 C034                   44 | BC10  LD      VALUE     GET INPUT VALUE=N           U4B00440
0012 A027                   45 |       M       H1999     MPY BY ONE-TENTH            U4B00450
0013 D031                   46 |       STO     TEMP      ST TRUNCATED TENTH OF N     U4B00460
0014 A02B                   47 |       M       N0010     MPY BY -10 TO GET -N PLUS   U4B00470
0015 1090                   48 |       SLT     16        PUT PRODUCT IN ACC          U4B00480
0016 4801                   49 |       BSC     O         IS DIGIT FIRST OF -32768    U4B00490
0017 8020                   50 |       A       D0001     YES, INCR 32767 TO 32768    U4B00500
0018 802D                   51 |       A       VALUE     GET ONLY LAST DIGIT AND PUT U4B00510
0019 802A                   52 |       A       SHIFT     *INTO SHIFT RT INSTRUCTION  U4B00520
001A D006                   53 |       STO     BC14      *TO SHIFT HOLLERITH CHAR    U4B00530
001B 901D                   54 |       S       H180A     IF DIGIT GT 9, APPROXIMATED U4B00540
001C 4C10 0033R             55 |       BSC  L  BC34,-    *TENTH GAVE ERROR- SUBTRACT U4B00550
001E C026                   56 | BC12  LD      TEMP      OTHERWISE, SET VALUE TO ONE U4B00560
001F D026                   57 |       STO     VALUE     *TENTH OF N FOR NEXT DIGIT  U4B00570
0020 C01A                   58 |       LD      H2000     =HOLLERITH ZERO. SHIFTING   U4B00580
0021 1800                   59 | BC14  SRA     0         *GIVES RT HOLL DIGIT        U4B00590
0022 D500 0000              60 | BC16  STO  L1 0         ST IN OUTPUT AREA           U4B00600
0024 71FF                   61 |       MDX   1 -1        ARE FIVE DIGITS DONE        U4B00610
0025 70EB                   62 |       MDX     BC10      IF NOT, REPEAT LOOP         U4B00620
0026 6500 0000              63 | BC20  LDX  L1 *-*       YES, RESTORE XR1            U4B00630
0028 2000                   64 | BC22  LDS     *-*       RESTORE STATUS              U4B00640
0029 C818                   65 |       LDD     SAVE      RESTORE ACC AND EXT         U4B00650
002A 4C00 0000              66 | BC26  BSC  L  0         EXIT                        U4B00660
                            67 | *                                                   U4B00670
                            68 | *SECTION TO TREAT NEGATIVE NUMBERS INPUT            U4B00680
                            69 | *                                                   U4B00690
002C 1810                   70 | BC30  SRA     16        CLEAR ACCUMULATOR           U4B00700
002D 9018                   71 |       S       VALUE     GET COMPLEMENT OF N, WHICH  U4B00710
002E 4808                   72 |       BSC     +         *IS NEG ONLY IF N = -32768  U4B00720
002F C00D                   73 |       LD      H7FFF     IF NEG, USE N=+32767        U4B00730
0030 D015                   74 |       STO     VALUE     ST ABS VALUE                U4B00740
0031 C00A                   75 |       LD      H4000     GET A HOLLERITH MINUS AND   U4B00750
0032 70DC                   76 |       MDX     BC06         STORE - AS SIGN          U4B00760
                            77 | *                                                   U4B00770
                            78 | *ERROR CORRECTION PROCEDURE IF DIGIT IS GT 9        U4B00780
                            79 | *                                                   U4B00790
0033 8010                   80 | BC34  A       SHIFT     RESTORE SHIFT PART OF CON   U4B00800
0034 D0EC                   81 |       STO     BC14      DECR DIGIT VALUE BY 10      U4B00810
0035 7401 0045R             82 |       MDX  L  TEMP,+1   CORRECT TEMP TO CORRESPOND  U4B00820
0037 70E6                   83 |       MDX     BC12      RETURN.                     U4B00830
                            84 | *                                                   U4B00840
                            85 | *CONSTANTS AND BUFFER AREA                          U4B00850
                            86 | *                                                   U4B00860
0038 0001                   87 | D0001 DC      +1        DECIMAL +1                  U4B00870
0039 180A                   88 | H180A DC      /180A     HOLLERITH ZERO.             U4B00880
003A 1999                   89 | H1999 DC      /1999     = .1 SCALED ** -16          U4B00890
003B 2000                   90 | H2000 DC      /2000     HOLLERITH ZERO.             U4B00900
003C 4000                   91 | H4000 DC      /4000     HOLLERITH MINUS.            U4B00910
003D 7FFF                   92 | H7FFF DC      /7FFF     +32767                      U4B00920
003E 80A0                   93 | H80A0 DC      /80A0     HOLLERITH +                 U4B00930
003F A000                   94 | HA000 DC      /A000     =-10 SCALED **-16           U4B00940
0040 FFF6                   95 | N0010 DC      -10       DECIMAL -10                 U4B00950
0042                        96 | SAVE  BSS  E  2         ACC AND EXT TEMPORARY       U4B00960
0044 1800                   97 | SHIFT SRA     0         SHIFT HOLLERITH ZERO AMOUNT U4B00970
0045 0000                   98 | TEMP  DC      0         ST ONE TENTH OF VALUE       U4B00980
0046 0000                   99 | VALUE DC      0         VALUE TO BE CONVERTED       U4B00990
0047                       100 |       END                                           U4B01000
 
There were no errors in this assembly
 
=== CROSS REFERENCES ==========================================================
Name  Val   Defd  Referenced
BC06  000FR   40   76
BC10  0011R   44   62
BC12  001ER   56   83
BC14  0021R   59   53   81
BC16  0022R   60   33   40
BC20  0026R   63   27
BC22  0028R   64   29
BC26  002AR   66   35
BC30  002CR   70   38
BC34  0033R   80   55
BINDC 0000R   27
D0001 0038R   87   50
H180A 0039R   88   54
H1999 003AR   89   45
H2000 003BR   90   58
H4000 003CR   91   75
H7FFF 003DR   92   73
H80A0 003ER   93   39
HA000 003FR   94
LINK  0001R   28
N0010 0040R   95   47
SAVE  0042R   96   30   65
SHIFT 0044R   97   52   80
TEMP  0045R   98   46   56   82
VALUE 0046R   99   31   37   44   51   57   71   74