FOR$CNVOI       ; FORTRAN NON-FLOATING OUTPUT CONVERSION ROUTIN  21-AUG-1978 18:54:16   VAX-11 MACRO X0.3-11               Page   0

TABLE OF CONTENTS   



   (2)      98  DECLARATIONS

   (3)     152  FOR$CNV_OUT_I		; Integer Output Conversion Rout

   (4)     223  DIGITS_OUT		; Subroutine DIGITS_OUT

   (5)     260  FOR$CNV_OUT_O		; Octal Output Conversion Routin

   (6)     298  FOR$CNV_OUT_Z		; Hexadecimal Output Conversion 

   (7)     337  FOR$CNVOUT_L		; Logical Output Conversion Routi

FOR$CNVOI       ; FORTRAN NON-FLOATING OUTPUT CONVERSION ROUTIN  21-AUG-1978 18:54:16   VAX-11 MACRO X0.3-11               Page   1

01-6                                                                                                                             (1)



                                     0000     1 	.TITLE	FOR$CNVOI	; FORTRAN NON-FLOATING OUTPUT CONVERSION ROUTINE

                                     0000     2 				; (FOR$CNV_OUT_I, FOR$CNV_OUT_L, FOR$CNV_OUT_O,

                                     0000     3 				; FOR$CNV_OUT_Z)

                                     0000     4 	.IDENT	/01-6/		; File: FORCNVOI.MAR

                                     0000     5 

                                     0000     6 ;

                                     0000     7 ; Copyright (C) 1977

                                     0000     8 ; Digital Equipment Corporation, Maynard, Massachusetts 01754

                                     0000     9 ;

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

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

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

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

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

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

                                     0000    16 ; remain in DEC.

                                     0000    17 ;

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

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

                                     0000    20 ; Corporation.

                                     0000    21 ;

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

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

                                     0000    24 ;

                                     0000    25 ;

                                     0000    26 ; FACILITY: FORTRAN support library

                                     0000    27 ;++

                                     0000    28 ; ABSTRACT:

                                     0000    29 ; Procedures to perform Fortran Iw, Lw, Ow and Zw format output con-

                                     0000    30 ; version. FOR$CNV_OUT_I, FOR$CNV_OUT_L, FOR$CNV_OUT_O AND FOR$CNV_OUT_Z

                                     0000    31 ; are the output conversion routines which takes a longword value and returns

                                     0000    32 ; a formatted, right justified string as specified by a string

                                     0000    33 ; descriptor parameter.

                                     0000    34 ;

                                     0000    35 ; ENVIRONMENT: Any access mode -- normally user mode

                                     0000    36 ;

                                     0000    37 ;--

                                     0000    38 ;

                                     0000    39 ; AUTHOR: Peter Yuo, CREATION DATE: 15-Jan-77

                                     0000    40 ;

                                     0000    41 ; MODIFIED BY:

                                     0000    42 ;

                                     0000    43 ;	Peter Yuo, 24-Feb-77; VERSION 02

                                     0000    44 ;

                                     0000    45 ; 01-1 original

                                     0000    46 ; 01-2 call-by-value

                                     0000    47 ; 01-3 Code saving after code review

                                     0000    48 ;      Added IV enable, except for FOR$CNV_OUT_I

                                     0000    49 ; 01-4 Not saving registers at FOR$CNV_OUT_I entry

                                     0000    50 ; 01-6	Code bums for speed.  JMT 27-Mar-78

FOR$CNVOI       ; FORTRAN NON-FLOATING OUTPUT CONVERSION ROUTIN  21-AUG-1978 18:54:16   VAX-11 MACRO X0.3-11               Page   2

01-6            DECLARATIONS                                                                                                     (2)



                                     0000    52 	.SBTTL	DECLARATIONS

                                     0000    53 

                                     0000    54 ;

                                     0000    55 ; INCLUDE FILES:

                                     0000    56 ;

                                     0000    57 

                                     0000    58 ;

                                     0000    59 ; EXTERNAL SYMBOLS:

                                     0000    60 ;

                                     0000    61 	.DSABL	GBL

                                     0000    62 	.EXTRN	FOR$_OUTCONERR

                                     0000    63 

                                     0000    64 ;

                                     0000    65 ; MACROS:

                                     0000    66 ;

                                     0000    67 

                                     0000    68 ;

                                     0000    69 ; EQUATED SYMBOLS:

                                     0000    70 ;

                                     0000    71 

                           00000004  0000    72 	value	= 4			; longword value

                           00000008  0000    73 	out_str	= 8			; address of output string

                           0000403C  0000    74 	REGMASK	= ^M<IV, R2, R3, R4, R5>

                                     0000    75 					; register save mask and integer

                                     0000    76 					; overflow enable

                                     0000    77 

                                     0000    78 

                                     0000    79 ;

                                     0000    80 ; PSECT DECLARATIONS:

                                     0000    81 ;

                                     0000    82 

                                 00000000    83 	.PSECT	FOR$CODE	PIC, SHR, LONG, EXE, NOWRT

                                     0000    84 

                                     0000    85 ;

                                     0000    86 ; OWN STORAGE:

                                     0000    87 ;

                                     0000    88 

                                     0000    89 TABLE:					; table used to convert binary to ASCII

42 41 39 38 37 36 35 34 33 32 31 30  0000    90 	.ASCII	?0123456789ABCDEF?

                        46 45 44 43  000C       

                                     0010    91 

                                     0010    92 ;++

                                     0010    93 ; REGISTER USAGE:

                                     0010    94 ;

                                     0010    95 ; R0 - value to be converted, then completion status

                                     0010    96 ; R1 = high part of value (for EDIV)

                                     0010    97 ; R2 = remainder to be converted

                                     0010    98 ;

                                     0010    99 ; R3/R4 are setup from string descriptor out_str:

                                     0010   100 ;

                                     0010   101 ; R3 = # of character positions left in output field

                                     0010   102 ; R4 = adr. of next character position  on output

                                     0010   103 ; R5 = radix=8, 10, 16.

                                     0010   104 ;--

FOR$CNVOI       ; FORTRAN NON-FLOATING OUTPUT CONVERSION ROUTIN  21-AUG-1978 18:54:16   VAX-11 MACRO X0.3-11               Page   3

01-6            FOR$CNV_OUT_I  ; Integer Output Conversion Rout                                                                  (3)



                                     0010   106 	.SBTTL	FOR$CNV_OUT_I		; Integer Output Conversion Routine

                                     0010   107 

                                     0010   108 ;++

                                     0010   109 ; FUNCTIONAL DESCRIPTION:

                                     0010   110 ;

                                     0010   111 ;	Returns a formatted string which is the signed decimal

                                     0010   112 ;	representation of value with leading spaces. A positive

                                     0010   113 ;	number does not have a leading + while a negative number

                                     0010   114 ;	does. (FORTRAN specification).

                                     0010   115 ;

                                     0010   116 ; CALLING SEQUENCE:

                                     0010   117 ;

                                     0010   118 ;	Fits.wlc.v = FOR$CNV_OUT_I (value.rl.v, out_str.wt.ds)

                                     0010   119 ;

                                     0010   120 ; INPUT PARAMETERS:	NONE

                                     0010   121 ;

                                     0010   122 ; IMPLICIT INPUTS:	NONE

                                     0010   123 ;

                                     0010   124 ; OUTPUT PARAMETERS:	NONE

                                     0010   125 ;

                                     0010   126 ; IMPLICIT OUTPUTS:	NONE

                                     0010   127 ;

                                     0010   128 ; COMPLETION CODES:

                                     0010   129 ;	FOR$OUTCONERR - field overflow (filled with *'s)

                                     0010   130 ;	SS$_NORMAL - successful completion

                                     0010   131 ;

                                     0010   132 ; SIDE EFFECTS:	NONE

                                     0010   133 ;

                                     0010   134 ;--

                                     0010   135 

                                     0010   136 

                                     0010   137 

                               003C' 0010   138 	.ENTRY	FOR$CNV_OUT_I, REGMASK & ^C^M<IV>

                                     0012   139 					; Note: integer overflow disabled

            55            0A     D0  0012   140 	MOVL	#10, R5			; set radix to 10(decimal)

            50         04 AC     D0  0015   141 	MOVL	value(AP), R0		; R0 = X = value(AP)

                          0E     19  0019   142 	BLSS	NEG			; branch if x < 0

                                     001B   143 

                                     001B   144 COMMON_OUT_IOZ:				; common code for I, O, Z

                          1A     10  001B   145 	BSBB	DIGITS_OUT		; output digits

                          03     11  001D   146 	BRB	BLANKS_OUT		; output trailing blanks, if needed

                                     001F   147 ;

                                     001F   148 ; output leading blanks and RET to caller of this module

                                     001F   149 ;

                                     001F   150 BLANK_LOOP:

            74            20     90  001F   151 	MOVB	#^A/ /, -(R4)		; output blank

                                     0022   152 BLANKS_OUT:

            FA            53     F5  0022   153 	SOBGTR	R3, BLANK_LOOP		; branch back if more spaces for blanks

            50            01     D0  0025   154 	MOVL	#1, R0			; return SS$_NORMAL

                                 04  0028   155 	RET				; return

                                     0029   156 

                                     0029   157 

                                     0029   158 ;

                                     0029   159 ; X < 0

                                     0029   160 ;

                                     0029   161 NEG:

            50            50     CE  0029   162 	MNEGL	R0, R0			; R0 = |X|, form low 32-bits of 64-bit integer

FOR$CNVOI       ; FORTRAN NON-FLOATING OUTPUT CONVERSION ROUTIN  21-AUG-1978 18:54:16   VAX-11 MACRO X0.3-11               Page   4

01-6            FOR$CNV_OUT_I  ; Integer Output Conversion Rout                                                                  (3)



                                     002C   163 					; Note: integer overflow can occur for

                                     002C   164 					; largest negative integer. Ignored since

                                     002C   165 					; value unchanged, so proper 64-bit value					; in R1'R0

                          09     10  002C   166 	BSBB	DIGITS_OUT		; output digits

                                     002E   167 					; R0<0> error indicator, if error

                                     002E   168 					; output *'s and do a RET, don't

                                     002E   169 					; come back here

                                     002E   170 					; R3 = no. of spaces left

                          53     D7  002E   171 	DECL	R3			; one space for "-" sign

                          22     19  0030   172 	BLSS	ERROR			; output *'s then error return

                                     0032   173 					; (R4 = start of field)

            74            2D     90  0032   174 	MOVB	#^A/-/, -(R4)		; output "-" sign

                          EB     11  0035   175 	BRB	BLANKS_OUT		; output blanks and return from there

FOR$CNVOI       ; FORTRAN NON-FLOATING OUTPUT CONVERSION ROUTIN  21-AUG-1978 18:54:16   VAX-11 MACRO X0.3-11               Page   5

01-6            DIGITS_OUT  ; Subroutine DIGITS_OUT                                                                              (4)



                                     0037   177 	.SBTTL	DIGITS_OUT		; Subroutine DIGITS_OUT

                                     0037   178 

                                     0037   179 ;

                                     0037   180 ; Local JSB  Subroutine DIGITS_OUT -	outut right-justified digits part

                                     0037   181 ; inputs: eq = value, R5 = radis (8, 10, or 16)

                                     0037   182 ; return with RSB if no error. return with RET to caller of

                                     0037   183 ; FOR$CNV_OUT_x if error with R0=0 as error completion code.

                                     0037   184 ;

                                     0037   185 DIGITS_OUT:

            53         08 BC     7D  0037   186 	MOVQ	@out_str(AP), R3	; R3<15:0> = W, R4 = addr. of out_str

            53            53     3C  003B   187 	MOVZWL	R3, R3			; R3 = W

            54            53     C0  003E   188 	ADDL	R3, R4			; R4 = last addr. of out_str + 1

                          51     D4  0041   189 	CLRL	R1			; get ready for EDIV

                                     0043   190 					; R5 = radix

            50            55     7B  0043   191 AGAIN:	EDIV	R5, R0, R0, R2		; R0 = quotient

            52            50         0046       

                                     0048   192 					; R2 = remainder

            74         B4 AF42   90  0048   193 	MOVB	TABLE[R2], -(R4)	; output ASCII char

                          50     D5  004D   194 	TSTL	R0			; any conversion left to do?

                          12     13  004F   195 	BEQL	DIGITS_OUTX		; return (RSB) if no more conversion to do

            EF            53     F5  0051   196 	SOBGTR	R3, AGAIN		; branch if more to do and have spaces

                                     0054   197 					; for them

                                     0054   198 ;

                                     0054   199 ; come here if error, R4 = first address of field

                                     0054   200 ; fill entire field with *'s then RET to caller of FOR$CNV_OUT_x

                                     0054   201 ;

            6E            00     2C  0054   202 ERROR:	MOVC5	#0, (SP), #^A/*/, @out_str(AP), (R4)

         08 BC            2A         0057       

                          64         005A       

                                     005B   203 					; fill field with *'s

            50   00000000'8F     D0  005B   204 	MOVL	#FOR$_OUTCONERR, R0	; set error condition code

                                 04  0062   205 	RET				; return to caller of FOR$CNV_OUT_x

                                     0063   206 

                                     0063   207 ;

                                     0063   208 ; normal return from DIGITS_OUT local JSB routine

                                     0063   209 ;

                                     0063   210 

                                     0063   211 DIGITS_OUTX:

                                 05  0063   212 	RSB				; return to caller within this module

FOR$CNVOI       ; FORTRAN NON-FLOATING OUTPUT CONVERSION ROUTIN  21-AUG-1978 18:54:16   VAX-11 MACRO X0.3-11               Page   6

01-6            FOR$CNV_OUT_O  ; Octal Output Conversion Routin                                                                  (5)



                                     0064   214 	.SBTTL	FOR$CNV_OUT_O		; Octal Output Conversion Routine

                                     0064   215 

                                     0064   216 ;++

                                     0064   217 ; FUNCTIONAL DESCRIPTION:

                                     0064   218 ;

                                     0064   219 ;	Returns a formatted string which is the octal

                                     0064   220 ;	representation of value with leading spaces (FORTRAN specfication).

                                     0064   221 ;

                                     0064   222 ; CALLING SEQUENCE:

                                     0064   223 ;

                                     0064   224 ;	Fits.wlc.v = FOR$CNV_OUT_O (value.rl.v, out_str.wt.ds)

                                     0064   225 ;

                                     0064   226 ; INPUT PARAMETERS:	NONE

                                     0064   227 ;

                                     0064   228 ; IMPLICIT INPUTS:	NONE

                                     0064   229 ;

                                     0064   230 ; OUTPUT PARAMETERS:	NONE

                                     0064   231 ;

                                     0064   232 ; IMPLICIT OUTPUTS:	NONE

                                     0064   233 ;

                                     0064   234 ; COMPLETION CODES:

                                     0064   235 ;

                                     0064   236 ;	FOR$_OUTCONERR - field overflow (filled with *'s)

                                     0064   237 ;	SS$_NORMAL - success

                                     0064   238 ;

                                     0064   239 ; SIDE EFFECTS:	NONE

                                     0064   240 ;

                                     0064   241 ;--

                                     0064   242 

                                     0064   243 

                                     0064   244 

                               403C' 0064   245 	.ENTRY	FOR$CNV_OUT_O, REGMASK

                                     0066   246 					; disable DV (and FU), enable IV

                                     0066   247 

            55            08     D0  0066   248 	MOVL	#8, R5			; set radix to 8(decimal)

            50         04 AC     D0  0069   249 	MOVL	value(AP), R0		; R0 = input arg

                          AC     11  006D   250 	BRB	COMMON_OUT_IOZ

FOR$CNVOI       ; FORTRAN NON-FLOATING OUTPUT CONVERSION ROUTIN  21-AUG-1978 18:54:16   VAX-11 MACRO X0.3-11               Page   7

01-6            FOR$CNV_OUT_Z  ; Hexadecimal Output Conversion                                                                   (6)



                                     006F   252 	.SBTTL	FOR$CNV_OUT_Z		; Hexadecimal Output Conversion Routine

                                     006F   253 

                                     006F   254 ;++

                                     006F   255 ; FUNCTIONAL DESCRIPTION:

                                     006F   256 ;

                                     006F   257 ;	Returns a formatted string which is the  hexadecimal

                                     006F   258 ;	representation of value with leading spaces (FORTRAN

                                     006F   259 ;	specification).

                                     006F   260 ;

                                     006F   261 ; CALLING SEQUENCE:

                                     006F   262 ;

                                     006F   263 ;	Fits.wlc.v = FOR$CNV_OUT_Z (value.rl.v out_str.wt.ds)

                                     006F   264 ;

                                     006F   265 ; INPUT PARAMETERS:	NONE

                                     006F   266 ;

                                     006F   267 ; IMPLICIT INPUTS:	NONE

                                     006F   268 ;

                                     006F   269 ; OUTPUT PARAMETERS:	NONE

                                     006F   270 ;

                                     006F   271 ; IMPLICIT OUTPUTS:	NONE

                                     006F   272 ;

                                     006F   273 ; COMPLETION CODES

                                     006F   274 ;

                                     006F   275 ;	(0 = field overflow (filled with *'s), -1 = normal

                                     006F   276 ;

                                     006F   277 ;

                                     006F   278 ; SIDE EFFECTS:	NONE

                                     006F   279 ;

                                     006F   280 ;--

                                     006F   281 

                                     006F   282 

                                     006F   283 

                               403C' 006F   284 	.ENTRY	FOR$CNV_OUT_Z, REGMASK

                                     0071   285 					; disable DV (and FU), enable IV

                                     0071   286 

            55            10     D0  0071   287 	MOVL	#16, R5			; set radix to 16(decimal)

            50         04 AC     D0  0074   288 	MOVL	value(AP), R0		; R0 = X = value(AP)

                          A1     11  0078   289 	BRB	COMMON_OUT_IOZ		; output digits and fill with

FOR$CNVOI       ; FORTRAN NON-FLOATING OUTPUT CONVERSION ROUTIN  21-AUG-1978 18:54:16   VAX-11 MACRO X0.3-11               Page   8

01-6            FOR$CNVOUT_L  ; Logical Output Conversion Routi                                                                  (7)



                                     007A   291 	.SBTTL	FOR$CNVOUT_L		; Logical Output Conversion Routine

                                     007A   292 

                                     007A   293 ;++

                                     007A   294 ; FUNCTIONAL DESCRIPTION:

                                     007A   295 ;

                                     007A   296 ;	Returns a formatted string which is either T or F depending

                                     007A   297 ;	on whether value is true (bit 0 = 1) or false (bit 0 = 0)

                                     007A   298 ;	with leading spaces (FORTRAN specification).

                                     007A   299 ;

                                     007A   300 ; CALLING SEQUENCE:

                                     007A   301 ;

                                     007A   302 ;	Fits.wlc.v = FOR$CNV_OUT_L (value.rl.v, out_str.wt.ds)

                                     007A   303 ;

                                     007A   304 ; INPUT PARAMETERS:	NONE

                                     007A   305 ;

                                     007A   306 ; IMPLICIT INPUTS:	NONE

                                     007A   307 ;

                                     007A   308 ; OUTPUT PARAMETERS:	NONE

                                     007A   309 ;

                                     007A   310 ; IMPLICIT OUTPUTS:	NONE

                                     007A   311 ;

                                     007A   312 ; COMPLETION CODES:

                                     007A   313 ;

                                     007A   314 ;	FOR$_OUTCONERR - field overflow (filled with *'s)

                                     007A   315 ;	SS$_NORMAL - success

                                     007A   316 ;

                                     007A   317 ; SIDE EFFECTS:	NONE

                                     007A   318 ;

                                     007A   319 ;--

                                     007A   320 

                                     007A   321 

                                     007A   322 

                               403C' 007A   323 	.ENTRY	FOR$CNV_OUT_L, REGMASK

                                     007C   324 					; disable DV (and FU), enable IV

                                     007C   325 

            53         08 BC     7D  007C   326 	MOVQ	@out_str(AP), R3	; R3<15:0> = W, R4 = addr. of out_str

            53            53     3C  0080   327 	MOVZWL	R3, R3			; R3 = W

                          CF     13  0083   328 	BEQL	ERROR			; branch to ERROR is no

                                     0085   329 					; space (R4=first adr.)

                          03     11  0085   330 	BRB	2$			; go to end of loop

            84            20     90  0087   331 1$:	MOVB	#^A/ /, (R4)+		; fill the rest with blanks

            FA            53     F5  008A   332 2$:	SOBGTR	R3, 1$			; branch back to fill more blanks, except last

            50            01     D0  008D   333 	MOVL	#1, R0			; return SS$_NORMAL

            05         04 AC     E8  0090   334 	BLBS	value(AP), 3$		; test for bit of value, branch if true

            64         46 8F     90  0094   335 	MOVB	#^A/F/, (R4)		; set to "F"

                                 04  0098   336 	RET

                                     0099   337 

            64         54 8F     90  0099   338 3$:	MOVB	#^A/T/, (R4)		; set "T" for last character

                                 04  009D   339 	RET				; return

                                     009E   340 

                                     009E   341 

                                     009E   342 	.END

FOR$CNVOI       ; FORTRAN NON-FLOATING OUTPUT CONVERSION ROUTIN  21-AUG-1978 18:54:16   VAX-11 MACRO X0.3-11               Page   9

SYMBOL TABLE                                                                                                                     (7)



AGAIN            00000043 R     02   

BLANKS_OUT       00000022 R     02   

BLANK_LOOP       0000001F R     02   

COMMON_OUT_IOZ   0000001B R     02   

DIGITS_OUT       00000037 R     02   

DIGITS_OUTX      00000063 R     02   

ERROR            00000054 R     02   

FOR$CNV_OUT_I    00000010 RG    02   

FOR$CNV_OUT_L    0000007A RG    02   

FOR$CNV_OUT_O    00000064 RG    02   

FOR$CNV_OUT_Z    0000006F RG    02   

FOR$K_ERR_PREFX= 00000018            

FOR$_OUTCONERR   ********   X   01   

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            

NEG              00000029 R     02   

OUT_STR        = 00000008            

REGMASK        = 0000403C            

TABLE            00000000 R     02   

VALUE          = 00000004            





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  

FOR$CODE         0000009E      02       PIC   USR   CON   REL   LCL   SHR   EXE   RD  NOWRT LONG  





THERE WERE NO ERRORS OR WARNINGS.

27698. BYTES LEFT IN FREE MEMORY POOL.

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

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

