MACFLM	MACRO M1110  22-AUG-78 01:24  PAGE 2





      1					;

      2					; PREFIX FILE FOR DECIMAL VERSION NUMBERS

      3					;

      4		000001 				R$$DVN=1

EDTMG	MACRO M1110  22-AUG-78 01:24  PAGE 3





      1						.TITLE	EDTMG

      2						.IDENT	/11/

      3					                                                                                ;**-1

      4					;

      5					; COPYRIGHT   1975,  DIGITAL  EQUIPMENT  CORP.  MAYNARD,   MASS.                ;**NEW**

      6					; COPYRIGHT   1976,  DIGITAL  EQUIPMENT  CORP.  MAYNARD,   MASS.

      7					;                                                                               ;**-2

      8					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE

      9					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION

     10					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT

     11					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.

     12					;

     13					; THE  INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT

     14					; NOTICE AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL

     15					; EQUIPMENT CORPORATION.

     16					;

     17					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR RELIABILITY

     18					; OF ITS  SOFTWARE ON  EQUIPMENT WHICH  IS NOT SUPPLIED BY DEC.

     19					;

     20					; VERSION 11

     21					;                                                                               ;**-1

     22					; D. N. CUTLER/C. MONIA 10-MAY-74

     23					;

     24					; MODIFICATIONS:                                                                ;**NEW**

     25					;                                                                               ;**NEW**

     26					; NO.		DATE		PROGRAMMER                                      ;**NEW**

     27					; ---		----		----------                                      ;**NEW**

     28					;                                                                               ;**NEW**

     29					; 030		02-JAN-75	C. MONIA                                        ;**NEW**

     30					; 043		28-OCT-75	C. MONIA

     31					; 055		13-APR-76	J.A.KASSON

     32					; 060		15-DEC-78	E.H. MARISON

     33					;                                                                               ;**NEW**

     34					; GENERALIZED FORMATTING ROUTINE

     35					;

     36					;

     37	000000					.PSECT	LNC$D,D,GBL

     38	000000				$LNCNT::.BLKW	1		;LINE COUNT

     39

     40	000000					.PSECT

     41

     42					; EQUATED SYMBOLS

     43					;

     44

     45		000001 			NP=1				; NO-PARAMETER FLAG

     46

     47					;

     48					; LOCAL DATA

     49					;

     50

     51	000000	   101 			OPRAND:	.BYTE	'A		;%A-ASCII

     52	000001	   102 				.BYTE	'B		;++030 %B-BINARY BYTE TO OCTAL                  ;**NEW**

     53	000002	   104 				.BYTE	'D		;%D-SIGNED BINARY TO DECIMAL CONVERSION

     54	000003	   105 				.BYTE	'E		;++030 %E-EXTENDED ASCII CONVERSION             ;**NEW**

     55	000004	   106 				.BYTE	'F		;%F-FORM FEED

     56	000005	   115 				.BYTE	'M		; %M-MAGNITUDE DECIMAL CONVERSION, SURPRESSED

     57	000006	   116 				.BYTE	'N		;%N-NEW LINE (CR-LF)

EDTMG	MACRO M1110  22-AUG-78 01:24  PAGE 3-1





     58	000007	   117 				.BYTE	'O		;%O-SIGNED BINARY TO OCTAL CONVERSION

     59	000010	   120 				.BYTE	'P		;%P-MAGNITUDE BINARY TO OCTAL CONVERSION

     60	000011	   122 				.BYTE	'R		;%R-BINARY TO RAD50 CONVERSION

     61	000012	   123 				.BYTE	'S		;++030 %S-SPACE GENERATOR                       ;**NEW**

     62	000013	   124 				.BYTE	'T		; %T-DOUBLE PRECISION DECIMAL

     63	000014	   125 				.BYTE	'U		; %U-MAGNITUDE DECIMAL CONVERSION, NO SURPRESS

     64	000015	   130 				.BYTE	'X		;%X-FILE NAME CONVERSION

     65	000016	   131 				.BYTE	'Y		;%Y-DATE CONVERSION

     66	000017	   132 				.BYTE	'Z		;%Z-TIME CONVERSION

     67	000020	   074 				.BYTE	'<		; %<-DEFINE FIELD

     68	000021	   076 				.BYTE	'>		; %>-SEARCH FOR FIELD DELIMITER

     69		000022 			OPRNDX=.-OPRAND			;NUMBER OF DIRECTIVES

     70

     71						.EVEN

     72

     73					;

     74					; DIRECTIVE DISPATCH TABLE:

     75					;

     76					; THE LOW ORDER BIT IS SET FOR THOSE DIRECTIVES NOT REQUIRING

     77					; AN ARGUMENT BLOCK ENTRY

     78					;

     79

     80

     81	000022	000000C			VECTOR:	.WORD	ILLDIR!NP	; ILLEGAL DIRECTIVE

     82	000024	000266'				.WORD	ASCII		;%A->ASCII STRING

     83	000026	000302'				.WORD	BYTE		;++030 %B->BINARY BYTE TO OCTAL                 ;**NEW**

     84	000030	000326'				.WORD	BINDEC		;%D->SIGNED DECIMAL

     85	000032	000356'				.WORD	EASCI		;++030 %E->EXTENDED ASCII                       ;**NEW**

     86	000034	000000C				.WORD	FORM!NP		; %F->FORM CONTROL

     87	000036	000334'				.WORD	DECSUP		; %M->ZERO SUPRESSED DECIMAL MAGNITUDE

     88	000040	000000C				.WORD	NEWLIN!NP	; %N->NEWLINE

     89	000042	000504'				.WORD	OCTAL		;%0->SIGNED OCTAL

     90	000044	000512'				.WORD	POINT		;%P->ABSOLUTE OCTAL

     91	000046	000560'				.WORD	RAD50		;%R->RAD50 STRING

     92	000050	000000C				.WORD	SPACE!NP	;++030 %S->SPACE GENERATOR                      ;**NEW**

     93	000052	000350'				.WORD	DOUBLE		; %T->DOUBLE PRECISION DECIMAL

     94	000054	000342'				.WORD	DECUNS		; %U->DECIMAL MAGNITUDE, NO SURPRESS

     95	000056	000612'				.WORD	XFNAM		;%X->FILE NAME STRING

     96	000060	000726'				.WORD	EDATE		;%Y->DATE CONVERSION

     97	000062	000742'				.WORD	ETIME		;%Z->TIME CONVERSION

     98	000064	000000C				.WORD	DFLD!NP		; %<->DEFINE FIXED LENGTH FIELD

     99	000066	000000C				.WORD	LCTFLD!NP	; %>->LOCATE FIELD MARK

    100

    101					;+

    102					; **-$EDMSG-EDIT MESSAGE

    103					;

    104					; THIS ROUTINE IS CALLED TO PROCESS AN ASCIZ FORMAT STRING TO PRODUCE

    105					; AN EDITED OUTPUT STRING. THE INPUTS TO THE ROUTINE ARE A FORMAT STRING

    106					; AND THE ADDRESS OF AN ARGUMENT BLOCK. THE FORMAT STRING IS SCANNED

    107					; LOOKING FOR FORMAT DIRECTIVES. AS EACH NON-FORMAT CHARACTER IS EN-

    108					; COUNTERED, IT IS SIMPLY COPIED INTO THE OUTPUT STRING. A"%" SIGN IS

    109					; USED TO DELIMIT A FORMAT DIRECTIVE. IF A "%" SIGN IS FOLLOWED BY A "V"

    110					; (VALUE), THEN THE REPEAT COUNT IS TAKEN FROM THE NEXT WORD IN THE ARG-

    111					; UMENT BLOCK. ELSE THE NEXT "N" CHARACTERS (BY CONTEXT) ARE CONVERTED

    112					; TO BINARY AND THIS VALUE IS TAKEN AS THE REPEAT COUNT. A REPEAT COUNT

    113					; OF ZERO IS DEFAULTED TO A REPEAT COUNT OF ONE IN EITHER CASE. THE NEXT

    114					; CHARACTER IN THE FORMAT STRING MUST BE A FORMAT DIRECTIVE. THE FOLLOW-

EDTMG	MACRO M1110  22-AUG-78 01:24  PAGE 3-2





    115					; ING FORMAT DIRECTIVES ARE IMPLEMENTED.

    116					;

    117					;	%A-ASCII STRING

    118					;++030	%B-BINARY BYTE TO OCTAL                                                 ;**NEW**

    119					;	%D=SIGNED BINARY TO DECIMAL CONVERSION

    120					;++030	%E-EXTENDED ASCII                                                       ;**NEW**

    121					;	%F-FORM CONTROL

    122					;	%M-DECIMAL MAGNITUDE,  ZERO SURPRESS

    123					;	%N-NEW LINE (CR-LF)

    124					;	%O-SIGNED BINARY TO OCTAL CONVERSION

    125					;	%P-MAGNITUDE BINARY TO OCTAL CONVERSION

    126					;	%R-BINARY TO RAD50 CONVERSION

    127					;++030	%S-SPACE GENERATOR                                                      ;**NEW**

    128					;	%T-DOUBLE PRECISION BINARY TO DECIMAL CONVERSION

    129					;	%U-DECIMAL MAGNITUDE, NO ZERO SURPRESS

    130					;	%X-FILE NAME CONVERSION

    131					;	%Y-DATE CONVERSION

    132					;	%Z-TIME CONVERSION

    133					;	%<-DEFINE N BYTE, BLANK FILLED FIELD

    134					;	%>-LOCATE FIELD MARK

    135					;

    136					; INPUTS:

    137					;

    138					;	R0=ADDRESS OF OUTPUT STRING.

    139					;	R1=ADDRESS OF INPUT STRING

    140					;	R2=ADDRESS OF ARGUMENT BLOCK.

    141					;

    142					; OUTPUTS:

    143					;

    144					;	R0=ADDRESS OF LAST BYTE IN OUTPUT STRING.

    145					;	R1=LENGTH OF OUTPUT STRING IN BYTES.

    146					;	R2=ADDRESS OF NEXT PARAMETER IN ARGUMENT BLOCK

    147					;-

    148

    149	000070				$EDMSG::SAVRG			;SAVE NONVOLITILE REGISTERS

    150	000074	010046 				MOV	R0,-(SP)	;SAVE STARTING ADDRESS OF OUTPUT BUFFER

    151	000076	010003 				MOV	R0,R3		;MOVE PARAMETERS TO NONVOLITILE REGISTER

    152	000100	010104 				MOV	R1,R4		;

    153	000102	010205 				MOV	R2,R5		;

    154	000104	112402 			10$:	MOVB	(R4)+,R2	;GET NEXT CHARACTER IN INPUT STRING

    155	000106	001405 				BEQ	20$		;IF EQ ALL DONE

    156	000110	122702 	000045 			CMPB	#'%,R2		;FORMATTING CHARACTER?

    157	000114	001410 				BEQ	30$		;IF EQ YES

    158	000116	110223 				MOVB	R2,(R3)+	;STORE CHARACTER IN OUTPUT STRING

    159	000120	000771 				BR	10$		;GO AGAIN

    160	000122	105013 			20$:	CLRB	(R3)		;CLEAR LAST BYTE FOR ASCIZ

    161	000124	010300 				MOV	R3,R0		;SET LAST BYTE ADDRESS

    162	000126	010001 				MOV	R0,R1		;COPY ADDRESS OF NEXT BYTE IN OUTPUT BUF

    163	000130	162601 				SUB	(SP)+,R1	;CALCULATE LENGTH OF LINE IN BYTES

    164	000132	010502 				MOV	R5,R2		; SET ADDRESS OF NEXT PARAMETER

    165	000134					RETURN			;

    166	000136	010446 			30$:	MOV	R4,-(SP)	;SAVE R4 IN CASE OF ILLEGAL DIRECTIVE

    167	000140	010400 				MOV	R4,R0		;SET ADDRESS OF NEXT BYTE

    168	000142	122720 	000126 			CMPB	#'V,(R0)+	;NEXT CHARACTER "V"?

    169	000146	001002 				BNE	35$		; IF NE NO

    170	000150	012501 				MOV	(R5)+,R1	; GET ARGUMENT

    171	000152	000404 				BR	40$		; PROCESS DIRECTIVE

EDTMG	MACRO M1110  22-AUG-78 01:24  PAGE 3-3





    172	000154				35$:				;

    173	000154	010400 				MOV	R4,R0		;SET ADDRESS OF NEXT BYTE

    174	000156					CALL	$CDTB		;CONVERT LEADING NUMBER

    175	000162	005300 				DEC	R0		;BACKUP TO TERMINAL BYTE

    176	000164	010004 			40$:	MOV	R0,R4		;RESTORE ADDRESS OF NEXT CHARACTER

    177	000166	010300 				MOV	R3,R0		;SET ADDRESS OF NEXT IN OUTPUT STRING

    178	000170	010103 				MOV	R1,R3		;SET REPEAT COUNT

    179	000172	001001 				BNE	45$		;IF NE OKAY

    180	000174	005203 				INC	R3		;MAKE COUNT 1

    181	000176	012702 	000022 		45$:	MOV	#OPRNDX,R2	;GET NUMBER OF DIRECTIVES

    182	000202	121462 	177777'		50$:	CMPB	(R4),OPRAND-1(R2);MATCH?

    183	000206	001402 				BEQ	60$		;IF EQ YES

    184	000210					SOB	R2,50$		;REPEAT

    185	000214	005204 			60$:	INC	R4		;INCREMENT PAST DIRECTIVE

    186	000216	006302 				ASL	R2		;MAKE WORD INDEX

    187	000220	016246 	000022'			MOV	VECTOR(R2),-(SP) ; GET ADDRESS OF DIRECTIVE ROUTINE

    188	000224	006216 				ASR	(SP)		; ISOLATE NO-PARAMETERS FLAG

    189	000226	103401 				BCS	70$		; IF C/S NO PARAMETERS REQUIRED

    190	000230	012501 				MOV	(R5)+,R1	; ELSE FETCH FIRST PARAMETER

    191	000232				70$:				;

    192	000232	006316 				ASL	(SP)		; CONVERT TO ADDRESS

    193	000234					CALL	@(SP)+		; CALL PROCESSING ROUTINE

    194	000236	010003 				MOV	R0,R3		;RESTORE ADDRESS OF NEXT IN OUTPUT STRIN

    195	000240	005726 				TST	(SP)+		;CLEAN STACK

    196	000242	000720 				BR	10$		;GO AGAIN

    197

    198					;

    199					; ILLEGAL DIRECTIVE (%"UNKNOWN)

    200					;

    201

    202	000244	112720 	000045 		ILLDIR:	MOVB	#'%,(R0)+	;STORE PERCENT SIGN IN OUTPUT STRING

    203	000250	016604 	000002 			MOV	2(SP),R4	;RESTORE INPUT STRING ADDRESS

    204	000254	122714 	000126 			CMPB	#'V,(R4)	;"V" DIRECTIVE?

    205	000260	001001 				BNE	10$		;IF NE NO

    206	000262	005745 				TST	-(R5)		;BACKUP ARGUMENT POINTER

    207	000264				10$:	RETURN			;

    208

    209					;

    210					; ASCII DIRECTIVE (%NA)

    211					;

    212					; MOVE "N" CHARACTERS FROM STRING POINTER TO BY R1 TO OUTPUT STRING.

    213					;

    214

    215	000266	112120 			ASCII:	MOVB	(R1)+,(R0)+	;MOVE A BYTE

    216	000270					SOB	R3,ASCII	;REPEAT

    217	000274					RETURN			;

    218					                                                                                ;**NEW**

    219					;++030                                                                          ;**NEW**

    220					;++030 BINARY BYTE TO OCTAL CONVERSION (%NB)                                    ;**NEW**

    221					;++030                                                                          ;**NEW**

    222					;++030 CONVERT N CONSECUTIVE BYTES POINTED TO BY R1                             ;**NEW**

    223					;++030                                                                          ;**NEW**

    224					                                                                                ;**NEW**

    225	000276				BYTE1:				;++030                                          ;**NEW**

    226	000276	112720 	000040 			MOVB	#SPA,(R0)+	;++030 INSERT A SPACE                           ;**NEW**

    227	000302				BYTE:				;++030                                          ;**NEW**

    228	000302	112102 				MOVB	(R1)+,R2	;++030 GET NEXT BYTE                            ;**NEW**

EDTMG	MACRO M1110  22-AUG-78 01:24  PAGE 3-4





    229	000304	010146 				MOV	R1,-(SP)	;++030 SAVE R1                                  ;**NEW**

    230	000306	010201 				MOV	R2,R1		;++030 SET VALUE TO CONVERT                     ;**NEW**

    231	000310	010602 				MOV	SP,R2		;++030 DO NOT SUPPRESS ZEROS                    ;**NEW**

    232	000312					CALL	$CBTMG		;++030 CONVERT BYTE TO MAGNITUDE OCTAL          ;**NEW**

    233	000316	012601 				MOV	(SP)+,R1	;++030 RESTORE R1                               ;**NEW**

    234	000320					SOB	R3,BYTE1	;++030 GO AGAIN                                 ;**NEW**

    235	000324					RETURN			;++030                                          ;**NEW**

    236

    237					;

    238					; SIGNED BINARY TO DECIMAL CONVERSION (%ND)

    239					;

    240					; CONVERT "N" CONSECUTIVE ARGUMENT WORDS. IF MORE THAN ONE WORD IS

    241					; CONVERTED, THEN INSERT A TAB BETWEEN WORDS.

    242					;

    243

    244	000326				BINDEC:				;

    245	000326	012746 	000000C			MOV	#<$CBDSG/2>&77777,-(SP) ; PUSH ADDRESS OF CONVERSION ROUTINE

    246	000332	000475 				BR	CVNUM		; CONVERT SINGLE PRECISION NUMBER

    247

    248					;

    249					; BINARY TO DECIMAL MAGNITUDE CONVERSION - ZERO SUPRESS (%NM)

    250					;

    251

    252	000334				DECSUP:				;

    253	000334	012746 	000000C			MOV	#<$CBDMG/2>&77777,-(SP) ; PUSH ADDRESS OF CONVERSION ROUTINE

    254	000340	000472 				BR	CVNUM		;

    255

    256					;

    257					; BINARY TO DECIMAL MAGNITUDE CONVERSION - NO SURPRESS (%NU)

    258					;

    259

    260	000342				DECUNS:				;

    261	000342	012746 	000000C			MOV	#<$CBDMG/2>!100000,-(SP) ; PUSH CONVERSION ROUTINE ADDRESS

    262	000346	000467 				BR	CVNUM		;

    263

    264

    265					;

    266					; DOUBLE PRECISION BINARY TO DECIMAL CONVERSION (%NT)

    267					;

    268					; CONVERT N CONSECUTIVE DOUBLE-PRECISION VALUES POINTED TO BY R1

    269					;

    270

    271	000350				DOUBLE:				;

    272	000350	012746 	000000C			MOV	#<$CDDMG/2>&77777,-(SP) ; PUSH CONVERSION ROUTINE ADDRESS

    273	000354	000464 				BR	CVNUM		; CONVERT DOUBLE PRECISION NUMBER

    274					                                                                                ;**NEW**

    275					;++030                                                                          ;**NEW**

    276					;++030 EXTENDED ASCII CONVERSION (%NE)                                          ;**NEW**

    277					;++030                                                                          ;**NEW**

    278					;++030 CONVERT N BYTES POINTED TO BY R1 TO EXTENDED ASCII REPRESENTATION        ;**NEW**

    279					;++030                                                                          ;**NEW**

    280					                                                                                ;**NEW**

    281	000356				EASCI:				;++030                                          ;**NEW**

    282	000356	112110 				MOVB	(R1)+,(R0)	;++030 MOVE NEXT BYTE                           ;**NEW**

    283	000360	142710 	000200 			BICB	#200,(R0)	;++030 CLEAR PARITY BIT                         ;**NEW**

    284	000364	121027 	000040 			CMPB	(R0),#SPA	;++030 PRINTING CHARACTER?                      ;**NEW**

    285	000370	002403 				BLT	10$		;++030 IF LT NO                                 ;**NEW**

EDTMG	MACRO M1110  22-AUG-78 01:24  PAGE 3-5





    286	000372	121027 	000177 			CMPB	(R0),#177	;++030 RUBOUT?                                  ;**NEW**

    287	000376	001002 				BNE	20$		;++030 IF NE NO                                 ;**NEW**

    288	000400				10$:				;++030                                          ;**NEW**

    289	000400	112710 	000040 			MOVB	#SPA,(R0)	;++030 REPLACE NON-PRINTING CHAR. WITH SPACE    ;**NEW**

    290	000404				20$:				;++030                                          ;**NEW**

    291	000404	005200 				INC	R0		;++030 STEP TO NEXT OUTPUT BYTE                 ;**NEW**

    292	000406					SOB	R3,EASCI	;++030 GO AGAIN                                 ;**NEW**

    293	000412					RETURN			;++030                                          ;**NEW**

    294

    295					;

    296					; DEFINE N BYTE FIXED LENGTH FIELD (%N<)

    297					;

    298					; N SPACES ARE INSERTED IN THE OUTPUT STREAM FOLLOWED BY A NULL.

    299					; UPON COMPLETION, THE BYTE POINTER (R0) IS RESET TO ITS INITIAL VALUE.

    300					;

    301

    302	000414				DFLD:				;

    303	000414	010002 				MOV	R0,R2		; MARK CURRENT POSITION

    304	000416					CALL	SPACE		; INSERT N SPACES

    305	000422	105010 				CLRB	(R0)		; MARK END OF FIELD

    306	000424	010200 				MOV	R2,R0		; RESET BYTE POINTER

    307	000426					RETURN			;

    308

    309

    310					;

    311					; FORM CONTROL DIRECTIVE (%NF)

    312					;

    313					; INSERT "N" FORM FEEDS INTO OUTPUT STRING.

    314					;

    315

    316	000430	112720 	000014 		FORM:	MOVB	#FF,(R0)+	;INSERT A FORM FEED

    317	000434					SOB	R3,FORM		;REPEAT

    318	000440	005067 	000000'			CLR	$LNCNT			;CLEAR LINE COUNT ON FORM FEED

    319	000444					RETURN			;

    320

    321					;

    322					; LOCATE FIELD MARK (%N>)

    323					;

    324					; THE OUTPUT STREAM POINTER (R0) IS ADVANCED UNTIL A FIELD DELIMI-

    325					; TER IS LOCATED OR THE REPEAT COUNT IS EXCEEDED (WHICHEVER OCCURS

    326					;  FIRST). THE FIELD MARK IS A NULL.

    327					;

    328

    329	000446				LCTFLD:				;

    330	000446	105720 				TSTB	(R0)+		; FIND NULL?

    331	000450	001402 				BEQ	10$		; IF EQ YES

    332	000452					SOB	R3,LCTFLD	; REPEAT

    333	000456				10$:				;

    334	000456	005300 				DEC	R0		; BACKUP BYTE POINTER

    335	000460					RETURN			;

    336

    337					;

    338					; NEW LINE DIRECTIVE (%NN)

    339					;

    340					; INSERT "N" CR-LF PAIRS INTO OUTPUT STRING.

    341					;

    342

EDTMG	MACRO M1110  22-AUG-78 01:24  PAGE 3-6





    343	000462	112720 	000015 		NEWLIN:	MOVB	#CR,(R0)+	;INSERT A CR

    344	000466	112720 	000012 			MOVB	#LF,(R0)+	;INSERT A LF

    345	000472	005267 	000000'			INC	$LNCNT		;INCREMENT LINE COUNT FOR EVERY CR/LF

    346	000476					SOB	R3,NEWLIN	;REPEAT

    347	000502					RETURN			;

    348

    349					;

    350					; SIGNED BINARY TO OCTAL CONVERSION DIRECTIVE (%NO)

    351					;

    352					; CONVERT "N" CONSECUTIVE ARGUMENT WORDS. IF MORE THAN ONE WORD IS

    353					; CONVERTED, THEN INSERT A TAB BETWEEN WORDS.

    354					;

    355

    356	000504				OCTAL:				;

    357	000504	012746 	000000C			MOV	#<$CBOSG/2>&77777,-(SP) ; PUSH ADDRESS OF CONVERSION ROUTINE

    358	000510	000406 				BR	CVNUM		; CONVERT SINGLE PRECISION NUMBER

    359

    360					;

    361					; MAGNITUDE BINARY TO OCTAL CONVERSION DIRECTIVE (%NP)

    362					;

    363					; CONVERT "N" CONSECUTIVE ARGUMENT WORDS. IF MORE THAN ONE WORD IS

    364					; CONVERTED, THEN INSERT A TAB BETWEEN WORDS.

    365					;

    366

    367	000512				POINT:				;

    368	000512	012746 	000000C			MOV	#<$CBOMG/2>!100000,-(SP) ; PUSH ADDRESS PLUS  NO ZERO SURPRESS

    369	000516	000403 				BR	CVNUM		; CONVERT NUMBER

    370

    371					;

    372					; **-CVNUM-CONVERT NUMBER TO ASCII

    373					;

    374					; "N" CONSECUTIVE ARGUMENT WORDS ARE CONVERTED TO ASCII. IF MORE

    375					; THAN ONE WORD IS CONVERTED A TAB IS INSERTED BETWEEN FIELDS. WHEN

    376					; A DOUBLE PRECISION VALUE IS PROCESSED THE ARGUMENT LIST CONTAINS

    377					; THE ADDRESS OF THE QUANTITY TO BE CONVERTED

    378					;

    379					; INPUTS:

    380					;

    381					;	R0=STRING POINTER

    382					;	R1=FIRST ARGUMENT

    383					;	R3=REPEAT COUNT

    384					;	R5=PARAMETER LIST POINTER

    385					;

    386					;	(SP)=ZERO SURPRESS FLAG(MSB)!CONVERSION ROUTINE ADDRESS/2

    387					;

    388					; OUTPUTS:

    389					;

    390					;	R0=UPDATED STRING POINTER

    391					;	R5=UPDATED ARGUMENT LIST POINTER

    392					;

    393

    394	000520				CVNUM1:				;

    395	000520	112720 	000011 			MOVB	#HT,(R0)+	; INSERT A TAB

    396	000524	012501 				MOV	(R5)+,R1	; GET NEXT ARGUMENT WORD

    397	000526				CVNUM:				;

    398	000526	011646 				MOV	(SP),-(SP)	; DUPLICATE SUBROUTINE ADDRESS

    399	000530	005002 				CLR	R2		; ASSUME ZERO SURPRESS ENABLED

EDTMG	MACRO M1110  22-AUG-78 01:24  PAGE 3-7





    400	000532	006116 				ROL	(SP)		; CONVERT ADDRESS TO FULL WORD

    401	000534	006002 				ROR	R2		; GET ZERO-SURPRESS FLAG

    402	000536					CALL	@(SP)+		; CALL CONVERSION ROUTINE

    403	000540					SOB	R3,CVNUM1	; REPEAT

    404	000544	005226 				INC	(SP)+		; CLEAN STACK

    405	000546					RETURN			;

    406

    407					;

    408					; MAGNITUDE BINARY TO DECIMAL CONVERSION

    409					;

    410

    411	000550				DECMAG:				;

    412	000550	012746 	000000C			MOV	#<$CBDMG/2>&77777,-(SP) ; PUSH CONVERSION ROUTINE ADDRESS

    413	000554	000764 				BR	CVNUM		; CONVERT BINARY TO ASCII

    414

    415

    416					;

    417					; BINARY TO RAD50 CONVERSION DIRECTIVE

    418					;

    419					; CONVERT "N" CONSECUTIVE RAD50 WORDS.

    420					;

    421

    422	000556	012501 			RAD501:	MOV	(R5)+,R1	;GET NEXT ARGUMENT WORD

    423	000560				RAD50:	CALL	$C5TA		;CONVERT TO RAD50

    424	000564					SOB	R3,RAD501	;REPEAT

    425	000570					RETURN			;

    426					                                                                                ;**NEW**

    427					;++030                                                                          ;**NEW**

    428					;++030 SPACE GENERATOR (%NS)                                                    ;**NEW**

    429					;++030                                                                          ;**NEW**

    430					;++030 GENERATE N SPACES IN BUFFER                                              ;**NEW**

    431					;++030                                                                          ;**NEW**

    432					                                                                                ;**NEW**

    433	000572				SPACE:				;++030                                          ;**NEW**

    434	000572	112720 	000040 			MOVB	#SPA,(R0)+	;++030 PUT IN A SPACE                           ;**NEW**

    435	000576					SOB	R3,SPACE	;++030 LOOP UNTIL DONE                          ;**NEW**

    436	000602					RETURN			;++030                                          ;**NEW**

    437

    438					;

    439					; FILE NAME STRING CONVERSION

    440					;

    441					; CONVERT "N" FILE NAME STRINGS. IF MORE THAN ONE FILE NAME STRING IS

    442					; CONVERTED, THEN INSERT A TAB BETWEEN STRINGS.

    443					;

    444

    445	000604	112720 	000011 		XFNAM1:	MOVB	#HT,(R0)+	;INSERT A TAB

    446	000610	012501 				MOV	(R5)+,R1	;GET NEXT INPUT PARAMETER

    447	000612	012746 	000003 		XFNAM:	MOV	#3,-(SP)	;SET LOOP COUNT

    448	000616				10$:	CALL	$C5TA		;CONVERT TO RAD50

    449	000622	012501 				MOV	(R5)+,R1	;GET NEXT INPUT PARAMETER

    450	000624	005316 				DEC	(SP)		;DECREMENT LOOP COUNT

    451	000626	003373 				BGT	10$		;IF GT GO AGAIN

    452	000630	005726 				TST	(SP)+		;CLEAN STACK

    453	000632	012702 	000011 			MOV	#9.,R2		;SET SUPRESS COUNT

    454	000636					CALL	30$		;SUPRESS TRAILING BLANKS

    455	000642	112720 	000056 			MOVB	#'.,(R0)+	;INSERT PERIOD SEPARATOR

    456	000646					CALL	$C5TA		;CONVERT FILE TYPE TO RAD50

EDTMG	MACRO M1110  22-AUG-78 01:24  PAGE 3-8





    457	000652	012702 	000003 			MOV	#3,R2		;SET SUPRESS COUNT

    458	000656					CALL	30$		;SUPRESS TRAILING BLANKS

    459	000662	012501 				MOV	(R5)+,R1	;GET VERSION NUMBER

    460	000664	001405 				BEQ	15$		;IF EQ SKIP VERSION

    461	000666	112720 	000073 			MOVB	#';,(R0)+	;INSERT A SEMICOLON SEPARATOR

    462	000672	005002 				CLR	R2		;ENABLE ZERO SUPRESSION

    463	000674					CALL	$CBVER		; ++60 CONVERT VERSION

    464	000700				15$:	SOB	R3,XFNAM1	;REPEAT

    465	000704				20$:	RETURN			;

    466	000706	005302 			30$:	DEC	R2		;SUPRESS ANY MORE?

    467	000710	002775 				BLT	20$		;IF LT NO

    468	000712	122760 	000040 	177777 		CMPB	#' ,-1(R0)	;TRAILING BLANK?

    469	000720	001371 				BNE	20$		;IF NE NO

    470	000722	005300 				DEC	R0		;BACK UP A BYTE

    471	000724	000770 				BR	30$		;

    472

    473					;

    474					; DATE CONVERSION

    475					;

    476					; NOTE: REPEAT COUNT IS IGNORED.

    477					;

    478

    479	000726	010501 			EDATE:	MOV	R5,R1		;COPY ADDRESS OF NEXT PARAMETER

    480	000730	005741 				TST	-(R1)		;BACK UP TO FIRST PARAMETER

    481	000732					CALL	$DAT		;CONVERT DATE

    482	000736	010105 				MOV	R1,R5		;SET ADDRESS OF NEXT ARGUMENT

    483	000740					RETURN			;

    484

    485					;

    486					; TIME CONVERSION

    487					;

    488					; REPEAT COUNT IS USED TO SPECIFY THE TIME FORMAT.

    489					;

    490

    491	000742	010501 			ETIME:	MOV	R5,R1		;COPY ADDRESS OF NEXT ARGUMENT

    492	000744	005741 				TST	-(R1)		;BACK UP TO FIRST ARGUMENT

    493	000746	010302 				MOV	R3,R2		;SET CONVERSION TYPE

    494	000750					CALL	$TIM		;CONVERT TIME

    495	000754	010105 				MOV	R1,R5		;SET ADDRESS OF NEXT ARGUMENT

    496	000756					RETURN			;

    497

    498		000001 				.END

EDTMG	MACRO M1110  22-AUG-78 01:24  PAGE 3-9

SYMBOL TABLE



ASCII   000266R  	DOUBLE  000350R  	NP    = 000001   	SPACE   000572R  	$CBVER= ****** GX

BINDEC  000326R  	EASCI   000356R  	OCTAL   000504R  	VECTOR  000022R  	$CDDMG= ****** GX

BYTE    000302R  	EDATE   000726R  	OPRAND  000000R  	VT    = 000013   	$CDTB = ****** GX

BYTE1   000276R  	ETIME   000742R  	OPRNDX= 000022   	XFNAM   000612R  	$C5TA = ****** GX

CR    = 000015   	FF    = 000014   	POINT   000512R  	XFNAM1  000604R  	$DAT  = ****** GX

CVNUM   000526R  	FORM    000430R  	RAD50   000560R  	$CBDMG= ****** GX	$EDMSG  000070RG

CVNUM1  000520R  	HT    = 000011   	RAD501  000556R  	$CBDSG= ****** GX	$LNCNT  000000RG    002

DECMAG  000550R  	ILLDIR  000244R  	R$$DVN= 000001   	$CBOMG= ****** GX	$SAVRG= ****** GX

DECSUP  000334R  	LCTFLD  000446R  	R$$11M= 000000   	$CBOSG= ****** GX	$TIM  = ****** GX

DECUNS  000342R  	LF    = 000012   	SPA   = 000040   	$CBTMG= ****** GX	$$    = 000001

DFLD    000414R  	NEWLIN  000462R



. ABS.	000000	   000

      	000760	   001

LNC$D 	000002	   002

ERRORS DETECTED:  0



VIRTUAL MEMORY USED:  899 WORDS  ( 4 PAGES)

DYNAMIC MEMORY:  2772 WORDS  ( 10 PAGES)

ELAPSED TIME:  00:00:12

OBJ$:EDTMG,LIS$:EDTMG/-SP=SRC$:MACFLM,DECVER,EDTMG

