

; Bliss-32 7.352	Saturday 21-AUG-1978 23:37:43	DBB3:[MTAACP.SRC]MAKSTR.B32;3					Page 1

; Digital Equipment Corporation

;

;	0001	MODULE MAKSTR (

;	0002			LANGUAGE (BLISS32),

;	0003			IDENT = 'A0001'

;	0004			) =

;	0005	BEGIN

;	0006	

;	0007	!

;	0008	! COPYRIGHT (C) 1976

;	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	! ENVIRONMENT:

;	0035	!

;	0036	!	STARLET OPERATING SYSTEM, INCLUDING PRIVILEGED SYSTEM SERVICES

;	0037	!	AND INTERNAL EXEC ROUTINES.

;	0038	!

;	0039	!--

;	0040	!

;	0041	!

;	0042	! AUTHOR:  ANDREW C. GOLDSTEIN,	 CREATION DATE:  3-JAN-1977  11:11

;	0043	!

;	0044	! REVISION HISTORY:

;	0045	!

;	0046	!   ANDREW C. GOLDSTEIN, 25-Apr-1977  15:57

;	0047	!   X0002 - CHANGE DESCRIPTOR MACRO

;	0048	!

;	0049	!	D. H. GILLESPIE, 7-JUN-1977 10:10

;	0050	!	A0001 - CHANGE INPUT TO BE ADDRESS OF RAD50 NAME PORTION

;	0051	!		OF ANDY'S NAMEBLOCK, REQUIRE MTADEF

;	0052	!

;	0053	!**

;	0054	

;	0055	



; Bliss-32 7.352	Saturday 21-AUG-1978 23:37:43	DBB3:[MTAACP.SRC]MAKSTR.B32;3					Page 1-1

; Digital Equipment Corporation

;

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

;	0057	REQUIRE 'SRC$:MTADEF.B32';



; Bliss-32 7.352	Saturday 21-AUG-1978 23:37:43	DBB3:[MTAACP.SRC]MAKSTR.B32;3					Page 2

; Digital Equipment Corporation

;

;	0353	GLOBAL ROUTINE MAKE_STRING (NAMEBLOCK, STRING) =

;	0354	

;	0355	!++

;	0356	!

;	0357	! FUNCTIONAL DESCRIPTION:

;	0358	!

;	0359	!	THIS ROUTINE CONVERTS A RAD-50 FILE NAME BLOCK INTO THE

;	0360	!	EQUIVALENT ASCII NAME STRING.

;	0361	!

;	0362	! CALLING SEQUENCE:

;	0363	!	MAKE_STRING (ARG1, ARG2)

;	0364	!

;	0365	! INPUT PARAMETERS:

;	0366	!	ARG1: ADDRESS OF FILE NAME BLOCK

;	0367	!

;	0368	! IMPLICIT INPUTS:

;	0369	!	NONE

;	0370	!

;	0371	! OUTPUT PARAMETERS:

;	0372	!	ARG2: ADDRESS OF BUFFER FOR STRING

;	0373	!

;	0374	! IMPLICIT OUTPUTS:

;	0375	!	NONE

;	0376	!

;	0377	! ROUTINE VALUE:

;	0378	!	LENGTH OF STRING GENERATED

;	0379	!

;	0380	! SIDE EFFECTS:

;	0381	!	NONE

;	0382	!

;	0383	!--

;	0384	

;	0385	BEGIN

;	0386	

;	0387	MAP

;	0388		STRING		: REF VECTOR [,BYTE]; ! STRING BUFFER ARG

;	0389	

;	0390	LOCAL

;	0391		BLOCKP		: REF VECTOR [,WORD], ! POINTER INTO NAME BLOCK

;	0392		STRINGP		: REF VECTOR [,BYTE], ! POINTER INTO STRING

;	0393		CHARS		: VECTOR [3, BYTE], ! HOLDING PLACE FOR CHARACTERS

;	0394		STRINGD		: VECTOR [2],	! STRING DESCRIPTOR FOR FAO

;	0395		LENGTH;				! RETURN LENGTH FROM FAO

;	0396	

;	0397	BIND

;	0398		FORMAT		= DESCRIPTOR ('!SW'), ! FORMAT STRING FOR FAO

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

;	0400				: VECTOR [,BYTE]; ! TYPE AND VERSION DELIMITERS

;	0401	

;	0402	EXTERNAL ROUTINE

;	0403		SYS$FAO		: ADDRESSING_MODE (ABSOLUTE);

;	0404	

;	0405	

;	0406	! SET UP THE POINTERS. THEN START UP THE OUTER LOOP, WHICH ITERATES

;	0407	! OVER NAME AND TYPE FIELDS.



; Bliss-32 7.352	Saturday 21-AUG-1978 23:37:43	DBB3:[MTAACP.SRC]MAKSTR.B32;3					Page 2-1

; Digital Equipment Corporation

;

;	0408	!

;	0409	

;	0410	BLOCKP = .NAMEBLOCK;

;	0411	STRINGP = .STRING;

;	0412	DECR K FROM 2 TO 1 DO

;	0413	    BEGIN

;	0414	

;	0415	! THE NEXT LOOP ITERATES OVER THE RAD-50 WORDS IN THE NAME BLOCK.

;	0416	! THERE ARE 3 WORDS FOR NAME, 1 FOR TYPE. EXPAND EACH WORD INTO

;	0417	! THE 3 RAD-50 CHARACTERS.

;	0418	!

;	0419	

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

;	0421		BEGIN

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

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

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

;	0425	

;	0426	! NOW CONVERT EACH CHARACTER INTO THE CORRECT ASCII CODE AND STORE IT

;	0427	! IN THE STRING BUFFER IF IT IS NOT NULL.

;	0428	!

;	0429	

;	0430		INCR J FROM 0 TO 2 DO

;	0431		    IF .CHARS[.J] NEQ 0

;	0432		    THEN

;	0433			BEGIN

;	0434			STRINGP[0] =

;	0435			    (

;	0436			    IF .CHARS[.J] LSS 30

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

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

;	0439			    );

;	0440			STRINGP = .STRINGP + 1;

;	0441			END;

;	0442		BLOCKP = .BLOCKP + 2;		! MOVE TO NEXT WORD

;	0443		END;				! END OF WORD LOOP

;	0444	

;	0445	! AT THE END OF EACH FIELD, INSERT THE APPROPRIATE FIELD DELIMITER.

;	0446	!

;	0447	

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

;	0449	    STRINGP = .STRINGP + 1;

;	0450	    END;				 ! END OF OUTER LOOP

;	0451	

;	0452	! NOW BUILD A DESCRIPTOR FOR THE REMAINDER OF THE STRING BUFFER AND

;	0453	! CALL FAO TO CONVERT THE VERSION NUMBER.

;	0454	!

;	0455	

;	0456	STRINGD[0] = 6;

;	0457	STRINGD[1] = .STRINGP;

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

;	0459	

;	0460	RETURN .STRINGP + .LENGTH - .STRING;	! FINAL BYTE COUNT

;	0461	

;	0462	END;					! END OF ROUTINE MAKE_STRING



; Bliss-32 7.352	Saturday 21-AUG-1978 23:37:43	DBB3:[MTAACP.SRC]MAKSTR.B32;3					Page 2-2

; Digital Equipment Corporation

;





							    .TITLE  MAKSTR

							    .IDENT  \A0001\



							    .PSECT  $CODE$,NOWRT,2



					      00000 P.AAB:  .ASCII  \!SW\						      ;

					      00003	    .BLKB   1

					      00004 P.AAA:  .LONG   3							      ;

					      00008 	    .ADDRESS  P.AAB						      ;

					      0000C P.AAC:  .ASCII  \ ;.\						      ;

					      0000F	    .BLKB   1



						    FORMAT=		P.AAA

						    DELIMITER=		P.AAC

							    .GLOBL  SYS$FAO



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

		         5E	       10  C2 00012 	    SUBL2   #16, SP						      ;

		         55	  04   AC  D0 00015 	    MOVL    NAMEBLOCK, BLOCKP					      ; 0410

		         54	  08   AC  D0 00019 	    MOVL    STRING, STRINGP					      ; 0411

		         52	       02  D0 0001D 	    MOVL    #2, K						      ; 0412

		         05	       52  E9 00020 1$:     BLBC    K, 2$						      ; 0420

		         53	       01  D0 00023 	    MOVL    #1, R3						      ;

				       03  11 00026 	    BRB     3$							      ;

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

				       53  D6 0002B 3$:     INCL    I							      ;

				       5C  11 0002D 	    BRB     9$							      ;

		         50	       65  3C 0002F 4$:     MOVZWL  (BLOCKP), R0					      ; 0422

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

		    04   AE	       50  90 00039 	    MOVB    R0, CHARS						      ;

		         50	       65  3C 0003D 	    MOVZWL  (BLOCKP), R0					      ; 0423

		         50	       28  C6 00040 	    DIVL2   #40, R0						      ;

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

				       7E     00047									      ;

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

				       50     0004C									      ;

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

		         50	       65  3C 00051 	    MOVZWL  (BLOCKP), R0					      ; 0424

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

				       7E     00058									      ;

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

				       50     0005D									      ;

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

				       50  D4 00062 	    CLRL    J							      ; 0430

		         51	  04 AE40  9E 00064 5$:     MOVAB   CHARS[J], R1					      ; 0431

				       61  95 00069 	    TSTB    (R1)						      ;

				       17  13 0006B 	    BEQL    8$							      ;

		         1E	       61  91 0006D 	    CMPB    (R1), #30						      ; 0436

				       09  1E 00070 	    BGEQU   6$							      ;

		         51	       61  9A 00072 	    MOVZBL  (R1), R1						      ; 0437

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

				       06  11 00079 	    BRB     7$							      ; 0435

		         51	       61  9A 0007B 6$:     MOVZBL  (R1), R1						      ; 0438



; Bliss-32 7.352	Saturday 21-AUG-1978 23:37:43	DBB3:[MTAACP.SRC]MAKSTR.B32;3					Page 2-3

; Digital Equipment Corporation

;

		         51	       12  C0 0007E 	    ADDL2   #18, R1						      ;

		         84	       51  90 00081 7$:     MOVB    R1, (STRINGP)+					      ; 0434

	   DC	         50	       02  F3 00084 8$:     AOBLEQ  #2, J, 5$						      ; 0430

		         55	       02  C0 00088 	    ADDL2   #2, BLOCKP						      ; 0442

		         A1	       53  F5 0008B 9$:     SOBGTR  I, 4$						      ; 0420

		         84	FF79 CF42  90 0008E 	    MOVB    DELIMITER[K], (STRINGP)+				      ; 0448

		         89	       52  F5 00094 	    SOBGTR  K, 1$						      ; 0412

		    08   AE	       06  D0 00097 	    MOVL    #6, STRINGD						      ; 0456

		    0C   AE	       54  D0 0009B 	    MOVL    STRINGP, STRINGD+4					      ; 0457

		         7E	       65  3C 0009F 	    MOVZWL  (BLOCKP), -(SP)					      ; 0458

				  0C   AE  9F 000A2 	    PUSHAB  STRINGD						      ;

				  08   AE  9F 000A5 	    PUSHAB  LENGTH						      ;

				FF58   CF  9F 000A8 	    PUSHAB  FORMAT						      ; 0353

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

	   50	         54	       6E  C1 000B3 	    ADDL3   LENGTH, STRINGP, R0					      ; 0460

		         50	  08   AC  C2 000B7 	    SUBL2   STRING, R0						      ;

					   04 000BB 	    RET     							      ; 0353



; Routine Size:  172 bytes





;	0463	

;	0464	END

;	0465	ELUDOM













;				       PSECT SUMMARY

;

;	Name		 Bytes			       Attributes

;

;  $CODE$         	   188  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         6         0       224











; Size:		172 code + 16 data bytes

; Run Time:	00:07.0

; Elapsed Time:	00:20.8

; Memory Used:	283 pages

; Compilation Complete



; Bliss-32 7.352	Saturday 21-AUG-1978 23:37:43									Page 2-4

; Digital Equipment Corporation

;

