Trailing-Edge
-
PDP-10 Archives
-
BB-R598A-RM_1983
-
swskit-v3/listings/vnp36/cbta.list
There are no other files named cbta.list in the archive.
ONE
!
! MACROS:
!
! NONE
!
! EQUATED SYMBOLS:
!
! NONE
!
! OWN STORA 25-Jan-1983 10:27:16 TOPS-20 Bliss-36 2A(142) Page 1
1-Jan-1983 14:41:10 NETPKG:<VNP36>CBTA.BLI.7 (1)
; 0001
; 0002 MODULE CBTA ( !Binary to ASCII conversion
; 0003 IDENT = '001010',
; P 0004 LANGUAGE (BLISS16, BLISS36) %BLISS36 (, ENTRY ($CBDAT, $CBDMG, $CBDSG, $CBOMG, $CBOSG, $CBTA,
; 0005 $CBTMG))
; 0006 ) =
; 0007 BEGIN
; 0008 !
; 0009 !
; 0010 !
; 0011 ! COPYRIGHT (c) 1980, 1981, 1982
; 0012 ! DIGITAL EQUIPMENT CORPORATION
; 0013 ! Maynard, Massachusetts
; 0014 !
; 0015 ! This software is furnished under a license and may be used
; 0016 ! and copied only in accordance with the terms of such license
; 0017 ! and with the inclusion of the above copyright notice. This
; 0018 ! software or any other copies thereof may not be provided or
; 0019 ! otherwise made available to any other person. No title to
; 0020 ! and ownership of the software is hereby transferred.
; 0021 !
; 0022 ! The information in this software is subject to change
; 0023 ! without notice and should not be construed as a commitment
; 0024 ! by DIGITAL EQUIPMENT CORPORATION.
; 0025 !
; 0026 ! DIGITAL assumes no responsibility for the use or reliability
; 0027 ! of its software on equipment which is not supplied by
; 0028 ! DIGITAL.
; 0029 !
; 0030
; 0031 !++
; 0032 ! FACILITY: SYSTEM LIBRARY
; 0033 !
; 0034 ! ABSTRACT:
; 0035 !
; 0036 !
; 0037 ! THIS MODULE CONTAINS ROUTINES FOR CONVERION OF BINARY TO VARIOUS
; 0038 ! NUMERIC ASCII REPRESENTATIONS.
; 0039 !
; 0040 !
; 0041 ! ENVIRONMENT: ANY
; 0042 !
; 0043 ! AUTHOR: ALAN D. PECKHAM, CREATION DATE: 28-AUG-78
; 0044 !
; 0045 ! MODIFIED BY:
; 0046 !
; 0047 ! , : VERSION
; 0048 ! 01 -
; 0049 !--
; 0050
; 0051 !
; 0052 ! TABLE OF CONTENTS:
CBTA 25-Jan-1983 10:27:16 TOPS-20 Bliss-36 2A(142) Page 2
001010 1-Jan-1983 14:41:10 NETPKG:<VNP36>CBTA.BLI.7 (1)
; 0053 !
; 0054
; 0055 FORWARD ROUTINE
; 0056 $CBDAT, !Convert 2-digit date
; 0057 $CBDMG, !Convert 5-digit unsigned decimal
; 0058 $CBDSG, !Convert 5-digit signed decimal
; 0059 $CBOMG, !Convert 6-digit unsigned octal
; 0060 $CBOSG, !Convert 6-digit signed octal
; 0061 $CBTA, !General convert binary to ASCII.
; 0062 $CBTMG; !Convert 3-digit byte to unsigned octal
; 0063
; 0064 !
; 0065 ! INCLUDE FILES
; 0066 !
; 0067 ! NONE
; 0068 !
; 0069 ! MACROS:
; 0070 !
; 0071 ! NONE
; 0072 !
; 0073 ! EQUATED SYMBOLS:
; 0074 !
; 0075 ! NONE
; 0076 !
; 0077 ! OWN STORAGE:
; 0078 !
; 0079 ! NONE
; 0080 !
; 0081 ! EXTERNAL REFERENCES:
; 0082 !
; 0083 ! NONE
; 0084 !
; 0085
CBTA 25-Jan-1983 10:27:16 TOPS-20 Bliss-36 2A(142) Page 3
001010 1-Jan-1983 14:41:10 NETPKG:<VNP36>CBTA.BLI.7 (2)
; 0086 GLOBAL ROUTINE $CBDAT (BUF_PTR_ADR, VALUE, FLAGS) =
; 0087
; 0088 !++
; 0089 ! FUNCTIONAL DESCRIPTION:
; 0090 !
; 0091 !
; 0092 !
; 0093 !
; 0094 ! FORMAL PARAMETERS:
; 0095 !
; 0096 ! .BUF_PTR_ADR !Address of character sequence
; 0097 ! !pointer to buffer to insert
; 0098 ! !the number at.
; 0099 ! .VALUE !The value to convert.
; 0100 ! .FLAGS !Suppress leading zeros
; 0101 ! !if zero.
; 0102 !
; 0103 ! IMPLICIT INPUTS:
; 0104 !
; 0105 ! NONE
; 0106 !
; 0107 ! IMPLICIT OUTPUTS:
; 0108 !
; 0109 ! The buffer pointer ..BUF_PTR_ADR is updated to point past
; 0110 ! the characters inserted.
; 0111 !
; 0112 ! ROUTINE VALUE:
; 0113 !
; 0114 ! The number of characters inserted into the output buffer.
; 0115 !
; 0116 ! SIDE EFFECTS
; 0117 !
; 0118 ! NONE
; 0119 !
; 0120 !--
; 0121
; 0122 BEGIN
; 0123
; 0124 LITERAL
; 0125 RADIX = 10,
; 0126 WIDTH = 2,
; 0127 SUPPRESS = RADIX + WIDTH^11,
; 0128 NO_SUPPRESS = RADIX + WIDTH^11 + 1^9;
; 0129
; 0130 $CBTA (.BUF_PTR_ADR, .VALUE, (IF .FLAGS EQL 0 THEN SUPPRESS ELSE NO_SUPPRESS))
; 0131 END; !OF $CBDAT
TITLE CBTA
TWOSEG
CBTA 25-Jan-1983 10:27:16 TOPS-20 Bliss-36 2A(142) Page 4
001010 1-Jan-1983 14:41:10 NETPKG:<VNP36>CBTA.BLI.7 (2)
ENTRY $CBDAT, $CBDMG, $CBDSG, $CBOMG, $CBOSG, $CBTA, $CBTMG
.REQUEST SYS:B362LB.REL
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'
$CBDAT::PUSH SP,-3(SP) ; SP,BUF_PTR_ADR 400000' 261 17 0 17 777775 0130
PUSH SP,-3(SP) ; SP,VALUE 400001' 261 17 0 17 777775
SKIPE -3(SP) ; FLAGS 400002' 332 00 0 17 777775
JRST L.1 ; L.1 400003' 254 00 0 00 400006'
PUSH SP,C.1 ; SP,[10012] 400004' 261 17 0 00 400012'
JRST L.2 ; L.2 400005' 254 00 0 00 400007'
L.1: PUSH SP,C.2 ; SP,[11012] 400006' 261 17 0 00 400013'
L.2: PUSHJ SP,$CBTA ; SP,$CBTA 400007' 260 17 0 00 000000V
ADJSP SP,-3 ; SP,-3 400010' 105 17 0 00 777775 0122
POPJ SP, ; SP, 400011' 263 17 0 00 000000 0086
C.1: EXP 10012 ; 10012 400012' 000000 010012
C.2: EXP 11012 ; 11012 400013' 000000 011012
; Routine Size: 12 words
; 0132
CBTA 25-Jan-1983 10:27:16 TOPS-20 Bliss-36 2A(142) Page 5
001010 1-Jan-1983 14:41:10 NETPKG:<VNP36>CBTA.BLI.7 (3)
; 0133 GLOBAL ROUTINE $CBDMG (BUF_PTR_ADR, VALUE, FLAGS) =
; 0134
; 0135 !++
; 0136 ! FUNCTIONAL DESCRIPTION:
; 0137 !
; 0138 !
; 0139 !
; 0140 !
; 0141 ! FORMAL PARAMETERS:
; 0142 !
; 0143 ! .BUF_PTR_ADR !Address of character sequence
; 0144 ! !pointer to buffer to insert
; 0145 ! !the number at.
; 0146 ! .VALUE !The value to convert.
; 0147 ! .FLAGS !Suppress leading zeros
; 0148 ! !if zero.
; 0149 !
; 0150 ! IMPLICIT INPUTS:
; 0151 !
; 0152 ! NONE
; 0153 !
; 0154 ! IMPLICIT OUTPUTS:
; 0155 !
; 0156 ! The buffer pointer ..BUF_PTR_ADR is updated to point past
; 0157 ! the characters inserted.
; 0158 !
; 0159 ! ROUTINE VALUE:
; 0160 !
; 0161 ! The number of characters inserted into the output buffer.
; 0162 !
; 0163 ! SIDE EFFECTS
; 0164 !
; 0165 ! NONE
; 0166 !
; 0167 !--
; 0168
; 0169 BEGIN
; 0170
; 0171 LITERAL
; 0172 RADIX = 10,
; 0173 WIDTH = 5,
; 0174 SUPPRESS = RADIX + WIDTH^11,
; 0175 NO_SUPPRESS = RADIX + WIDTH^11 + 1^9;
; 0176
; 0177 $CBTA (.BUF_PTR_ADR, .VALUE, (IF .FLAGS EQL 0 THEN SUPPRESS ELSE NO_SUPPRESS))
; 0178 END; !OF $CBDMG
$CBDMG::PUSH SP,-3(SP) ; SP,BUF_PTR_ADR 400014' 261 17 0 17 777775 0177
PUSH SP,-3(SP) ; SP,VALUE 400015' 261 17 0 17 777775
SKIPE -3(SP) ; FLAGS 400016' 332 00 0 17 777775
JRST L.3 ; L.3 400017' 254 00 0 00 400022'
CBTA 25-Jan-1983 10:27:16 TOPS-20 Bliss-36 2A(142) Page 6
001010 1-Jan-1983 14:41:10 NETPKG:<VNP36>CBTA.BLI.7 (3)
PUSH SP,C.3 ; SP,[24012] 400020' 261 17 0 00 400026'
JRST L.4 ; L.4 400021' 254 00 0 00 400023'
L.3: PUSH SP,C.4 ; SP,[25012] 400022' 261 17 0 00 400027'
L.4: PUSHJ SP,$CBTA ; SP,$CBTA 400023' 260 17 0 00 000000V
ADJSP SP,-3 ; SP,-3 400024' 105 17 0 00 777775 0169
POPJ SP, ; SP, 400025' 263 17 0 00 000000 0133
C.3: EXP 24012 ; 24012 400026' 000000 024012
C.4: EXP 25012 ; 25012 400027' 000000 025012
; Routine Size: 12 words
; 0179
CBTA 25-Jan-1983 10:27:16 TOPS-20 Bliss-36 2A(142) Page 7
001010 1-Jan-1983 14:41:10 NETPKG:<VNP36>CBTA.BLI.7 (4)
; 0180 GLOBAL ROUTINE $CBDSG (BUF_PTR_ADR, VALUE, FLAGS) =
; 0181
; 0182 !++
; 0183 ! FUNCTIONAL DESCRIPTION:
; 0184 !
; 0185 !
; 0186 !
; 0187 !
; 0188 ! FORMAL PARAMETERS:
; 0189 !
; 0190 ! .BUF_PTR_ADR !Address of character sequence
; 0191 ! !pointer to buffer to insert
; 0192 ! !the number at.
; 0193 ! .VALUE !The value to convert.
; 0194 ! .FLAGS !Suppress leading zeros
; 0195 ! !if zero.
; 0196 !
; 0197 ! IMPLICIT INPUTS:
; 0198 !
; 0199 ! NONE
; 0200 !
; 0201 ! IMPLICIT OUTPUTS:
; 0202 !
; 0203 ! The buffer pointer ..BUF_PTR_ADR is updated to point past
; 0204 ! the characters inserted.
; 0205 !
; 0206 ! ROUTINE VALUE:
; 0207 !
; 0208 ! The number of characters inserted into the output buffer.
; 0209 !
; 0210 ! SIDE EFFECTS
; 0211 !
; 0212 ! NONE
; 0213 !
; 0214 !--
; 0215
; 0216 BEGIN
; 0217
; 0218 LITERAL
; 0219 RADIX = 10,
; 0220 WIDTH = 5,
; 0221 SUPPRESS = RADIX + WIDTH^11 + 1^8,
; 0222 NO_SUPPRESS = RADIX + WIDTH^11 + 1^8 + 1^9;
; 0223
; 0224 $CBTA (.BUF_PTR_ADR, .VALUE, (IF .FLAGS EQL 0 THEN SUPPRESS ELSE NO_SUPPRESS))
; 0225 END; !OF $CBDSG
$CBDSG::PUSH SP,-3(SP) ; SP,BUF_PTR_ADR 400030' 261 17 0 17 777775 0224
PUSH SP,-3(SP) ; SP,VALUE 400031' 261 17 0 17 777775
SKIPE -3(SP) ; FLAGS 400032' 332 00 0 17 777775
JRST L.5 ; L.5 400033' 254 00 0 00 400036'
CBTA 25-Jan-1983 10:27:16 TOPS-20 Bliss-36 2A(142) Page 8
001010 1-Jan-1983 14:41:10 NETPKG:<VNP36>CBTA.BLI.7 (4)
PUSH SP,C.5 ; SP,[24412] 400034' 261 17 0 00 400042'
JRST L.6 ; L.6 400035' 254 00 0 00 400037'
L.5: PUSH SP,C.6 ; SP,[25412] 400036' 261 17 0 00 400043'
L.6: PUSHJ SP,$CBTA ; SP,$CBTA 400037' 260 17 0 00 000000V
ADJSP SP,-3 ; SP,-3 400040' 105 17 0 00 777775 0216
POPJ SP, ; SP, 400041' 263 17 0 00 000000 0180
C.5: EXP 24412 ; 24412 400042' 000000 024412
C.6: EXP 25412 ; 25412 400043' 000000 025412
; Routine Size: 12 words
; 0226
CBTA 25-Jan-1983 10:27:16 TOPS-20 Bliss-36 2A(142) Page 9
001010 1-Jan-1983 14:41:10 NETPKG:<VNP36>CBTA.BLI.7 (5)
; 0227 GLOBAL ROUTINE $CBOMG (BUF_PTR_ADR, VALUE, FLAGS) =
; 0228
; 0229 !++
; 0230 ! FUNCTIONAL DESCRIPTION:
; 0231 !
; 0232 !
; 0233 !
; 0234 !
; 0235 ! FORMAL PARAMETERS:
; 0236 !
; 0237 ! .BUF_PTR_ADR !Address of character sequence
; 0238 ! !pointer to buffer to insert
; 0239 ! !the number at.
; 0240 ! .VALUE !The value to convert.
; 0241 ! .FLAGS !Suppress leading zeros
; 0242 ! !if zero.
; 0243 !
; 0244 ! IMPLICIT INPUTS:
; 0245 !
; 0246 ! NONE
; 0247 !
; 0248 ! IMPLICIT OUTPUTS:
; 0249 !
; 0250 ! The buffer pointer ..BUF_PTR_ADR is updated to point past
; 0251 ! the characters inserted.
; 0252 !
; 0253 ! ROUTINE VALUE:
; 0254 !
; 0255 ! The number of characters inserted into the output buffer.
; 0256 !
; 0257 ! SIDE EFFECTS
; 0258 !
; 0259 ! NONE
; 0260 !
; 0261 !--
; 0262
; 0263 BEGIN
; 0264
; 0265 LITERAL
; 0266 RADIX = 8,
; 0267 WIDTH = 6,
; 0268 SUPPRESS = RADIX + WIDTH^11,
; 0269 NO_SUPPRESS = RADIX + WIDTH^11 + 1^9;
; 0270
; 0271 $CBTA (.BUF_PTR_ADR, .VALUE, (IF .FLAGS EQL 0 THEN SUPPRESS ELSE NO_SUPPRESS))
; 0272 END; !OF $CBOMG
$CBOMG::PUSH SP,-3(SP) ; SP,BUF_PTR_ADR 400044' 261 17 0 17 777775 0271
PUSH SP,-3(SP) ; SP,VALUE 400045' 261 17 0 17 777775
SKIPE -3(SP) ; FLAGS 400046' 332 00 0 17 777775
JRST L.7 ; L.7 400047' 254 00 0 00 400052'
CBTA 25-Jan-1983 10:27:16 TOPS-20 Bliss-36 2A(142) Page 10
001010 1-Jan-1983 14:41:10 NETPKG:<VNP36>CBTA.BLI.7 (5)
PUSH SP,C.7 ; SP,[30010] 400050' 261 17 0 00 400056'
JRST L.8 ; L.8 400051' 254 00 0 00 400053'
L.7: PUSH SP,C.8 ; SP,[31010] 400052' 261 17 0 00 400057'
L.8: PUSHJ SP,$CBTA ; SP,$CBTA 400053' 260 17 0 00 000000V
ADJSP SP,-3 ; SP,-3 400054' 105 17 0 00 777775 0263
POPJ SP, ; SP, 400055' 263 17 0 00 000000 0227
C.7: EXP 30010 ; 30010 400056' 000000 030010
C.8: EXP 31010 ; 31010 400057' 000000 031010
; Routine Size: 12 words
; 0273
CBTA 25-Jan-1983 10:27:16 TOPS-20 Bliss-36 2A(142) Page 11
001010 1-Jan-1983 14:41:10 NETPKG:<VNP36>CBTA.BLI.7 (6)
; 0274 GLOBAL ROUTINE $CBOSG (BUF_PTR_ADR, VALUE, FLAGS) =
; 0275
; 0276 !++
; 0277 ! FUNCTIONAL DESCRIPTION:
; 0278 !
; 0279 !
; 0280 !
; 0281 !
; 0282 ! FORMAL PARAMETERS:
; 0283 !
; 0284 ! .BUF_PTR_ADR !Address of character sequence
; 0285 ! !pointer to buffer to insert
; 0286 ! !the number at.
; 0287 ! .VALUE !The value to convert.
; 0288 ! .FLAGS !Suppress leading zeros
; 0289 ! !if zero.
; 0290 !
; 0291 ! IMPLICIT INPUTS:
; 0292 !
; 0293 ! NONE
; 0294 !
; 0295 ! IMPLICIT OUTPUTS:
; 0296 !
; 0297 ! The buffer pointer ..BUF_PTR_ADR is updated to point past
; 0298 ! the characters inserted.
; 0299 !
; 0300 ! ROUTINE VALUE:
; 0301 !
; 0302 ! The number of characters inserted into the output buffer.
; 0303 !
; 0304 ! SIDE EFFECTS
; 0305 !
; 0306 ! NONE
; 0307 !
; 0308 !--
; 0309
; 0310 BEGIN
; 0311
; 0312 LITERAL
; 0313 RADIX = 8,
; 0314 WIDTH = 6,
; 0315 SUPPRESS = RADIX + WIDTH^11 + 1^8,
; 0316 NO_SUPPRESS = RADIX + WIDTH^11 + 1^8 + 1^9;
; 0317
; 0318 $CBTA (.BUF_PTR_ADR, .VALUE, (IF .FLAGS EQL 0 THEN SUPPRESS ELSE NO_SUPPRESS))
; 0319 END; !OF $CBOSG
$CBOSG::PUSH SP,-3(SP) ; SP,BUF_PTR_ADR 400060' 261 17 0 17 777775 0318
PUSH SP,-3(SP) ; SP,VALUE 400061' 261 17 0 17 777775
SKIPE -3(SP) ; FLAGS 400062' 332 00 0 17 777775
JRST L.9 ; L.9 400063' 254 00 0 00 400066'
CBTA 25-Jan-1983 10:27:16 TOPS-20 Bliss-36 2A(142) Page 12
001010 1-Jan-1983 14:41:10 NETPKG:<VNP36>CBTA.BLI.7 (6)
PUSH SP,C.9 ; SP,[30410] 400064' 261 17 0 00 400072'
JRST L.10 ; L.10 400065' 254 00 0 00 400067'
L.9: PUSH SP,C.10 ; SP,[31410] 400066' 261 17 0 00 400073'
L.10: PUSHJ SP,$CBTA ; SP,$CBTA 400067' 260 17 0 00 000000V
ADJSP SP,-3 ; SP,-3 400070' 105 17 0 00 777775 0310
POPJ SP, ; SP, 400071' 263 17 0 00 000000 0274
C.9: EXP 30410 ; 30410 400072' 000000 030410
C.10: EXP 31410 ; 31410 400073' 000000 031410
; Routine Size: 12 words
; 0320
CBTA 25-Jan-1983 10:27:16 TOPS-20 Bliss-36 2A(142) Page 13
001010 1-Jan-1983 14:41:10 NETPKG:<VNP36>CBTA.BLI.7 (7)
; 0321 GLOBAL ROUTINE $CBTA (BUF_PTR_ADR, VALUE, FLAGS) =
; 0322
; 0323 !++
; 0324 ! FUNCTIONAL DESCRIPTION:
; 0325 !
; 0326 !
; 0327 !
; 0328 !
; 0329 ! FORMAL PARAMETERS:
; 0330 !
; 0331 ! .BUF_PTR_ADR !Address of character sequence
; 0332 ! !pointer to buffer to insert
; 0333 ! !the number at.
; 0334 ! .VALUE !The value to convert.
; 0335 ! .FLAGS<0,8> !The conversion radix.
; 0336 ! .FLAGS<8,1> !VALUE is signed in TRUE.
; 0337 ! .FLAGS<9,1> !Don't compress leading zeros
; 0338 ! .FLAGS<10,1> !Replace leading zeros with blanks
; 0339 ! .FLAGS<11,5> !The maximum field length.
; 0340 !
; 0341 ! IMPLICIT INPUTS:
; 0342 !
; 0343 ! NONE
; 0344 !
; 0345 ! IMPLICIT OUTPUTS:
; 0346 !
; 0347 ! The buffer pointer ..BUF_PTR_ADR is updated to point past
; 0348 ! the characters inserted.
; 0349 !
; 0350 ! ROUTINE VALUE:
; 0351 !
; 0352 ! The number of characters inserted into the output buffer.
; 0353 !
; 0354 ! SIDE EFFECTS
; 0355 !
; 0356 ! NONE
; 0357 !
; 0358 !--
; 0359
; 0360 BEGIN
; 0361
; 0362 LOCAL
; 0363 BUF_PTR,
; 0364 BUF_PTR_INI, !Initial pointer into buffer
; 0365 CHAR : VECTOR [32], !Holding area for remainders
; 0366 CHAR_ADR, !Character position index
; 0367 FIELD_LENGTH, !Length of receiving field
; 0368 FILL_CHAR, !Fill character.
; 0369 WORKING_VALUE; !This is our copy of his number.
; 0370
; 0371 BIND
; 0372 RADIX = .FLAGS<0, 8>, !Radix for conversion
CBTA 25-Jan-1983 10:27:16 TOPS-20 Bliss-36 2A(142) Page 14
001010 1-Jan-1983 14:41:10 NETPKG:<VNP36>CBTA.BLI.7 (7)
; 0373 SIGN_FLAG = .FLAGS<8, 1>, !On if number should be signed
; 0374 COMPRESS_FLAG = .FLAGS<9, 1>, !Zero compress if off
; 0375 SUPPRESS_FLAG = .FLAGS<10, 1>; !On to change leading zeros to blanks
; 0376
; 0377 BUF_PTR_INI = (BUF_PTR = ..BUF_PTR_ADR); !Save the initial buffer position
; 0378 FIELD_LENGTH = .FLAGS<11, 5>; !and get length of receiving field.
; 0379 FILL_CHAR = %C'0';
; 0380 WORKING_VALUE = (IF SIGN_FLAG AND .VALUE LSS 0 THEN
; 0381 BEGIN
; 0382 CH$WCHAR_A (%C'-', BUF_PTR); !Insert a minus sign
; 0383 -.VALUE !and make positive.
; 0384 END
; 0385 ELSE .VALUE); !Copy the number.
; 0386
; 0387 !+
; 0388 ! Divide the value to death to get the individual digits.
; 0389 !-
; 0390
; 0391 INCRA CHAR_ADR FROM CHAR [0] TO CHAR [.FIELD_LENGTH - 1] DO
; 0392 BEGIN
; 0393 .CHAR_ADR = .WORKING_VALUE MOD RADIX; !Save the remainder
; 0394 WORKING_VALUE = .WORKING_VALUE/RADIX; !and do the division.
; 0395
; 0396 !+
; 0397 ! Now turn the number into a digit. If the radix allows digits beyond 9,
; 0398 ! map them up to 'A' through 'Z'.
; 0399 !-
; 0400
; 0401 .CHAR_ADR = ..CHAR_ADR + (IF ..CHAR_ADR GTR 9 THEN %C'A' - 10 ELSE .FILL_CHAR);
; 0402
; 0403 IF .WORKING_VALUE EQL 0
; 0404 THEN
; 0405 BEGIN
; 0406
; 0407 !+
; 0408 ! If we haven't run out of room in the output field, then check
; 0409 ! for significant digit runout. If finished, shorten the field.
; 0410 !-
; 0411
; 0412 IF NOT COMPRESS_FLAG THEN EXITLOOP (FIELD_LENGTH = (.CHAR_ADR - CHAR [0])/%UPVAL + 1);
; 0413
; 0414 !+
; 0415 ! If supressing leading zeros, do this now.
; 0416 !-
; 0417
; 0418 IF SUPPRESS_FLAG THEN FILL_CHAR = %C' ';
; 0419
; 0420 END;
; 0421
; 0422 END;
; 0423
; 0424 !+
CBTA 25-Jan-1983 10:27:16 TOPS-20 Bliss-36 2A(142) Page 15
001010 1-Jan-1983 14:41:10 NETPKG:<VNP36>CBTA.BLI.7 (7)
; 0425 ! The digits are extracted, place them into the output buffer.
; 0426 !-
; 0427
; 0428 WHILE (FIELD_LENGTH = .FIELD_LENGTH - 1) GEQ 0 DO
; 0429 CH$WCHAR_A (.CHAR [.FIELD_LENGTH], BUF_PTR); !Insert the digit.
; 0430
; 0431 .BUF_PTR_ADR = .BUF_PTR; !Return updated buffer pointer
; 0432 CH$DIFF (.BUF_PTR, .BUF_PTR_INI) !and the number of characters inserted.
; 0433 END; !OF $CBTA
$CBTA:: PUSH SP,AC0 ; SP,AC0 400074' 261 17 0 00 000000 0321
PUSH SP,AC10 ; SP,AC10 400075' 261 17 0 00 000010
PUSH SP,AC11 ; SP,AC11 400076' 261 17 0 00 000011
PUSH SP,AC12 ; SP,AC12 400077' 261 17 0 00 000012
PUSH SP,AC13 ; SP,AC13 400100' 261 17 0 00 000013
PUSH SP,AC14 ; SP,AC14 400101' 261 17 0 00 000014
PUSH SP,AC16 ; SP,AC16 400102' 261 17 0 00 000016
ADJSP SP,40 ; SP,40 400103' 105 17 0 00 000040
LDB AC0,C.11 ; AC0,[POINT 8,FLAGS,35] <0,8> 400104' 135 00 0 00 400211' 0360
LDB AC11,C.12 ; AC11,[POINT 1,FLAGS,26] <9,1> 400105' 135 11 0 00 400212'
LDB AC10,C.13 ; AC10,[POINT 1,FLAGS,25] <10,1> 400106' 135 10 0 00 400213'
MOVE AC1,-52(SP) ; AC1,BUF_PTR_ADR 400107' 200 01 0 17 777726 0377
MOVE AC16,0(AC1) ; BUF_PTR,0(AC1) 400110' 200 16 0 01 000000
MOVE AC12,AC16 ; BUF_PTR_INI,BUF_PTR 400111' 200 12 0 00 000016
LDB AC4,C.14 ; FIELD_LENGTH,[POINT 5,FLAGS,24] <11,5>
; 400112' 135 04 0 00 400214' 0378
MOVEI AC14,60 ; FILL_CHAR,60 400113' 201 14 0 00 000060 0379
MOVEI AC1,400 ; AC1,400 400114' 201 01 0 00 000400 0380
TDNE AC1,-50(SP) ; AC1,FLAGS 400115' 612 01 0 17 777730
SKIPL -51(SP) ; VALUE 400116' 331 00 0 17 777727
JRST L.11 ; L.11 400117' 254 00 0 00 400124'
MOVEI AC1,55 ; AC1,55 400120' 201 01 0 00 000055 0382
IDPB AC1,AC16 ; AC1,BUF_PTR 400121' 136 01 0 00 000016
MOVN AC5,-51(SP) ; WORKING_VALUE,VALUE 400122' 210 05 0 17 777727 0383
JRST L.12 ; L.12 400123' 254 00 0 00 400125' 0380
L.11: MOVE AC5,-51(SP) ; WORKING_VALUE,VALUE 400124' 200 05 0 17 777727
L.12: MOVEI AC3,-37(SP) ; AC3,CHAR 400125' 201 03 0 17 777741 0391
MOVEI AC1,-37(SP) ; AC1,CHAR 400126' 201 01 0 17 777741
ADD AC1,AC4 ; AC1,FIELD_LENGTH 400127' 270 01 0 00 000004
MOVE AC13,AC1 ; AC13,AC1 400130' 200 13 0 00 000001
SOJA AC13,L.18 ; AC13,L.18 400131' 364 13 0 00 400162'
L.13: MOVE AC1,AC5 ; AC1,WORKING_VALUE 400132' 200 01 0 00 000005 0393
IDIV AC1,AC0 ; AC1,AC0 400133' 230 01 0 00 000000
MOVEM AC2,0(AC3) ; AC2,0(CHAR_ADR) 400134' 202 02 0 03 000000
MOVE AC1,AC5 ; AC1,WORKING_VALUE 400135' 200 01 0 00 000005 0394
IDIV AC1,AC0 ; AC1,AC0 400136' 230 01 0 00 000000
MOVE AC5,AC1 ; WORKING_VALUE,AC1 400137' 200 05 0 00 000001
MOVEI AC1,11 ; AC1,11 400140' 201 01 0 00 000011 0401
CAML AC1,0(AC3) ; AC1,0(CHAR_ADR) 400141' 311 01 0 03 000000
JRST L.14 ; L.14 400142' 254 00 0 00 400145'
MOVEI AC1,67 ; AC1,67 400143' 201 01 0 00 000067
CBTA 25-Jan-1983 10:27:16 TOPS-20 Bliss-36 2A(142) Page 16
001010 1-Jan-1983 14:41:10 NETPKG:<VNP36>CBTA.BLI.7 (7)
JRST L.15 ; L.15 400144' 254 00 0 00 400146'
L.14: MOVE AC1,AC14 ; AC1,FILL_CHAR 400145' 200 01 0 00 000014
L.15: ADDM AC1,0(AC3) ; AC1,0(CHAR_ADR) 400146' 272 01 0 03 000000
JUMPN AC5,L.17 ; WORKING_VALUE,L.17 400147' 326 05 0 00 400161' 0403
TRNE AC11,1 ; AC11,1 400150' 602 11 0 00 000001 0412
JRST L.16 ; L.16 400151' 254 00 0 00 400157'
MOVEI AC1,-37(SP) ; AC1,CHAR 400152' 201 01 0 17 777741
SUB AC1,AC3 ; AC1,CHAR_ADR 400153' 274 01 0 00 000003
MOVEI AC4,1 ; FIELD_LENGTH,1 400154' 201 04 0 00 000001
SUB AC4,AC1 ; FIELD_LENGTH,AC1 400155' 274 04 0 00 000001
JRST L.19 ; L.19 400156' 254 00 0 00 400164'
L.16: TRNE AC10,1 ; AC10,1 400157' 602 10 0 00 000001 0418
MOVEI AC14,40 ; FILL_CHAR,40 400160' 201 14 0 00 000040
L.17: ADDI AC3,1 ; CHAR_ADR,1 400161' 271 03 0 00 000001 0391
L.18: CAMG AC3,AC13 ; CHAR_ADR,AC13 400162' 317 03 0 00 000013
JRST L.13 ; L.13 400163' 254 00 0 00 400132'
L.19: SOJL AC4,L.20 ; FIELD_LENGTH,L.20 400164' 361 04 0 00 400172' 0428
MOVEI AC1,-37(SP) ; AC1,CHAR 400165' 201 01 0 17 777741 0429
ADD AC1,AC4 ; AC1,FIELD_LENGTH 400166' 270 01 0 00 000004
MOVE AC1,0(AC1) ; AC1,0(AC1) 400167' 200 01 0 01 000000
IDPB AC1,AC16 ; AC1,BUF_PTR 400170' 136 01 0 00 000016
JRST L.19 ; L.19 400171' 254 00 0 00 400164' 0428
L.20: MOVE AC1,-52(SP) ; AC1,BUF_PTR_ADR 400172' 200 01 0 17 777726 0431
MOVEM AC16,0(AC1) ; BUF_PTR,0(AC1) 400173' 202 16 0 01 000000
PUSH SP,AC16 ; SP,BUF_PTR 400174' 261 17 0 00 000016 0432
PUSH SP,AC12 ; SP,BUF_PTR_INI 400175' 261 17 0 00 000012
PUSHJ SP,CHDIF% ; SP,CHDIF% 400176' 260 17 0 00 000000*
ADJSP SP,-2 ; SP,-2 400177' 105 17 0 00 777776 0360
ADJSP SP,-40 ; SP,-40 400200' 105 17 0 00 777740 0321
POP SP,AC16 ; SP,AC16 400201' 262 17 0 00 000016
POP SP,AC14 ; SP,AC14 400202' 262 17 0 00 000014
POP SP,AC13 ; SP,AC13 400203' 262 17 0 00 000013
POP SP,AC12 ; SP,AC12 400204' 262 17 0 00 000012
POP SP,AC11 ; SP,AC11 400205' 262 17 0 00 000011
POP SP,AC10 ; SP,AC10 400206' 262 17 0 00 000010
POP SP,AC0 ; SP,AC0 400207' 262 17 0 00 000000
POPJ SP, ; SP, 400210' 263 17 0 00 000000
C.11: POINT 8,-50(SP),35 ; 8,FLAGS,35 400211' 00 10 0 17 777730
C.12: POINT 1,-50(SP),26 ; 1,FLAGS,26 400212' 11 01 0 17 777730
C.13: POINT 1,-50(SP),25 ; 1,FLAGS,25 400213' 12 01 0 17 777730
C.14: POINT 5,-50(SP),24 ; 5,FLAGS,24 400214' 13 05 0 17 777730
; Routine Size: 81 words
; 0434
CBTA 25-Jan-1983 10:27:16 TOPS-20 Bliss-36 2A(142) Page 17
001010 1-Jan-1983 14:41:10 NETPKG:<VNP36>CBTA.BLI.7 (8)
; 0435 GLOBAL ROUTINE $CBTMG (BUF_PTR_ADR, VALUE, FLAGS) =
; 0436
; 0437 !++
; 0438 ! FUNCTIONAL DESCRIPTION:
; 0439 !
; 0440 !
; 0441 !
; 0442 !
; 0443 ! FORMAL PARAMETERS:
; 0444 !
; 0445 ! .BUF_PTR_ADR !Address of character sequence
; 0446 ! !pointer to buffer to insert
; 0447 ! !the number at.
; 0448 ! .VALUE !The value to convert.
; 0449 ! .FLAGS !Suppress leading zeros
; 0450 ! !if zero.
; 0451 !
; 0452 ! IMPLICIT INPUTS:
; 0453 !
; 0454 ! NONE
; 0455 !
; 0456 ! IMPLICIT OUTPUTS:
; 0457 !
; 0458 ! The buffer pointer ..BUF_PTR_ADR is updated to point past
; 0459 ! the characters inserted.
; 0460 !
; 0461 ! ROUTINE VALUE:
; 0462 !
; 0463 ! The number of characters inserted into the output buffer.
; 0464 !
; 0465 ! SIDE EFFECTS
; 0466 !
; 0467 ! NONE
; 0468 !
; 0469 !--
; 0470
; 0471 BEGIN
; 0472
; 0473 LITERAL
; 0474 RADIX = 8,
; 0475 WIDTH = 3,
; 0476 SUPPRESS = RADIX + WIDTH^11,
; 0477 NO_SUPPRESS = RADIX + WIDTH^11 + 1^9;
; 0478
; 0479 $CBTA (.BUF_PTR_ADR, .VALUE, (IF .FLAGS EQL 0 THEN SUPPRESS ELSE NO_SUPPRESS))
; 0480 END; !OF $CBTMG
$CBTMG::PUSH SP,-3(SP) ; SP,BUF_PTR_ADR 400215' 261 17 0 17 777775 0479
PUSH SP,-3(SP) ; SP,VALUE 400216' 261 17 0 17 777775
SKIPE -3(SP) ; FLAGS 400217' 332 00 0 17 777775
JRST L.21 ; L.21 400220' 254 00 0 00 400223'
CBTA 25-Jan-1983 10:27:16 TOPS-20 Bliss-36 2A(142) Page 18
001010 1-Jan-1983 14:41:10 NETPKG:<VNP36>CBTA.BLI.7 (8)
PUSH SP,C.15 ; SP,[14010] 400221' 261 17 0 00 400227'
JRST L.22 ; L.22 400222' 254 00 0 00 400224'
L.21: PUSH SP,C.16 ; SP,[15010] 400223' 261 17 0 00 400230'
L.22: PUSHJ SP,$CBTA ; SP,$CBTA 400224' 260 17 0 00 400074'
ADJSP SP,-3 ; SP,-3 400225' 105 17 0 00 777775 0471
POPJ SP, ; SP, 400226' 263 17 0 00 000000 0435
C.15: EXP 14010 ; 14010 400227' 000000 014010
C.16: EXP 15010 ; 15010 400230' 000000 015010
; Routine Size: 12 words
; 0481
; 0482 END
; 0483
; 0484 ELUDOM
END
; Low segment length: 0 words
; High segment length: 153 words
; Size: 153 code + 0 data words
; Run Time: 00:03.4
; Elapsed Time: 00:10.2
; Memory Used: 11 pages
; Compilation Complete