Trailing-Edge
-
PDP-10 Archives
-
BB-R595B-SM_11-9-85
-
mcb/utilities/catb.lst
There is 1 other file named catb.lst in the archive. Click here to see a list.
12-Apr-1985 07:09:15 TOPS-20 Bliss-36 4A(225) Page 1
30-Dec-1982 17:28:34 DNET61:<DECNET.UTILITIES>CATB.BLI.1 (1)
; 0001 0
; 0002 0 MODULE CATB ( !ASCII to binary conversion routines
; 0003 0 IDENT = '001010',
; 0004 0 LANGUAGE (BLISS16, BLISS36) %BLISS36 (, ENTRY ($CDTB, $COTB))
; 0005 0 ) =
; 0006 1 BEGIN
; 0007 1 !
; 0008 1 !
; 0009 1 !
; 0010 1 ! COPYRIGHT (c) 1980, 1981, 1982
; 0011 1 ! DIGITAL EQUIPMENT CORPORATION
; 0012 1 ! Maynard, Massachusetts
; 0013 1 !
; 0014 1 ! This software is furnished under a license and may be used
; 0015 1 ! and copied only in accordance with the terms of such license
; 0016 1 ! and with the inclusion of the above copyright notice. This
; 0017 1 ! software or any other copies thereof may not be provided or
; 0018 1 ! otherwise made available to any other person. No title to
; 0019 1 ! and ownership of the software is hereby transferred.
; 0020 1 !
; 0021 1 ! The information in this software is subject to change
; 0022 1 ! without notice and should not be construed as a commitment
; 0023 1 ! by DIGITAL EQUIPMENT CORPORATION.
; 0024 1 !
; 0025 1 ! DIGITAL assumes no responsibility for the use or reliability
; 0026 1 ! of its software on equipment which is not supplied by
; 0027 1 ! DIGITAL.
; 0028 1 !
; 0029 1
; 0030 1 !++
; 0031 1 ! FACILITY: SYSTEM LIBRARY
; 0032 1 !
; 0033 1 ! ABSTRACT:
; 0034 1 !
; 0035 1 !
; 0036 1 ! THIS MODULE CONTAINS ROUTINES TO CONVERT DECIMAL OR OCTAL ASCII
; 0037 1 ! TO BINARY.
; 0038 1 !
; 0039 1 !
; 0040 1 ! ENVIRONMENT: ANY
; 0041 1 !
; 0042 1 ! AUTHOR: ALAN D. PECKHAM, CREATION DATE: 28-AUG-78
; 0043 1 !
; 0044 1 ! MODIFIED BY:
; 0045 1 !
; 0046 1 ! , : VERSION
; 0047 1 ! 01 -
; 0048 1 !--
; 0049 1
; 0050 1 !
; 0051 1 ! TABLE OF CONTENTS:
; 0052 1 !
CATB 12-Apr-1985 07:09:15 TOPS-20 Bliss-36 4A(225) Page 2
001010 30-Dec-1982 17:28:34 DNET61:<DECNET.UTILITIES>CATB.BLI.1 (1)
; 0053 1
; 0054 1 FORWARD ROUTINE
; 0055 1 $CDTB, !Convert decimal ASCII to binary.
; 0056 1 $COTB, !Convert octal ASCII to binary.
; 0057 1 COTB; !ASCII to binary common routine
; 0058 1
; 0059 1 !
; 0060 1 ! INCLUDE FILES
; 0061 1 !
; 0062 1 ! NONE
; 0063 1 !
; 0064 1 ! MACROS:
; 0065 1 !
; 0066 1 ! NONE
; 0067 1 !
; 0068 1 ! EQUATED SYMBOLS:
; 0069 1 !
; 0070 1 ! NONE
; 0071 1 !
; 0072 1 ! OWN STORAGE:
; 0073 1 !
; 0074 1 ! NONE
; 0075 1 !
; 0076 1 ! EXTERNAL REFERENCES:
; 0077 1 !
; 0078 1 ! NONE
; 0079 1 !
; 0080 1
CATB 12-Apr-1985 07:09:15 TOPS-20 Bliss-36 4A(225) Page 3
001010 30-Dec-1982 17:28:34 DNET61:<DECNET.UTILITIES>CATB.BLI.1 (2)
; 0081 1 GLOBAL ROUTINE $CDTB (BUF_PTR_ADR) =
; 0082 1
; 0083 1 !++
; 0084 1 ! FUNCTIONAL DESCRIPTION:
; 0085 1 !
; 0086 1 !
; 0087 1 !
; 0088 1 !
; 0089 1 ! FORMAL PARAMETERS:
; 0090 1 !
; 0091 1 ! .BUF_PTR_ADR !Address of character sequence
; 0092 1 ! !pointer to buffer to extract
; 0093 1 ! !number from.
; 0094 1 !
; 0095 1 ! IMPLICIT INPUTS:
; 0096 1 !
; 0097 1 ! NONE
; 0098 1 !
; 0099 1 ! IMPLICIT OUTPUTS:
; 0100 1 !
; 0101 1 ! The buffer pointer ..BUF_PTR_ADR is updated to point past
; 0102 1 ! the characters used in the conversion.
; 0103 1 !
; 0104 1 ! ROUTINE VALUE:
; 0105 1 !
; 0106 1 ! The binary equivalent of the decimal number.
; 0107 1 !
; 0108 1 ! SIDE EFFECTS
; 0109 1 !
; 0110 1 ! NONE
; 0111 1 !
; 0112 1 !--
; 0113 1
; 0114 2 BEGIN
; 0115 2
; 0116 2 LITERAL
; 0117 2 RADIX = 10; !Use a radix of 10.
; 0118 2
; 0119 2 COTB (.BUF_PTR_ADR, RADIX) !Convert the number.
; 0120 1 END; !OF $CDTB
TITLE CATB
TWOSEG
ENTRY $CDTB, $COTB
.REQUEST SYS:B362LB.REL
CATB 12-Apr-1985 07:09:15 TOPS-20 Bliss-36 4A(225) Page 4
001010 30-Dec-1982 17:28:34 DNET61:<DECNET.UTILITIES>CATB.BLI.1 (2)
AC0= 0
AC1= 1
AC2= 2
AC3= 3
AC4= 4
AC5= 5
AC6= 6
AC7= 7
AC10= 10
AC11= 11
AC12= 12
AC13= 13
AC14= 14
FP= 15
AC16= 16
SP= 17
RELOC 400000 ; 400000'
$CDTB:: PUSH SP,-1(SP) ; SP,BUF_PTR_ADR 400000' 261 17 0 17 777777 0114
PUSH SP,C.1 ; SP,[12] 400001' 261 17 0 00 400005'
PUSHJ SP,COTB ; SP,COTB 400002' 260 17 0 00 000000V
ADJSP SP,-2 ; SP,-2 400003' 105 17 0 00 777776
POPJ SP, ; SP, 400004' 263 17 0 00 000000 0081
C.1: EXP 12 ; 12 400005' 000000 000012
; Routine Size: 6 words
; 0121 1
CATB 12-Apr-1985 07:09:15 TOPS-20 Bliss-36 4A(225) Page 5
001010 30-Dec-1982 17:28:34 DNET61:<DECNET.UTILITIES>CATB.BLI.1 (3)
; 0122 1 GLOBAL ROUTINE $COTB (BUF_PTR_ADR) =
; 0123 1
; 0124 1 !++
; 0125 1 ! FUNCTIONAL DESCRIPTION:
; 0126 1 !
; 0127 1 !
; 0128 1 !
; 0129 1 !
; 0130 1 ! FORMAL PARAMETERS:
; 0131 1 !
; 0132 1 ! .BUF_PTR_ADR !Address of character sequence
; 0133 1 ! !pointer to buffer to extract
; 0134 1 ! !number from.
; 0135 1 !
; 0136 1 ! IMPLICIT INPUTS:
; 0137 1 !
; 0138 1 ! NONE
; 0139 1 !
; 0140 1 ! IMPLICIT OUTPUTS:
; 0141 1 !
; 0142 1 ! The buffer pointer ..BUF_PTR_ADR is updated to point past
; 0143 1 ! the characters used in the conversion.
; 0144 1 !
; 0145 1 ! ROUTINE VALUE:
; 0146 1 !
; 0147 1 ! The binary equivalent of the octal number.
; 0148 1 !
; 0149 1 ! SIDE EFFECTS
; 0150 1 !
; 0151 1 ! NONE
; 0152 1 !
; 0153 1 !--
; 0154 1
; 0155 2 BEGIN
; 0156 2
; 0157 2 LITERAL
; 0158 2 RADIX = 10; !Use a radix of 10.
; 0159 2
; 0160 2 COTB (.BUF_PTR_ADR, RADIX) !Convert the number.
; 0161 1 END; !OF $COTB
$COTB:: PUSH SP,-1(SP) ; SP,BUF_PTR_ADR 400006' 261 17 0 17 777777 0155
PUSH SP,C.1 ; SP,[12] 400007' 261 17 0 00 400005'
PUSHJ SP,COTB ; SP,COTB 400010' 260 17 0 00 000000V
ADJSP SP,-2 ; SP,-2 400011' 105 17 0 00 777776
POPJ SP, ; SP, 400012' 263 17 0 00 000000 0122
; Routine Size: 5 words
; 0162 1
CATB 12-Apr-1985 07:09:15 TOPS-20 Bliss-36 4A(225) Page 6
001010 30-Dec-1982 17:28:34 DNET61:<DECNET.UTILITIES>CATB.BLI.1 (4)
; 0163 1 ROUTINE COTB (BUF_PTR_ADR, RADIX) =
; 0164 1
; 0165 1 !++
; 0166 1 ! FUNCTIONAL DESCRIPTION:
; 0167 1 !
; 0168 1 !
; 0169 1 !
; 0170 1 !
; 0171 1 ! FORMAL PARAMETERS:
; 0172 1 !
; 0173 1 ! .BUF_PTR_ADR !Address of character sequence
; 0174 1 ! !pointer to buffer to extract
; 0175 1 ! !number from.
; 0176 1 ! RADIX !Radix for conversion
; 0177 1 !
; 0178 1 ! IMPLICIT INPUTS:
; 0179 1 !
; 0180 1 ! NONE
; 0181 1 !
; 0182 1 ! IMPLICIT OUTPUTS:
; 0183 1 !
; 0184 1 ! The buffer pointer ..BUF_PTR_ADR is updated to point past
; 0185 1 ! the characters used in the conversion.
; 0186 1 !
; 0187 1 ! ROUTINE VALUE:
; 0188 1 !
; 0189 1 ! The binary equivalent of the number in the specified radix.
; 0190 1 !
; 0191 1 ! SIDE EFFECTS
; 0192 1 !
; 0193 1 ! NONE
; 0194 1 !
; 0195 1 !--
; 0196 1
; 0197 2 BEGIN
; 0198 2
; 0199 2 LOCAL
; 0200 2 BUF_PTR,
; 0201 2 DIGIT, !NEXT digit FROM STRING
; 0202 2 VALUE; !RESULTING VALUE EXTRACTED
; 0203 2
; 0204 2 BUF_PTR = ..BUF_PTR_ADR;
; 0205 2 VALUE = 0;
; 0206 2
; 0207 2 WHILE (DIGIT = CH$RCHAR_A (BUF_PTR) - %C'0') GEQ 0 AND .DIGIT LSS .RADIX DO
; 0208 2 VALUE = (.VALUE*.RADIX) + .DIGIT;
; 0209 2
; 0210 2 .BUF_PTR_ADR = CH$PLUS (.BUF_PTR, -1);
; 0211 2 .VALUE
; 0212 1 END; !OF COTB
CATB 12-Apr-1985 07:09:15 TOPS-20 Bliss-36 4A(225) Page 7
001010 30-Dec-1982 17:28:34 DNET61:<DECNET.UTILITIES>CATB.BLI.1 (4)
COTB: MOVE AC3,-2(SP) ; AC3,BUF_PTR_ADR 400013' 200 03 0 17 777776 0204
MOVE AC5,0(AC3) ; BUF_PTR,0(AC3) 400014' 200 05 0 03 000000
SETZ AC4, ; VALUE, 400015' 400 04 0 00 000000 0205
L.1: ILDB AC1,AC5 ; AC1,BUF_PTR 400016' 134 01 0 00 000005 0207
MOVE AC2,AC1 ; DIGIT,AC1 400017' 200 02 0 00 000001
SUBI AC2,60 ; DIGIT,60 400020' 275 02 0 00 000060
JUMPL AC2,L.2 ; DIGIT,L.2 400021' 321 02 0 00 400031'
CAML AC2,-1(SP) ; DIGIT,RADIX 400022' 311 02 0 17 777777
JRST L.2 ; L.2 400023' 254 00 0 00 400031'
MOVE AC1,AC4 ; AC1,VALUE 400024' 200 01 0 00 000004 0208
IMUL AC1,-1(SP) ; AC1,RADIX 400025' 220 01 0 17 777777
MOVE AC4,AC1 ; VALUE,AC1 400026' 200 04 0 00 000001
ADD AC4,AC2 ; VALUE,DIGIT 400027' 270 04 0 00 000002
JRST L.1 ; L.1 400030' 254 00 0 00 400016' 0207
L.2: SETO AC1, ; AC1, 400031' 474 01 0 00 000000 0210
ADJBP AC1,AC5 ; AC1,BUF_PTR 400032' 133 01 0 00 000005
MOVEM AC1,0(AC3) ; AC1,0(AC3) 400033' 202 01 0 03 000000
MOVE AC1,AC4 ; AC1,VALUE 400034' 200 01 0 00 000004 0163
POPJ SP, ; SP, 400035' 263 17 0 00 000000
; Routine Size: 19 words
; 0213 1 END
; 0214 1
; 0215 0 ELUDOM
; Low segment length: 0 words
; High segment length: 30 words
; Size: 30 code + 0 data words
; Run Time: 00:00.7
; Elapsed Time: 00:01.0
; Lines/CPU Min: 17622
; Lexemes/CPU-Min: 18032
; Memory Used: 4 pages
; Compilation Complete