Google
 

Trailing-Edge - PDP-10 Archives - TOPS-20_V6.1_DECnetSrc_7-23-85 - mcb/utilities/cbta.lst
There are 2 other files named cbta.lst in the archive. Click here to see a list.
								12-Apr-1985 07:09:07	TOPS-20 Bliss-36 4A(225)	    Page   1
								30-Dec-1982 17:29:07	DNET61:<DECNET.UTILITIES>CBTA.BLI.1 (1)

;   0001  0	
;   0002  0	MODULE CBTA (					!Binary to ASCII conversion
;   0003  0			IDENT = '001010',
; P 0004  0			LANGUAGE (BLISS16, BLISS36) %BLISS36 (, ENTRY ($CBDAT, $CBDMG, $CBDSG, $CBOMG, $CBOSG, $CBTA,
;   0005  0			    $CBTMG))
;   0006  0			) =
;   0007  1	BEGIN
;   0008  1	!
;   0009  1	!
;   0010  1	!
;   0011  1	!                    COPYRIGHT (c) 1980, 1981, 1982
;   0012  1	!                    DIGITAL EQUIPMENT CORPORATION
;   0013  1	!                        Maynard, Massachusetts
;   0014  1	!
;   0015  1	!     This software is furnished under a license and may  be  used
;   0016  1	!     and copied only in accordance with the terms of such license
;   0017  1	!     and with the inclusion of the above copyright notice.   This
;   0018  1	!     software  or any other copies thereof may not be provided or
;   0019  1	!     otherwise made available to any other person.  No  title  to
;   0020  1	!     and ownership of the software is hereby transferred.
;   0021  1	!
;   0022  1	!     The information  in  this  software  is  subject  to  change
;   0023  1	!     without  notice  and should not be construed as a commitment
;   0024  1	!     by DIGITAL EQUIPMENT CORPORATION.
;   0025  1	!
;   0026  1	!     DIGITAL assumes no responsibility for the use or reliability
;   0027  1	!     of  its  software  on  equipment  which  is  not supplied by
;   0028  1	!     DIGITAL.
;   0029  1	!
;   0030  1	
;   0031  1	!++
;   0032  1	! FACILITY: SYSTEM LIBRARY
;   0033  1	!
;   0034  1	! ABSTRACT:
;   0035  1	!
;   0036  1	!
;   0037  1	! THIS MODULE CONTAINS ROUTINES FOR CONVERION OF BINARY TO VARIOUS
;   0038  1	! NUMERIC ASCII REPRESENTATIONS.
;   0039  1	!
;   0040  1	!
;   0041  1	! ENVIRONMENT: ANY
;   0042  1	!
;   0043  1	! AUTHOR: ALAN D. PECKHAM, CREATION DATE: 28-AUG-78
;   0044  1	!
;   0045  1	! MODIFIED BY:
;   0046  1	!
;   0047  1	!	, : VERSION
;   0048  1	! 01	-
;   0049  1	!--
;   0050  1	
;   0051  1	!
;   0052  1	! TABLE OF CONTENTS:
CBTA								12-Apr-1985 07:09:07	TOPS-20 Bliss-36 4A(225)	    Page   2
001010								30-Dec-1982 17:29:07	DNET61:<DECNET.UTILITIES>CBTA.BLI.1 (1)

;   0053  1	!
;   0054  1	
;   0055  1	FORWARD ROUTINE
;   0056  1	    $CBDAT,					!Convert 2-digit date
;   0057  1	    $CBDMG,					!Convert 5-digit unsigned decimal
;   0058  1	    $CBDSG,					!Convert 5-digit signed decimal
;   0059  1	    $CBOMG,					!Convert 6-digit unsigned octal
;   0060  1	    $CBOSG,					!Convert 6-digit signed octal
;   0061  1	    $CBTA,					!General convert binary to ASCII.
;   0062  1	    $CBTMG;					!Convert 3-digit byte to unsigned octal
;   0063  1	
;   0064  1	!
;   0065  1	! INCLUDE FILES
;   0066  1	!
;   0067  1	!	NONE
;   0068  1	!
;   0069  1	! MACROS:
;   0070  1	!
;   0071  1	!	NONE
;   0072  1	!
;   0073  1	! EQUATED SYMBOLS:
;   0074  1	!
;   0075  1	!	NONE
;   0076  1	!
;   0077  1	! OWN STORAGE:
;   0078  1	!
;   0079  1	!	NONE
;   0080  1	!
;   0081  1	! EXTERNAL REFERENCES:
;   0082  1	!
;   0083  1	!	NONE
;   0084  1	!
;   0085  1	
CBTA								12-Apr-1985 07:09:07	TOPS-20 Bliss-36 4A(225)	    Page   3
001010								30-Dec-1982 17:29:07	DNET61:<DECNET.UTILITIES>CBTA.BLI.1 (2)

;   0086  1	GLOBAL ROUTINE $CBDAT (BUF_PTR_ADR, VALUE, FLAGS) =
;   0087  1	
;   0088  1	!++
;   0089  1	! FUNCTIONAL DESCRIPTION:
;   0090  1	!
;   0091  1	!
;   0092  1	!
;   0093  1	!
;   0094  1	! FORMAL PARAMETERS:
;   0095  1	!
;   0096  1	!	.BUF_PTR_ADR				!Address of character sequence
;   0097  1	!						!pointer to buffer to insert
;   0098  1	!						!the number at.
;   0099  1	!	.VALUE					!The value to convert.
;   0100  1	!	.FLAGS					!Suppress leading zeros
;   0101  1	!						!if zero.
;   0102  1	!
;   0103  1	! IMPLICIT INPUTS:
;   0104  1	!
;   0105  1	!	NONE
;   0106  1	!
;   0107  1	! IMPLICIT OUTPUTS:
;   0108  1	!
;   0109  1	!	The buffer pointer ..BUF_PTR_ADR is updated to point past
;   0110  1	!	the characters inserted.
;   0111  1	!
;   0112  1	! ROUTINE VALUE:
;   0113  1	!
;   0114  1	!	The number of characters inserted into the output buffer.
;   0115  1	!
;   0116  1	! SIDE EFFECTS
;   0117  1	!
;   0118  1	!	NONE
;   0119  1	!
;   0120  1	!--
;   0121  1	
;   0122  2	    BEGIN
;   0123  2	
;   0124  2	    LITERAL
;   0125  2		RADIX = 10,
;   0126  2		WIDTH = 2,
;   0127  2		SUPPRESS = RADIX + WIDTH^11,
;   0128  2		NO_SUPPRESS = RADIX + WIDTH^11 + 1^9;
;   0129  2	
;   0130  2	    $CBTA (.BUF_PTR_ADR, .VALUE, (IF .FLAGS EQL 0 THEN SUPPRESS ELSE NO_SUPPRESS))
;   0131  1	    END;					!OF $CBDAT


	TITLE	CBTA
	TWOSEG
CBTA								12-Apr-1985 07:09:07	TOPS-20 Bliss-36 4A(225)	    Page   4
001010								30-Dec-1982 17:29:07	DNET61:<DECNET.UTILITIES>CBTA.BLI.1 (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		0122
	PUSH	SP,-3(SP)			; SP,VALUE				400001' 261 17 0 17 777775
	SKIPE	-3(SP)				; FLAGS					400002' 332 00 0 17 777775		0130
	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		0122
	ADJSP	SP,-3				; SP,-3					400010' 105 17 0 00 777775
	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  1	
CBTA								12-Apr-1985 07:09:07	TOPS-20 Bliss-36 4A(225)	    Page   5
001010								30-Dec-1982 17:29:07	DNET61:<DECNET.UTILITIES>CBTA.BLI.1 (3)

;   0133  1	GLOBAL ROUTINE $CBDMG (BUF_PTR_ADR, VALUE, FLAGS) =
;   0134  1	
;   0135  1	!++
;   0136  1	! FUNCTIONAL DESCRIPTION:
;   0137  1	!
;   0138  1	!
;   0139  1	!
;   0140  1	!
;   0141  1	! FORMAL PARAMETERS:
;   0142  1	!
;   0143  1	!	.BUF_PTR_ADR				!Address of character sequence
;   0144  1	!						!pointer to buffer to insert
;   0145  1	!						!the number at.
;   0146  1	!	.VALUE					!The value to convert.
;   0147  1	!	.FLAGS					!Suppress leading zeros
;   0148  1	!						!if zero.
;   0149  1	!
;   0150  1	! IMPLICIT INPUTS:
;   0151  1	!
;   0152  1	!	NONE
;   0153  1	!
;   0154  1	! IMPLICIT OUTPUTS:
;   0155  1	!
;   0156  1	!	The buffer pointer ..BUF_PTR_ADR is updated to point past
;   0157  1	!	the characters inserted.
;   0158  1	!
;   0159  1	! ROUTINE VALUE:
;   0160  1	!
;   0161  1	!	The number of characters inserted into the output buffer.
;   0162  1	!
;   0163  1	! SIDE EFFECTS
;   0164  1	!
;   0165  1	!	NONE
;   0166  1	!
;   0167  1	!--
;   0168  1	
;   0169  2	    BEGIN
;   0170  2	
;   0171  2	    LITERAL
;   0172  2		RADIX = 10,
;   0173  2		WIDTH = 5,
;   0174  2		SUPPRESS = RADIX + WIDTH^11,
;   0175  2		NO_SUPPRESS = RADIX + WIDTH^11 + 1^9;
;   0176  2	
;   0177  2	    $CBTA (.BUF_PTR_ADR, .VALUE, (IF .FLAGS EQL 0 THEN SUPPRESS ELSE NO_SUPPRESS))
;   0178  1	    END;					!OF $CBDMG


$CBDMG::PUSH	SP,-3(SP)			; SP,BUF_PTR_ADR			400014' 261 17 0 17 777775		0169
	PUSH	SP,-3(SP)			; SP,VALUE				400015' 261 17 0 17 777775
	SKIPE	-3(SP)				; FLAGS					400016' 332 00 0 17 777775		0177
	JRST	L.3				; L.3					400017' 254 00 0 00 400022'
CBTA								12-Apr-1985 07:09:07	TOPS-20 Bliss-36 4A(225)	    Page   6
001010								30-Dec-1982 17:29:07	DNET61:<DECNET.UTILITIES>CBTA.BLI.1 (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		0169
	ADJSP	SP,-3				; SP,-3					400024' 105 17 0 00 777775
	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  1	
CBTA								12-Apr-1985 07:09:07	TOPS-20 Bliss-36 4A(225)	    Page   7
001010								30-Dec-1982 17:29:07	DNET61:<DECNET.UTILITIES>CBTA.BLI.1 (4)

;   0180  1	GLOBAL ROUTINE $CBDSG (BUF_PTR_ADR, VALUE, FLAGS) =
;   0181  1	
;   0182  1	!++
;   0183  1	! FUNCTIONAL DESCRIPTION:
;   0184  1	!
;   0185  1	!
;   0186  1	!
;   0187  1	!
;   0188  1	! FORMAL PARAMETERS:
;   0189  1	!
;   0190  1	!	.BUF_PTR_ADR				!Address of character sequence
;   0191  1	!						!pointer to buffer to insert
;   0192  1	!						!the number at.
;   0193  1	!	.VALUE					!The value to convert.
;   0194  1	!	.FLAGS					!Suppress leading zeros
;   0195  1	!						!if zero.
;   0196  1	!
;   0197  1	! IMPLICIT INPUTS:
;   0198  1	!
;   0199  1	!	NONE
;   0200  1	!
;   0201  1	! IMPLICIT OUTPUTS:
;   0202  1	!
;   0203  1	!	The buffer pointer ..BUF_PTR_ADR is updated to point past
;   0204  1	!	the characters inserted.
;   0205  1	!
;   0206  1	! ROUTINE VALUE:
;   0207  1	!
;   0208  1	!	The number of characters inserted into the output buffer.
;   0209  1	!
;   0210  1	! SIDE EFFECTS
;   0211  1	!
;   0212  1	!	NONE
;   0213  1	!
;   0214  1	!--
;   0215  1	
;   0216  2	    BEGIN
;   0217  2	
;   0218  2	    LITERAL
;   0219  2		RADIX = 10,
;   0220  2		WIDTH = 5,
;   0221  2		SUPPRESS = RADIX + WIDTH^11 + 1^8,
;   0222  2		NO_SUPPRESS = RADIX + WIDTH^11 + 1^8 + 1^9;
;   0223  2	
;   0224  2	    $CBTA (.BUF_PTR_ADR, .VALUE, (IF .FLAGS EQL 0 THEN SUPPRESS ELSE NO_SUPPRESS))
;   0225  1	    END;					!OF $CBDSG


$CBDSG::PUSH	SP,-3(SP)			; SP,BUF_PTR_ADR			400030' 261 17 0 17 777775		0216
	PUSH	SP,-3(SP)			; SP,VALUE				400031' 261 17 0 17 777775
	SKIPE	-3(SP)				; FLAGS					400032' 332 00 0 17 777775		0224
	JRST	L.5				; L.5					400033' 254 00 0 00 400036'
CBTA								12-Apr-1985 07:09:07	TOPS-20 Bliss-36 4A(225)	    Page   8
001010								30-Dec-1982 17:29:07	DNET61:<DECNET.UTILITIES>CBTA.BLI.1 (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		0216
	ADJSP	SP,-3				; SP,-3					400040' 105 17 0 00 777775
	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  1	
CBTA								12-Apr-1985 07:09:07	TOPS-20 Bliss-36 4A(225)	    Page   9
001010								30-Dec-1982 17:29:07	DNET61:<DECNET.UTILITIES>CBTA.BLI.1 (5)

;   0227  1	GLOBAL ROUTINE $CBOMG (BUF_PTR_ADR, VALUE, FLAGS) =
;   0228  1	
;   0229  1	!++
;   0230  1	! FUNCTIONAL DESCRIPTION:
;   0231  1	!
;   0232  1	!
;   0233  1	!
;   0234  1	!
;   0235  1	! FORMAL PARAMETERS:
;   0236  1	!
;   0237  1	!	.BUF_PTR_ADR				!Address of character sequence
;   0238  1	!						!pointer to buffer to insert
;   0239  1	!						!the number at.
;   0240  1	!	.VALUE					!The value to convert.
;   0241  1	!	.FLAGS					!Suppress leading zeros
;   0242  1	!						!if zero.
;   0243  1	!
;   0244  1	! IMPLICIT INPUTS:
;   0245  1	!
;   0246  1	!	NONE
;   0247  1	!
;   0248  1	! IMPLICIT OUTPUTS:
;   0249  1	!
;   0250  1	!	The buffer pointer ..BUF_PTR_ADR is updated to point past
;   0251  1	!	the characters inserted.
;   0252  1	!
;   0253  1	! ROUTINE VALUE:
;   0254  1	!
;   0255  1	!	The number of characters inserted into the output buffer.
;   0256  1	!
;   0257  1	! SIDE EFFECTS
;   0258  1	!
;   0259  1	!	NONE
;   0260  1	!
;   0261  1	!--
;   0262  1	
;   0263  2	    BEGIN
;   0264  2	
;   0265  2	    LITERAL
;   0266  2		RADIX = 8,
;   0267  2		WIDTH = 6,
;   0268  2		SUPPRESS = RADIX + WIDTH^11,
;   0269  2		NO_SUPPRESS = RADIX + WIDTH^11 + 1^9;
;   0270  2	
;   0271  2	    $CBTA (.BUF_PTR_ADR, .VALUE, (IF .FLAGS EQL 0 THEN SUPPRESS ELSE NO_SUPPRESS))
;   0272  1	    END;					!OF $CBOMG


$CBOMG::PUSH	SP,-3(SP)			; SP,BUF_PTR_ADR			400044' 261 17 0 17 777775		0263
	PUSH	SP,-3(SP)			; SP,VALUE				400045' 261 17 0 17 777775
	SKIPE	-3(SP)				; FLAGS					400046' 332 00 0 17 777775		0271
	JRST	L.7				; L.7					400047' 254 00 0 00 400052'
CBTA								12-Apr-1985 07:09:07	TOPS-20 Bliss-36 4A(225)	    Page  10
001010								30-Dec-1982 17:29:07	DNET61:<DECNET.UTILITIES>CBTA.BLI.1 (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		0263
	ADJSP	SP,-3				; SP,-3					400054' 105 17 0 00 777775
	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  1	
CBTA								12-Apr-1985 07:09:07	TOPS-20 Bliss-36 4A(225)	    Page  11
001010								30-Dec-1982 17:29:07	DNET61:<DECNET.UTILITIES>CBTA.BLI.1 (6)

;   0274  1	GLOBAL ROUTINE $CBOSG (BUF_PTR_ADR, VALUE, FLAGS) =
;   0275  1	
;   0276  1	!++
;   0277  1	! FUNCTIONAL DESCRIPTION:
;   0278  1	!
;   0279  1	!
;   0280  1	!
;   0281  1	!
;   0282  1	! FORMAL PARAMETERS:
;   0283  1	!
;   0284  1	!	.BUF_PTR_ADR				!Address of character sequence
;   0285  1	!						!pointer to buffer to insert
;   0286  1	!						!the number at.
;   0287  1	!	.VALUE					!The value to convert.
;   0288  1	!	.FLAGS					!Suppress leading zeros
;   0289  1	!						!if zero.
;   0290  1	!
;   0291  1	! IMPLICIT INPUTS:
;   0292  1	!
;   0293  1	!	NONE
;   0294  1	!
;   0295  1	! IMPLICIT OUTPUTS:
;   0296  1	!
;   0297  1	!	The buffer pointer ..BUF_PTR_ADR is updated to point past
;   0298  1	!	the characters inserted.
;   0299  1	!
;   0300  1	! ROUTINE VALUE:
;   0301  1	!
;   0302  1	!	The number of characters inserted into the output buffer.
;   0303  1	!
;   0304  1	! SIDE EFFECTS
;   0305  1	!
;   0306  1	!	NONE
;   0307  1	!
;   0308  1	!--
;   0309  1	
;   0310  2	    BEGIN
;   0311  2	
;   0312  2	    LITERAL
;   0313  2		RADIX = 8,
;   0314  2		WIDTH = 6,
;   0315  2		SUPPRESS = RADIX + WIDTH^11 + 1^8,
;   0316  2		NO_SUPPRESS = RADIX + WIDTH^11 + 1^8 + 1^9;
;   0317  2	
;   0318  2	    $CBTA (.BUF_PTR_ADR, .VALUE, (IF .FLAGS EQL 0 THEN SUPPRESS ELSE NO_SUPPRESS))
;   0319  1	    END;					!OF $CBOSG


$CBOSG::PUSH	SP,-3(SP)			; SP,BUF_PTR_ADR			400060' 261 17 0 17 777775		0310
	PUSH	SP,-3(SP)			; SP,VALUE				400061' 261 17 0 17 777775
	SKIPE	-3(SP)				; FLAGS					400062' 332 00 0 17 777775		0318
	JRST	L.9				; L.9					400063' 254 00 0 00 400066'
CBTA								12-Apr-1985 07:09:07	TOPS-20 Bliss-36 4A(225)	    Page  12
001010								30-Dec-1982 17:29:07	DNET61:<DECNET.UTILITIES>CBTA.BLI.1 (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		0310
	ADJSP	SP,-3				; SP,-3					400070' 105 17 0 00 777775
	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  1	
CBTA								12-Apr-1985 07:09:07	TOPS-20 Bliss-36 4A(225)	    Page  13
001010								30-Dec-1982 17:29:07	DNET61:<DECNET.UTILITIES>CBTA.BLI.1 (7)

;   0321  1	GLOBAL ROUTINE $CBTA (BUF_PTR_ADR, VALUE, FLAGS) =
;   0322  1	
;   0323  1	!++
;   0324  1	! FUNCTIONAL DESCRIPTION:
;   0325  1	!
;   0326  1	!
;   0327  1	!
;   0328  1	!
;   0329  1	! FORMAL PARAMETERS:
;   0330  1	!
;   0331  1	!	.BUF_PTR_ADR				!Address of character sequence
;   0332  1	!						!pointer to buffer to insert
;   0333  1	!						!the number at.
;   0334  1	!	.VALUE					!The value to convert.
;   0335  1	!	.FLAGS<0,8>				!The conversion radix.
;   0336  1	!	.FLAGS<8,1>				!VALUE is signed in TRUE.
;   0337  1	!	.FLAGS<9,1>				!Don't compress leading zeros
;   0338  1	!	.FLAGS<10,1>				!Replace leading zeros with blanks
;   0339  1	!	.FLAGS<11,5>				!The maximum field length.
;   0340  1	!
;   0341  1	! IMPLICIT INPUTS:
;   0342  1	!
;   0343  1	!	NONE
;   0344  1	!
;   0345  1	! IMPLICIT OUTPUTS:
;   0346  1	!
;   0347  1	!	The buffer pointer ..BUF_PTR_ADR is updated to point past
;   0348  1	!	the characters inserted.
;   0349  1	!
;   0350  1	! ROUTINE VALUE:
;   0351  1	!
;   0352  1	!	The number of characters inserted into the output buffer.
;   0353  1	!
;   0354  1	! SIDE EFFECTS
;   0355  1	!
;   0356  1	!	NONE
;   0357  1	!
;   0358  1	!--
;   0359  1	
;   0360  2	    BEGIN
;   0361  2	
;   0362  2	    LOCAL
;   0363  2		BUF_PTR,
;   0364  2		BUF_PTR_INI,				!Initial pointer into buffer
;   0365  2		CHAR : VECTOR [32],			!Holding area for remainders
;   0366  2		CHAR_ADR,				!Character position index
;   0367  2		FIELD_LENGTH,				!Length of receiving field
;   0368  2		FILL_CHAR,				!Fill character.
;   0369  2		WORKING_VALUE;				!This is our copy of his number.
;   0370  2	
;   0371  2	    BIND
;   0372  2		RADIX = .FLAGS<0, 8>,			!Radix for conversion
CBTA								12-Apr-1985 07:09:07	TOPS-20 Bliss-36 4A(225)	    Page  14
001010								30-Dec-1982 17:29:07	DNET61:<DECNET.UTILITIES>CBTA.BLI.1 (7)

;   0373  2		SIGN_FLAG = .FLAGS<8, 1>,		!On if number should be signed
;   0374  2		COMPRESS_FLAG = .FLAGS<9, 1>,		!Zero compress if off
;   0375  2		SUPPRESS_FLAG = .FLAGS<10, 1>;		!On to change leading zeros to blanks
;   0376  2	
;   0377  2	    BUF_PTR_INI = (BUF_PTR = ..BUF_PTR_ADR);	!Save the initial buffer position
;   0378  2	    FIELD_LENGTH = .FLAGS<11, 5>;		!and get length of receiving field.
;   0379  2	    FILL_CHAR = %C'0';
;   0380  3	    WORKING_VALUE = (IF SIGN_FLAG AND .VALUE LSS 0 THEN
;   0381  4		BEGIN
;   0382  4		CH$WCHAR_A (%C'-', BUF_PTR);		!Insert a minus sign
;   0383  4		-.VALUE					!and make positive.
;   0384  4		END
;   0385  2	    ELSE .VALUE);				!Copy the number.
;   0386  2	
;   0387  2	    !+
;   0388  2	    ! Divide the value to death to get the individual digits.
;   0389  2	    !-
;   0390  2	
;   0391  2	    INCRA CHAR_ADR FROM CHAR [0] TO CHAR [.FIELD_LENGTH - 1] BY %UPVAL DO
;   0392  3		BEGIN
;   0393  3		.CHAR_ADR = .WORKING_VALUE MOD RADIX;	!Save the remainder
;   0394  3		WORKING_VALUE = .WORKING_VALUE/RADIX;	!and do the division.
;   0395  3	
;   0396  3		!+
;   0397  3		! Now turn the number into a digit. If the radix allows digits beyond 9,
;   0398  3		! map them up to 'A' through 'Z'.
;   0399  3		!-
;   0400  3	
;   0401  3		.CHAR_ADR = ..CHAR_ADR + (IF ..CHAR_ADR GTR 9 THEN %C'A' - 10 ELSE .FILL_CHAR);
;   0402  3	
;   0403  3		IF .WORKING_VALUE EQL 0
;   0404  3		THEN
;   0405  4		    BEGIN
;   0406  4	
;   0407  4		    !+
;   0408  4		    ! If we haven't run out of room in the output field, then check
;   0409  4		    ! for significant digit runout. If finished, shorten the field.
;   0410  4		    !-
;   0411  4	
;   0412  4		    IF NOT COMPRESS_FLAG THEN EXITLOOP (FIELD_LENGTH = (.CHAR_ADR - CHAR [0])/%UPVAL + 1);
;   0413  4	
;   0414  4		    !+
;   0415  4		    ! If supressing leading zeros, do this now.
;   0416  4		    !-
;   0417  4	
;   0418  4		    IF SUPPRESS_FLAG THEN FILL_CHAR = %C' ';
;   0419  4	
;   0420  3		    END;
;   0421  3	
;   0422  2		END;
;   0423  2	
;   0424  2	    !+
CBTA								12-Apr-1985 07:09:07	TOPS-20 Bliss-36 4A(225)	    Page  15
001010								30-Dec-1982 17:29:07	DNET61:<DECNET.UTILITIES>CBTA.BLI.1 (7)

;   0425  2	    ! The digits are extracted, place them into the output buffer.
;   0426  2	    !-
;   0427  2	
;   0428  2	    WHILE (FIELD_LENGTH = .FIELD_LENGTH - 1) GEQ 0 DO
;   0429  2		CH$WCHAR_A (.CHAR [.FIELD_LENGTH], BUF_PTR);	!Insert the digit.
;   0430  2	
;   0431  2	    .BUF_PTR_ADR = .BUF_PTR;			!Return updated buffer pointer
;   0432  2	    CH$DIFF (.BUF_PTR, .BUF_PTR_INI)		!and the number of characters inserted.
;   0433  1	    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	AC16,C.11			; AC16,[POINT 8,FLAGS,35]  <0,8>	400104' 135 16 0 00 400210'		0372
	LDB	AC10,C.12			; AC10,[POINT 1,FLAGS,26]  <9,1>	400105' 135 10 0 00 400211'		0374
	LDB	AC0,C.13			; AC0,[POINT 1,FLAGS,25]  <10,1>	400106' 135 00 0 00 400212'		0375
	MOVE	AC1,-52(SP)			; AC1,BUF_PTR_ADR			400107' 200 01 0 17 777726		0377
	MOVE	AC14,0(AC1)			; BUF_PTR,0(AC1)			400110' 200 14 0 01 000000
	MOVE	AC11,AC14			; BUF_PTR_INI,BUF_PTR			400111' 200 11 0 00 000014
	LDB	AC3,C.14			; FIELD_LENGTH,[POINT 5,FLAGS,24]  <11,5>
						;					400112' 135 03 0 00 400213'		0378
	MOVEI	AC4,60				; FILL_CHAR,60				400113' 201 04 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,AC14			; AC1,BUF_PTR				400121' 136 01 0 00 000014
	MOVN	AC13,-51(SP)			; WORKING_VALUE,VALUE			400122' 210 13 0 17 777727		0383
	JRST	L.12				; L.12					400123' 254 00 0 00 400125'		0380
L.11:	MOVE	AC13,-51(SP)			; WORKING_VALUE,VALUE			400124' 200 13 0 17 777727
L.12:	MOVEI	AC5,-37(SP)			; AC5,CHAR				400125' 201 05 0 17 777741		0391
	MOVEI	AC1,-37(SP)			; AC1,CHAR				400126' 201 01 0 17 777741
	ADD	AC1,AC3				; AC1,FIELD_LENGTH			400127' 270 01 0 00 000003
	MOVE	AC12,AC1			; AC12,AC1				400130' 200 12 0 00 000001
	SOJA	AC12,L.18			; AC12,L.18				400131' 364 12 0 00 400162'
L.13:	MOVE	AC1,AC13			; AC1,WORKING_VALUE			400132' 200 01 0 00 000013		0393
	IDIV	AC1,AC16			; AC1,AC16				400133' 230 01 0 00 000016
	MOVEM	AC2,0(AC5)			; AC2,0(CHAR_ADR)			400134' 202 02 0 05 000000
	MOVE	AC1,AC13			; AC1,WORKING_VALUE			400135' 200 01 0 00 000013		0394
	IDIV	AC1,AC16			; AC1,AC16				400136' 230 01 0 00 000016
	MOVE	AC13,AC1			; WORKING_VALUE,AC1			400137' 200 13 0 00 000001
	MOVEI	AC1,11				; AC1,11				400140' 201 01 0 00 000011		0401
	CAML	AC1,0(AC5)			; AC1,0(CHAR_ADR)			400141' 311 01 0 05 000000
	JRST	L.14				; L.14					400142' 254 00 0 00 400145'
	MOVEI	AC1,67				; AC1,67				400143' 201 01 0 00 000067
CBTA								12-Apr-1985 07:09:07	TOPS-20 Bliss-36 4A(225)	    Page  16
001010								30-Dec-1982 17:29:07	DNET61:<DECNET.UTILITIES>CBTA.BLI.1 (7)

	JRST	L.15				; L.15					400144' 254 00 0 00 400146'
L.14:	MOVE	AC1,AC4				; AC1,FILL_CHAR				400145' 200 01 0 00 000004
L.15:	ADDM	AC1,0(AC5)			; AC1,0(CHAR_ADR)			400146' 272 01 0 05 000000
	JUMPN	AC13,L.17			; WORKING_VALUE,L.17			400147' 326 13 0 00 400161'		0403
	TRNE	AC10,1				; AC10,1				400150' 602 10 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,AC5				; AC1,CHAR_ADR				400153' 274 01 0 00 000005
	MOVEI	AC3,1				; FIELD_LENGTH,1			400154' 201 03 0 00 000001
	SUB	AC3,AC1				; FIELD_LENGTH,AC1			400155' 274 03 0 00 000001
	JRST	L.19				; L.19					400156' 254 00 0 00 400164'
L.16:	TRNE	AC0,1				; AC0,1					400157' 602 00 0 00 000001		0418
	MOVEI	AC4,40				; FILL_CHAR,40				400160' 201 04 0 00 000040
L.17:	ADDI	AC5,1				; CHAR_ADR,1				400161' 271 05 0 00 000001		0391
L.18:	CAMG	AC5,AC12			; CHAR_ADR,AC12				400162' 317 05 0 00 000012
	JRST	L.13				; L.13					400163' 254 00 0 00 400132'
L.19:	SOJL	AC3,L.20			; FIELD_LENGTH,L.20			400164' 361 03 0 00 400172'		0428
	MOVEI	AC1,-37(SP)			; AC1,CHAR				400165' 201 01 0 17 777741		0429
	ADD	AC1,AC3				; AC1,FIELD_LENGTH			400166' 270 01 0 00 000003
	MOVE	AC1,0(AC1)			; AC1,0(AC1)				400167' 200 01 0 01 000000
	IDPB	AC1,AC14			; AC1,BUF_PTR				400170' 136 01 0 00 000014
	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	AC14,0(AC1)			; BUF_PTR,0(AC1)			400173' 202 14 0 01 000000
	PUSH	SP,AC14				; SP,BUF_PTR				400174' 261 17 0 00 000014		0432
	PUSH	SP,AC11				; SP,BUF_PTR_INI			400175' 261 17 0 00 000011
	PUSHJ	SP,CHDIF%			; SP,CHDIF%				400176' 260 17 0 00 000000*
	ADJSP	SP,-42				; SP,-42				400177' 105 17 0 00 777736
	POP	SP,AC16				; SP,AC16				400200' 262 17 0 00 000016		0321
	POP	SP,AC14				; SP,AC14				400201' 262 17 0 00 000014
	POP	SP,AC13				; SP,AC13				400202' 262 17 0 00 000013
	POP	SP,AC12				; SP,AC12				400203' 262 17 0 00 000012
	POP	SP,AC11				; SP,AC11				400204' 262 17 0 00 000011
	POP	SP,AC10				; SP,AC10				400205' 262 17 0 00 000010
	POP	SP,AC0				; SP,AC0				400206' 262 17 0 00 000000
	POPJ	SP,				; SP,					400207' 263 17 0 00 000000
C.11:	POINT	8,-50(SP),35			; 8,FLAGS,35				400210' 00 10 0 17 777730
C.12:	POINT	1,-50(SP),26			; 1,FLAGS,26				400211' 11 01 0 17 777730
C.13:	POINT	1,-50(SP),25			; 1,FLAGS,25				400212' 12 01 0 17 777730
C.14:	POINT	5,-50(SP),24			; 5,FLAGS,24				400213' 13 05 0 17 777730

; Routine Size:  80 words


;   0434  1	
CBTA								12-Apr-1985 07:09:07	TOPS-20 Bliss-36 4A(225)	    Page  17
001010								30-Dec-1982 17:29:07	DNET61:<DECNET.UTILITIES>CBTA.BLI.1 (8)

;   0435  1	GLOBAL ROUTINE $CBTMG (BUF_PTR_ADR, VALUE, FLAGS) =
;   0436  1	
;   0437  1	!++
;   0438  1	! FUNCTIONAL DESCRIPTION:
;   0439  1	!
;   0440  1	!
;   0441  1	!
;   0442  1	!
;   0443  1	! FORMAL PARAMETERS:
;   0444  1	!
;   0445  1	!	.BUF_PTR_ADR				!Address of character sequence
;   0446  1	!						!pointer to buffer to insert
;   0447  1	!						!the number at.
;   0448  1	!	.VALUE					!The value to convert.
;   0449  1	!	.FLAGS					!Suppress leading zeros
;   0450  1	!						!if zero.
;   0451  1	!
;   0452  1	! IMPLICIT INPUTS:
;   0453  1	!
;   0454  1	!	NONE
;   0455  1	!
;   0456  1	! IMPLICIT OUTPUTS:
;   0457  1	!
;   0458  1	!	The buffer pointer ..BUF_PTR_ADR is updated to point past
;   0459  1	!	the characters inserted.
;   0460  1	!
;   0461  1	! ROUTINE VALUE:
;   0462  1	!
;   0463  1	!	The number of characters inserted into the output buffer.
;   0464  1	!
;   0465  1	! SIDE EFFECTS
;   0466  1	!
;   0467  1	!	NONE
;   0468  1	!
;   0469  1	!--
;   0470  1	
;   0471  2	    BEGIN
;   0472  2	
;   0473  2	    LITERAL
;   0474  2		RADIX = 8,
;   0475  2		WIDTH = 3,
;   0476  2		SUPPRESS = RADIX + WIDTH^11,
;   0477  2		NO_SUPPRESS = RADIX + WIDTH^11 + 1^9;
;   0478  2	
;   0479  2	    $CBTA (.BUF_PTR_ADR, .VALUE, (IF .FLAGS EQL 0 THEN SUPPRESS ELSE NO_SUPPRESS))
;   0480  1	    END;					!OF $CBTMG


$CBTMG::PUSH	SP,-3(SP)			; SP,BUF_PTR_ADR			400214' 261 17 0 17 777775		0471
	PUSH	SP,-3(SP)			; SP,VALUE				400215' 261 17 0 17 777775
	SKIPE	-3(SP)				; FLAGS					400216' 332 00 0 17 777775		0479
	JRST	L.21				; L.21					400217' 254 00 0 00 400222'
CBTA								12-Apr-1985 07:09:07	TOPS-20 Bliss-36 4A(225)	    Page  18
001010								30-Dec-1982 17:29:07	DNET61:<DECNET.UTILITIES>CBTA.BLI.1 (8)

	PUSH	SP,C.15				; SP,[14010]				400220' 261 17 0 00 400226'
	JRST	L.22				; L.22					400221' 254 00 0 00 400223'
L.21:	PUSH	SP,C.16				; SP,[15010]				400222' 261 17 0 00 400227'
L.22:	PUSHJ	SP,$CBTA			; SP,$CBTA				400223' 260 17 0 00 400074'		0471
	ADJSP	SP,-3				; SP,-3					400224' 105 17 0 00 777775
	POPJ	SP,				; SP,					400225' 263 17 0 00 000000		0435
C.15:	EXP	14010				; 14010					400226' 000000	014010
C.16:	EXP	15010				; 15010					400227' 000000	015010

; Routine Size:  12 words


;   0481  1	
;   0482  1	END
;   0483  1	
;   0484  0	ELUDOM




; Low  segment length:       0 words
; High segment length:     152 words





; Size:		152 code + 0 data words
; Run Time:	   00:03.0
; Elapsed Time:	   00:05.4
; Lines/CPU Min:    9651
; Lexemes/CPU-Min: 19341
; Memory Used:	12 pages
; Compilation Complete