COM$R50ASC      ; FORTRAN COMPATIBILITY - RADIX 50 TO ASCII CON  21-AUG-1978 18:53:33   VAX-11 MACRO X0.3-11               Page   0

TABLE OF CONTENTS   



   (2)      91  HISTORY		; Detailed Current Edit History

   (3)     101  DECLARATIONS

   (4)     186  R50ASC - RADIX 50 TO ASCII CONVERSION ROUTINE

COM$R50ASC      ; FORTRAN COMPATIBILITY - RADIX 50 TO ASCII CON  21-AUG-1978 18:53:33   VAX-11 MACRO X0.3-11               Page   1

00-07                                                                                                                            (1)



                                     0000     1 	.TITLE	COM$R50ASC	; FORTRAN COMPATIBILITY - RADIX 50 TO ASCII CONVERSION ROUTINE

                                     0000     2 	.IDENT	/00-07/		; File: COMR50ASC.MAR

                                     0000     3 

                                     0000     4 ;

                                     0000     5 ; Copyright (C) 1977

                                     0000     6 ; Digital Equipment Corporation, Maynard, Massachusetts 01754

                                     0000     7 ;

                                     0000     8 ; This software is furnished under a license for use only on a single

                                     0000     9 ; computer  system  and  may be copied only with the inclusion of the

                                     0000    10 ; above copyright notice. This software, or any other copies thereof,

                                     0000    11 ; may not be provided or otherwise made available to any other person

                                     0000    12 ; except for use on such system and to one who agree to these license 

                                     0000    13 ; terms.  Title to  and  ownership of the software shall at all times 

                                     0000    14 ; remain in DEC.

                                     0000    15 ;

                                     0000    16 ; The information in the software is subject to change without notice

                                     0000    17 ; and should  not  be construed  as a commitment by Digital Equipment 

                                     0000    18 ; Corporation.

                                     0000    19 ;

                                     0000    20 ; DEC assumes  no  responsibility  for the use or  reliability of its

                                     0000    21 ; software on equipment which is not supplied by DEC.

                                     0000    22 ;

                                     0000    23 ;

                                     0000    24 ; FACILITY: FORTRAN COMPATIBILITY LIBRARY

                                     0000    25 ;++

                                     0000    26 ; ABSTRACT:

                                     0000    27 ;

                                     0000    28 ;	R50ASC is a FORTRAN callable procedure to convert radix-50 strings

                                     0000    29 ;	into ASCII Hollerith strings.

                                     0000    30 ;

                                     0000    31 ;--

                                     0000    32 ;

                                     0000    33 ; VERSION: 0

                                     0000    34 ;

                                     0000    35 ; HISTORY:

                                     0000    36 ;

                                     0000    37 ; AUTHOR:

                                     0000    38 ;	Peter Yuo, 9-Sep-77: Version 0

                                     0000    39 ;

                                     0000    40 ; MODIFIED BY:

                                     0000    41 ;

                                     0000    42 ;

                                     0000    43 ;

COM$R50ASC      ; FORTRAN COMPATIBILITY - RADIX 50 TO ASCII CON  21-AUG-1978 18:53:33   VAX-11 MACRO X0.3-11               Page   2

00-07           HISTORY  ; Detailed Current Edit History                                                                         (2)



                                     0000    45 	.SBTTL	HISTORY		; Detailed Current Edit History

                                     0000    46 

                                     0000    47 

                                     0000    48 ; Edit History for Version 01 of R50ASC

                                     0000    49 ;

                                     0000    50 

                                     0000    51 ; 0-03	Correct constant values for EDIV instructions

                                     0000    52 ; 00-06	- Change file name to COMR50ASC.MAR, PSECT to F4PCOMPAT.  TNH 5-Jan-78

                                     0000    53 ; 00-07	- Bug fix: don't use no_output_char for input count!  JMT 13-Feb-78

COM$R50ASC      ; FORTRAN COMPATIBILITY - RADIX 50 TO ASCII CON  21-AUG-1978 18:53:33   VAX-11 MACRO X0.3-11               Page   3

00-07           DECLARATIONS                                                                                                     (3)



                                     0000    55 	.SBTTL	DECLARATIONS

                                     0000    56 

                                     0000    57 ;

                                     0000    58 ; INCLUDE FILES:

                                     0000    59 ;

                                     0000    60 

                                     0000    61 ;

                                     0000    62 ; EXTERNAL SYMBOLS:

                                     0000    63 ;

                                     0000    64 

                                     0000    65 ;

                                     0000    66 ; MACROS:

                                     0000    67 ;

                                     0000    68 

                                     0000    69 ;

                                     0000    70 ; PSECT DECLARATIONS:

                                     0000    71 ;

                                 00000000    72 	.PSECT	F4PCOMPAT$CODE	PIC,USR,CON,REL,LCL,SHR,EXE,RD,NOWRT

                                     0000    73 

                                     0000    74 ;

                                     0000    75 ; EQUATED SYMBOLS:

                                     0000    76 ;

                                     0000    77 

                           00000004  0000    78 	no_output_char	= 4		; no_output_char.rw.r

                           00000008  0000    79 	radix50_array	= 8		; radix50_array.rbu.ra

                           0000000C  0000    80 	ascii_array	= 12		; ascii_array.wbu.ra

                           00000640  0000    81 	L_50_POWER_2	= ^X0@16 + ^X640

                                     0000    82 					; 50(octal)**2

                                     0000    83 

                                     0000    84 ;

                                     0000    85 ; OWN STORAGE:

                                     0000    86 ;

                                     0000    87 

                                     0000    88 ASCII_TAB:

                                 20  0000    89 	.BYTE	^O40			; 0 - space

                                 41  0001    90 	.BYTE	^O101			; 1 - 'A'

                                 42  0002    91 	.BYTE	^O102			; 2 - 'B'

                                 43  0003    92 	.BYTE	^O103			; 3 - 'C'

                                 44  0004    93 	.BYTE	^O104			; 4 - 'D'

                                 45  0005    94 	.BYTE	^O105			; 5 - 'E'

                                 46  0006    95 	.BYTE	^O106			; 6 - 'F'

                                 47  0007    96 	.BYTE	^O107			; 7 - 'G'

                                 48  0008    97 	.BYTE	^O110			; 10 - 'H'

                                 49  0009    98 	.BYTE	^O111			; 11 - 'I'

                                 4A  000A    99 	.BYTE	^O112			; 12 - 'J'

                                 4B  000B   100 	.BYTE	^O113			; 13 - 'K'

                                 4C  000C   101 	.BYTE	^O114			; 14 - 'L'

                                 4D  000D   102 	.BYTE	^O115			; 15 - 'M'

                                 4E  000E   103 	.BYTE	^O116			; 16 - 'N'

                                 4F  000F   104 	.BYTE	^O117			; 17 - 'O'

                                 50  0010   105 	.BYTE	^O120			; 20 - 'P'

                                 51  0011   106 	.BYTE	^O121			; 21 - 'Q'

                                 52  0012   107 	.BYTE	^O122			; 22 - 'R'

                                 53  0013   108 	.BYTE	^O123			; 23 - 'S'

                                 54  0014   109 	.BYTE	^O124			; 24 - 'T'

                                 55  0015   110 	.BYTE	^O125			; 25 - 'U'

                                 56  0016   111 	.BYTE	^O126			; 26 - 'V'

COM$R50ASC      ; FORTRAN COMPATIBILITY - RADIX 50 TO ASCII CON  21-AUG-1978 18:53:33   VAX-11 MACRO X0.3-11               Page   4

00-07           DECLARATIONS                                                                                                     (3)



                                 57  0017   112 	.BYTE	^O127			; 27 - 'W'

                                 58  0018   113 	.BYTE	^O130			; 30 - 'X'

                                 59  0019   114 	.BYTE	^O131			; 31 - 'Y'

                                 5A  001A   115 	.BYTE	^O132			; 32 - 'Z'

                                 24  001B   116 	.BYTE	^O44			; 33 - '$'

                                 2E  001C   117 	.BYTE	^O56			; 34 - '.'

                                 3F  001D   118 	.BYTE	^O77			; 35 - unused

                                 30  001E   119 	.BYTE	^O60			; 36 - '0'

                                 31  001F   120 	.BYTE	^O61			; 37 - '1'

                                 32  0020   121 	.BYTE	^O62			; 40 - '2'

                                 33  0021   122 	.BYTE	^O63			; 41 - '3'

                                 34  0022   123 	.BYTE	^O64			; 42 - '4'

                                 35  0023   124 	.BYTE	^O65			; 43 - '5'

                                 36  0024   125 	.BYTE	^O66			; 44 - '6'

                                 37  0025   126 	.BYTE	^O67			; 45 - '7'

                                 38  0026   127 	.BYTE	^O70			; 46 - '8'

                                 39  0027   128 	.BYTE	^O71			; 47 - '9'

                                     0028   129 

                                     0028   130 ;

                                     0028   131 ; REGISTER USAGE:

                                     0028   132 ;

                                     0028   133 ; R0:R1 - current word for processing ( use quadword in order to use EDIV)

                                     0028   134 ; R2 - holds remainder for EDIV

                                     0028   135 ; R3 - CHARS_REM, remaining number of output chars to produce

                                     0028   136 ; R4 - NEXT_INPUT_POSITION, next radix-50 input position

                                     0028   137 ; R5 - NEXT_OUTPUT_POSITION, next ASCII output position

                                     0028   138 ;

COM$R50ASC      ; FORTRAN COMPATIBILITY - RADIX 50 TO ASCII CON  21-AUG-1978 18:53:33   VAX-11 MACRO X0.3-11               Page   5

00-07           R50ASC - RADIX 50 TO ASCII CONVERSION ROUTINE                                                                    (4)



                                     0028   140 	.SBTTL	R50ASC - RADIX 50 TO ASCII CONVERSION ROUTINE

                                     0028   141 

                                     0028   142 ;++

                                     0028   143 ; FUNCTIONAL DESCRIPTION:

                                     0028   144 ;

                                     0028   145 ;	Algoritmic steps:

                                     0028   146 ;	1) Initialization

                                     0028   147 ;	   CHARS_REM = no_output_char.rw.r

                                     0028   148 ;	   NEXT_INPUT_POSITION = radix50_array.rbu.ra

                                     0028   149 ;	   NEXT_OUTPUT_POSITION = ascii_array.wbu.ra

                                     0028   150 ;	2) If CHARS_REM =< 0 then DONE

                                     0028   151 ;	3) Get current word for processing

                                     0028   152 ;	4) If overflow then (output '???', go to step 6)

                                     0028   153 ;	5) Do conversion

                                     0028   154 ;	   [Note] n is a word value, so longword division will not produce

                                     0028   155 ;	   negative results

                                     0028   156 ;	   a. (Let n = a2*50**2 + a1 * 50 + a0)

                                     0028   157 ;	      Divide n by 50**2. (n = q1*50**2 + r1)

                                     0028   158 ;	      ASCII_TAB[q1] is 1st ASCII char to output

                                     0028   159 ;	   b. Divide r1 by 50. (r1 = q2*50 + r2)

                                     0028   160 ;	      ASCII_TAB[q2] is 2nd ASCII char to output

                                     0028   161 ;	      ASCII_TAB[r2] is 3rd ASCII char to output

                                     0028   162 ;	6) CHARS_REM = CHARS_REM -3

                                     0028   163 ;	7) Go back to step 2

                                     0028   164 ;

                                     0028   165 ; CALLING SEQUENCE:

                                     0028   166 ;

                                     0028   167 ;	CALL R50ASC (no_output_char.rw.r, radix50_array.rbu.ra,

                                     0028   168 ;			ascii_array.rbu.ra)

                                     0028   169 ;

                                     0028   170 ;

                                     0028   171 ; INPUT PARAMETERS:

                                     0028   172 ;

                                     0028   173 ;	no_output_char.rw.r	; the max number of output chars to produce

                                     0028   174 ;	radix50_array.rbu.ra	; address of radix-50 input location

                                     0028   175 ;

                                     0028   176 ; IMPLICIT INPUTS:

                                     0028   177 ;	NONE

                                     0028   178 ;

                                     0028   179 ; OUTPUT PARAMETERS:

                                     0028   180 ;

                                     0028   181 ;	ascii_array.wbu,ra	; addres of ascii output location

                                     0028   182 ;

                                     0028   183 ; IMPLICIT OUTPUTS:

                                     0028   184 ;	NONE

                                     0028   185 ;

                                     0028   186 ; COMPLETION CODES:

                                     0028   187 ;	NONE

                                     0028   188 ;

                                     0028   189 ; SIDE EFFECTS:

                                     0028   190 ;	NONE

                                     0028   191 ;

                                     0028   192 ;--

                                     0028   193 

                                     0028   194 

                                     0028   195 

                               403C' 0028   196 	.ENTRY	R50ASC, ^M<IV, R2, R3, R4, R5>

COM$R50ASC      ; FORTRAN COMPATIBILITY - RADIX 50 TO ASCII CON  21-AUG-1978 18:53:33   VAX-11 MACRO X0.3-11               Page   6

00-07           R50ASC - RADIX 50 TO ASCII CONVERSION ROUTINE                                                                    (4)



                                     002A   197 					; standard call-by-reference entry

                                     002A   198 					; enable integer overflow

                                     002A   199 ;

                                     002A   200 ; Initialization

                                     002A   201 ;

                                     002A   202 

            53         04 BC     3C  002A   203 	MOVZWL	@no_output_char(AP), R3	; R3 = CHARS_REM

            54         08 AC     D0  002E   204 	MOVL	radix50_array(AP), R4	; R4 = NEXT_INPUT_POSITION

            55         0C AC     D0  0032   205 	MOVL	ascii_array(AP), R5	; R5 = NEXT_OUTPUT_POSITION

                          51     D4  0036   206 	CLRL	R1			; R1 always zero

                                     0038   207 

                                     0038   208 ;

                                     0038   209 ; If CHARS_REM <= 0, then DONE

                                     0038   210 ;

                                     0038   211 

                                     0038   212 AGAIN:

                          53     D5  0038   213 	TSTL	R3

                          3E     15  003A   214 	BLEQ	DONE

                                     003C   215 

                                     003C   216 ;

                                     003C   217 ; Get current word for processing

                                     003C   218 ;

                                     003C   219 

            50            84     3C  003C   220 	MOVZWL	(R4)+, R0		; R0/R1 = current word for processing

                                     003F   221 					; use quadword for EDIV

                                     003F   222 

                                     003F   223 ;

                                     003F   224 ; If overflow then output '???'

                                     003F   225 ;

                                     003F   226 

   0000F9FF 8F            50     D1  003F   227 	CMPL	R0, #^O174777		; 174777(octal) is largest radix 50

                                     0046   228 					; value in a word

                          07     19  0046   229 	BLSS	GOOD			; branch if value is good

            50   0000B9E5 8F     D0  0048   230 	MOVL	#^O134745, R0		; RAD50 for '???'

                                     004F   231 

                                     004F   232 ;

                                     004F   233 ; Do actual conversion

                                     004F   234 ;

                                     004F   235 

                          53     D7  004F   236 GOOD:	DECL	R3			; dec byte count

                          27     19  0051   237 	BLSS	DONE			; and quit if it was 0

            50   00000640 8F     7B  0053   238 	EDIV	#L_50_POWER_2, R0, R2, R0

            50            52         005A       

                                     005C   239 					; divide current word (n) in R0/R1 by

                                     005C   240 					; 50(octal)**2,

                                     005C   241 					; n = q1 * 50(octal)**2 + r1

                                     005C   242 					; R2 = q1, R0 = r1

            85         A0 AF42   90  005C   243 	MOVB	ASCII_TAB[R2], (R5)+	; output corresponding ascii char

                          53     D7  0061   244 	DECL	R3			; dec byte count again

                          15     19  0063   245 	BLSS	DONE			; and branch if it was 0

            50            28     7B  0065   246 	EDIV	#^O50, R0, R2, R0	; q1 = q2 * 50(octal) + r2

            50            52         0068       

                                     006A   247 					; R0/R1 = q1, R2 = q2, R0 = r2

            85         92 AF42   90  006A   248 	MOVB	ASCII_TAB[R2], (R5)+	; output 2nd char

                          53     D7  006F   249 	DECL	R3			; last byte for this RAD50 word

                          07     19  0071   250 	BLSS	DONE			; done if it was 0

            85         89 AF40   90  0073   251 	MOVB	ASCII_TAB[R0], (R5)+	; output 3rd char

COM$R50ASC      ; FORTRAN COMPATIBILITY - RADIX 50 TO ASCII CON  21-AUG-1978 18:53:33   VAX-11 MACRO X0.3-11               Page   7

00-07           R50ASC - RADIX 50 TO ASCII CONVERSION ROUTINE                                                                    (4)



                          BE     11  0078   252 	BRB	AGAIN			; get next input RAD50 word

                                     007A   253 

                                     007A   254 ;

                                     007A   255 ; DONE

                                     007A   256 ;

                                 04  007A   257 DONE:	RET

                                     007B   258 

                                     007B   259 	.END

COM$R50ASC      ; FORTRAN COMPATIBILITY - RADIX 50 TO ASCII CON  21-AUG-1978 18:53:33   VAX-11 MACRO X0.3-11               Page   8

SYMBOL TABLE                                                                                                                     (4)



AGAIN            00000038 R     02   

ASCII_ARRAY    = 0000000C            

ASCII_TAB        00000000 R     02   

DONE             0000007A R     02   

FOR$K_ERR_PREFX= 00000018            

GOOD             0000004F R     02   

L_50_POWER_2   = 00000640            

MTH$K_ERR_PREFX= 00000016            

MTH__FLOOVEMAT = 00000058            

MTH__FLOUNDMAT = 00000059            

MTH__INVARG    = 00000051            

MTH__LOGZERNEG = 00000053            

MTH__SINSIGLOS = 00000057            

MTH__SQUROONEG = 00000054            

MTH__UNDEXP    = 00000052            

MTH__WRONUMARG = 00000050            

NO_OUTPUT_CHAR = 00000004            

R50ASC           00000028 RG    02   

RADIX50_ARRAY  = 00000008            





PROGRAM SECTION SYNOPSIS



.  ABS  .        00000000      00     NOPIC   USR   CON   ABS   LCL NOSHR NOEXE NORD  NOWRT BYTE  

. BLANK .        00000000      01     NOPIC   USR   CON   REL   LCL NOSHR   EXE   RD    WRT BYTE  

F4PCOMPAT$CODE   0000007B      02       PIC   USR   CON   REL   LCL   SHR   EXE   RD  NOWRT BYTE  





THERE WERE NO ERRORS OR WARNINGS.

27902. BYTES LEFT IN FREE MEMORY POOL.

OBJ$:COMR50ASC,LIS$:COMR50ASC/-SP=LIB$:S/ML,SRC$:P,COMR50ASC

0 MLB DIR RDS - 0 GETS TO DEFINE 0 MACROS. 3 INTER. FILE WRITES. 

