

; Bliss-32 10.1-416	Monday 21-AUG-1978 23:00:19	DBB3:[F11A.SRC]MAKSTR.B32;7					Page 1

;

;	0001	MODULE MAKSTR (

;	0002			LANGUAGE (BLISS32),

;	0003			IDENT = 'A0002A'

;	0004			) =

;	0005	BEGIN

;	0006	

;	0007	!

;	0008	! Copyright (c) 1977

;	0009	! Digital Equipment Corporation, Maynard, Massachusetts 01754

;	0010	!

;	0011	! This software is furnished  under a license for use only on a single

;	0012	! computer  system and  may be  copied only with  the inclusion of the

;	0013	! above copyright notice.  This software, or any other copies thereof,

;	0014	! may not be provided or  otherwise made available to any other person

;	0015	! except for use on such system and to one who agrees to these license

;	0016	! terms.  Title to and  ownership of the  software  shall at all times

;	0017	! remain in DEC.

;	0018	!

;	0019	! The information in this software is subject to change without notice

;	0020	! and should  not be construed  as a commitment  by Digital  Equipment

;	0021	! Corporation.

;	0022	!

;	0023	! DEC assumes  no  responsibility  for  the use or  reliability of its

;	0024	! software on equipment which is not supplied by DEC.

;	0025	

;	0026	!++

;	0027	!

;	0028	! FACILITY:  F11ACP Structure Level 1

;	0029	!

;	0030	! ABSTRACT:

;	0031	!

;	0032	!	This routine converts a RAD-50 file name block into the

;	0033	!	equivalent ASCII name string.

;	0034	!

;	0035	! ENVIRONMENT:

;	0036	!

;	0037	!	STARLET operating system, including privileged system services

;	0038	!	and internal exec routines.

;	0039	!

;	0040	!--

;	0041	!

;	0042	!

;	0043	! AUTHOR:  Andrew C. Goldstein,	 CREATION DATE:  3-Jan-1977  11:11

;	0044	!

;	0045	! REVISION HISTORY:

;	0046	!

;	0047	!   Andrew C. Goldstein, 16-Jun-1977  16:09

;	0048	!   X0002 - Change descriptor macro

;	0049	!

;	0050	!**

;	0051	

;	0052	

;	0053	LIBRARY 'SYS$LIBRARY:LIB.L32';

;	0054	REQUIRE 'SRC$:FCPDEF.B32';



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:00:19	DBB3:[F11A.SRC]MAKSTR.B32;7					Page 2

;

;	0373	GLOBAL ROUTINE MAKE_STRING (NAMEBLOCK, STRING) =

;	0374	

;	0375	!++

;	0376	!

;	0377	! FUNCTIONAL DESCRIPTION:

;	0378	!

;	0379	!	This routine converts a RAD-50 file name block into the

;	0380	!	equivalent ASCII name string.

;	0381	!

;	0382	! CALLING SEQUENCE:

;	0383	!	MAKE_STRING (ARG1, ARG2)

;	0384	!

;	0385	! INPUT PARAMETERS:

;	0386	!	ARG1: address of file name block

;	0387	!

;	0388	! IMPLICIT INPUTS:

;	0389	!	NONE

;	0390	!

;	0391	! OUTPUT PARAMETERS:

;	0392	!	ARG2: address of buffer for string

;	0393	!

;	0394	! IMPLICIT OUTPUTS:

;	0395	!	NONE

;	0396	!

;	0397	! ROUTINE VALUE:

;	0398	!	length of string generated

;	0399	!

;	0400	! SIDE EFFECTS:

;	0401	!	NONE

;	0402	!

;	0403	!--

;	0404	

;	0405	BEGIN

;	0406	

;	0407	MAP

;	0408		NAMEBLOCK	: REF BBLOCK,	! name block argument

;	0409		STRING		: REF VECTOR [,BYTE]; ! string buffer arg

;	0410	

;	0411	LOCAL

;	0412		BLOCKP		: REF VECTOR [,WORD], ! pointer into name block

;	0413		STRINGP		: REF VECTOR [,BYTE], ! pointer into string

;	0414		CHARS		: VECTOR [3, BYTE], ! holding place for characters

;	0415		STRINGD		: VECTOR [2],	! string descriptor for FAO

;	0416		LENGTH;				! return length from FAO

;	0417	

;	0418	BIND

;	0419		FORMAT		= DESCRIPTOR ('!SW'), ! format string for FAO

;	0420		DELIMITER	= UPLIT BYTE (' ;.')

;	0421				: VECTOR [,BYTE]; ! type and version delimiters

;	0422	

;	0423	EXTERNAL ROUTINE

;	0424		SYS$FAO		: ADDRESSING_MODE (ABSOLUTE);

;	0425	

;	0426	

;	0427	! Set up the pointers. Then start up the outer loop, which iterates



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:00:19	DBB3:[F11A.SRC]MAKSTR.B32;7					Page 2-1

;

;	0428	! over name and type fields.

;	0429	!

;	0430	

;	0431	BLOCKP = NAMEBLOCK[NMB$W_NAME];

;	0432	STRINGP = .STRING;

;	0433	

;	0434	DECR K FROM 2 TO 1 DO

;	0435	    BEGIN

;	0436	

;	0437	! The next loop iterates over the RAD-50 words in the name block.

;	0438	! There are 3 words for name, 1 for type. Expand each word into

;	0439	! the 3 RAD-50 characters.

;	0440	!

;	0441	

;	0442	    DECR I FROM (IF .K THEN 1 ELSE 3) TO 1 DO

;	0443		BEGIN

;	0444		CHARS[0] = .BLOCKP[0] / (40*40);

;	0445		CHARS[1] = .BLOCKP[0]/40 MOD 40;

;	0446		CHARS[2] = .BLOCKP[0] MOD 40;

;	0447	

;	0448	! Now convert each character into the correct ASCII code and store it

;	0449	! in the string buffer if it is not null.

;	0450	!

;	0451	

;	0452		INCR J FROM 0 TO 2 DO

;	0453		    IF .CHARS[.J] NEQ 0

;	0454		    THEN

;	0455			BEGIN

;	0456			STRINGP[0] =

;	0457			    (

;	0458			    IF .CHARS[.J] LSS 30

;	0459			    THEN .CHARS[.J] - 1 + 'A'

;	0460			    ELSE .CHARS[.J] - 30 + '0'

;	0461			    );

;	0462			STRINGP = .STRINGP + 1;

;	0463			END;

;	0464		BLOCKP = .BLOCKP + 2;		! move to next word

;	0465		END;				! end of word loop

;	0466	

;	0467	! At the end of each field, insert the appropriate field delimiter.

;	0468	!

;	0469	

;	0470	    STRINGP[0] = .DELIMITER[.K];

;	0471	    STRINGP = .STRINGP + 1;

;	0472	    END;				 ! end of outer loop

;	0473	

;	0474	! Now build a descriptor for the remainder of the string buffer and

;	0475	! call FAO to convert the version number.

;	0476	!

;	0477	

;	0478	STRINGD[0] = 6;

;	0479	STRINGD[1] = .STRINGP;

;	0480	SYS$FAO (FORMAT, LENGTH, STRINGD, .BLOCKP[0]);

;	0481	

;	0482	RETURN .STRINGP + .LENGTH - .STRING;	! final byte count



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:00:19	DBB3:[F11A.SRC]MAKSTR.B32;7					Page 2-2

;

;	0483	

;	0484	END;					! end of routine MAKE_STRING





							    .TITLE  MAKSTR

							    .IDENT  \A0002A\



							    .PSECT  $CODE$,NOWRT,2



				  57  53  21  00000 P.AAB:  .ASCII  \!SW\						      ;

					      00003	    .BLKB   1

				    00000003  00004 P.AAA:  .LONG   3							      ;

				    00000000' 00008 	    .ADDRESS P.AAB						      ;

				  2E  3B  20  0000C P.AAC:  .ASCII  \ ;.\						      ;

					      0000F	    .BLKB   1



						    FORMAT=		P.AAA

						    DELIMITER=		P.AAC

							    .EXTRN  SYS$FAO



					 003C 00010 	    .ENTRY  MAKE_STRING, Save R2,R3,R4,R5			      ; 0373

		         5E 	       10  C2 00012 	    SUBL2   #16, SP						      ;

	   55 	    04   AC	       06  C1 00015 	    ADDL3   #6, NAMEBLOCK, BLOCKP				      ; 0431

		         54 	  08   AC  D0 0001A 	    MOVL    STRING, STRINGP					      ; 0432

		         52 	       02  D0 0001E 	    MOVL    #2, K						      ; 0434

		         05 	       52  E9 00021 1$:     BLBC    K, 2$						      ; 0442

		         53 	       01  D0 00024 	    MOVL    #1, R3						      ;

				       03  11 00027 	    BRB     3$							      ;

		         53 	       03  D0 00029 2$:     MOVL    #3, R3						      ;

				       53  D6 0002C 3$:     INCL    I							      ;

				       54  11 0002E 	    BRB     9$							      ;

		         50 	       65  3C 00030 4$:     MOVZWL  (BLOCKP), R0					      ; 0444

		         50 00000640   8F  C6 00033 	    DIVL2   #1600, R0						      ;

		    04   AE	       50  90 0003A 	    MOVB    R0, CHARS						      ;

		         50 	       65  3C 0003E 	    MOVZWL  (BLOCKP), R0					      ; 0445

		         50 	       28  C6 00041 	    DIVL2   #40, R0						      ;

	   00 	         50 	       01  7A 00044 	    EMUL    #1, R0, #0, -(SP)					      ;

				       7E     00048									      ;

	   50 	         8E 	       28  7B 00049 	    EDIV    #40, (SP)+, R0, R0					      ;

				       50     0004D									      ;

		    05   AE	       50  90 0004E 	    MOVB    R0, CHARS+1						      ;

		         50 	       65  3C 00052 	    MOVZWL  (BLOCKP), R0					      ; 0446

	   00 	         50 	       01  7A 00055 	    EMUL    #1, R0, #0, -(SP)					      ;

				       7E     00059									      ;

	   50 	         8E 	       28  7B 0005A 	    EDIV    #40, (SP)+, R0, R0					      ;

				       50     0005E									      ;

		    06   AE	       50  90 0005F 	    MOVB    R0, CHARS+2						      ;

				       50  D4 00063 	    CLRL    J							      ; 0452

		         51 	  04 AE40  9A 00065 5$:     MOVZBL  CHARS[J], R1					      ; 0453

				       11  13 0006A 	    BEQL    8$							      ;

		         1E 	       51  91 0006C 	    CMPB    R1, #30						      ; 0458

				       06  1E 0006F 	    BGEQU   6$							      ;

		         51 	  40   A1  9E 00071 	    MOVAB   64(R1), R1						      ; 0459

				       03  11 00075 	    BRB     7$							      ; 0457

		         51 	       12  C0 00077 6$:     ADDL2   #18, R1						      ; 0460



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:00:19	DBB3:[F11A.SRC]MAKSTR.B32;7					Page 2-3

;

		         84 	       51  90 0007A 7$:     MOVB    R1, (STRINGP)+					      ; 0456

	   E4 	         50 	       02  F3 0007D 8$:     AOBLEQ  #2, J, 5$						      ; 0452

		         55 	       02  C0 00081 	    ADDL2   #2, BLOCKP						      ; 0464

		         A9 	       53  F5 00084 9$:     SOBGTR  I, 4$						      ; 0442

		         84 	  81 AF42  90 00087 	    MOVB    DELIMITER[K], (STRINGP)+				      ; 0470

		         92 	       52  F5 0008C 	    SOBGTR  K, 1$						      ; 0434

		    08   AE	       06  D0 0008F 	    MOVL    #6, STRINGD						      ; 0478

		    0C   AE	       54  D0 00093 	    MOVL    STRINGP, STRINGD+4					      ; 0479

		         7E 	       65  3C 00097 	    MOVZWL  (BLOCKP), -(SP)					      ; 0480

				  0C   AE  9F 0009A 	    PUSHAB  STRINGD						      ;

				  08   AE  9F 0009D 	    PUSHAB  LENGTH						      ;

				FF60   CF  9F 000A0 	    PUSHAB  FORMAT						      ; 0373

	      00000000G  9F	       04  FB 000A4 	    CALLS   #4, @#SYS$FAO					      ; 0480

	   50 	         54 	       6E  C1 000AB 	    ADDL3   LENGTH, STRINGP, R0					      ; 0482

		         50 	  08   AC  C2 000AF 	    SUBL2   STRING, R0						      ;

					   04 000B3 	    RET     							      ; 0373



; Routine Size:  164 bytes





;	0485	

;	0486	END

;	0487	ELUDOM













;				       PSECT SUMMARY

;

;	Name		 Bytes			       Attributes

;

;  $CODE$         	   180  NOWRT,  RD ,  EXE,NOSHR,  LCL,  REL,  CON,NOPIC,ALIGN(2)









;				LIBRARY STATISTICS

;

;					     -------- Symbols --------    Blocks

;	File				     Total    Loaded   Percent      Read

;

;  DBA4:[SYSLIB]LIB.L32;1		      5582         2         0       223











; Size:		164 code + 16 data bytes

; Run Time:	00:05.5

; Elapsed Time:	00:16.0

; Memory Used:	280 pages

; Compilation Complete

