CMDGEN          - COMMAND GENERATOR                              22-AUG-1978 05:16:42   VAX-11 MACRO X0.3-11               Page   1

HJ                                                                                                                               (1)



                                     0000     1 	.TITLE	CMDGEN - COMMAND GENERATOR

                                     0000     2 	.IDENT	/HJ/

                                     0000     3  

                                     0000     4 ;

                                     0000     5 ; COPYRIGHT (C) 1977

                                     0000     6 ; DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.

                                     0000     7 ;

                                     0000     8 ; THIS SOFTWARE IS FURNISHED UNDER  A LICENSE FOR USE ONLY  ON  A

                                     0000     9 ; SINGLE COMPUTER SYSTEM AND MAY BE  COPIED ONLY WITH  THE INCLU-

                                     0000    10 ; SION OF  THE  ABOVE  COPYRIGHT NOTICE.  THIS SOFTWARE,  OR  ANY

                                     0000    11 ; OTHER COPIES THEREOF, MAY NOT BE  PROVIDED  OR  OTHERWISE  MADE

                                     0000    12 ; AVAILABLE TO ANY OTHER PERSON EXCEPT  FOR  USE  ON  SUCH SYSTEM

                                     0000    13 ; AND TO  ONE WHO AGREES  TO  THESE LICENSE  TERMS.  TITLE TO AND

                                     0000    14 ; OWNERSHIP OF THE SOFTWARE SHALL AT ALL TIMES REMAIN IN DEC.

                                     0000    15 ;

                                     0000    16 ; THE INFORMATION IN THIS SOFTWARE  IS  SUBJECT TO CHANGE WITHOUT

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

                                     0000    18 ; EQUIPMENT 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 ; H.J.	AUGUST 1977

                                     0000    24 ;

                                     0000    25 ; BACKTRANSLATOR COMMAND GENERATOR

                                     0000    26 ;

CMDGEN          - COMMAND GENERATOR                              22-AUG-1978 05:16:42   VAX-11 MACRO X0.3-11               Page   2

HJ                                                                                                                               (2)



                                     0000    28 ;

                                     0000    29 ; MACRO LIBRARY CALLS

                                     0000    30 ;

                                     0000    31 	$BTDEFS				;DEFINE SYMBOLS FOR LOCAL USE

                                     0000       	.SAVE

                                 00000000       	.PSECT	$ABS$,ABS

                                     0000       	.RESTORE

                                     0000    32 ;

                                     0000    33 ; LOCAL SYMBOLS

                                     0000    34 ;

                           00000050  0000    35 	GCMLSIZE   =80	;DEFINE MAXIMUM SIZE OF MCR COMMAND LINE WE CAN MAKE

                                     0000    36 ;

                                     0000    37 ; ARGUMENT LIST OFFSET DEFINITIONS

                                     0000    38 ;

                                     0000    39 

                                     0000    40 ;

                                     0000    41 ;

                                     0000    42 ;

                                     0000    43 

                                     0000    44 ;

                                     0000    45 ; LOCAL DATA

                                     0000    46 ;

                                     0000    47 		IMPURE

                                 00000000       	.PSECT	IMPURE_	LONG,RD,WRT,NOEXE

                                     0000    48 ;

                                     0000    49 ;

                                     0000    50 ;

                           00000000  0000    51 RESULT_DESC::	.LONG	0			;SIZE WILL GO HERE

                           00000008' 0004    52 		.LONG	RESULT_STR		;ADDRESS OF RESULT STRING

                                     0008    53 

                                 20  0008    54 RESULT_STR:	.BYTE	^A\ \			;ALWAYS START LINE WITH BLANK

                           00000058  0009    55 		.BLKB	GCMLSIZE-1		;AREA TO PLACE MCR LINE

                                     0058    56 

                           00000000  0058    57 PROG_DESC::	.LONG	0			;SIZE OF THE PROGRAM NAME

                           00000000  005C    58 		.LONG	0			;ADDRESS SET BY CMDGEN

                                     0060    59 

                                     0060    60 		PURE

                                 00000000       	.PSECT	PURE_	BYTE,RD,EXE,NOWRT

                                     0000    61 PROGTAB:

                                     0000    62 		PROGIDS	GENTXT			;GENERATE THE FILENAME TABLE

                                 FF  0000       	.BYTE	-PROG_CNT

                                 03  0001       	.BYTE	$$$CNT

                           50 49 50  0002       	.ASCII	\PIP\

                                 FE  0005       	.BYTE	-PROG_CNT

                                 03  0006       	.BYTE	$$$CNT

                           56 34 46  0007       	.ASCII	\F4V\

                                 FD  000A       	.BYTE	-PROG_CNT

                                 03  000B       	.BYTE	$$$CNT

                           52 41 4D  000C       	.ASCII	\MAR\

                                 FC  000F       	.BYTE	-PROG_CNT

                                 03  0010       	.BYTE	$$$CNT

                           43 41 4D  0011       	.ASCII	\MAC\

                                 FB  0014       	.BYTE	-PROG_CNT

                                 03  0015       	.BYTE	$$$CNT

                           53 4F 53  0016       	.ASCII	\SOS\

                                 FA  0019       	.BYTE	-PROG_CNT

                                 03  001A       	.BYTE	$$$CNT

CMDGEN          - COMMAND GENERATOR                              22-AUG-1978 05:16:42   VAX-11 MACRO X0.3-11               Page   3

HJ                                                                                                                               (2)



                           50 4C 53  001B       	.ASCII	\SLP\

                                 F9  001E       	.BYTE	-PROG_CNT

                                 03  001F       	.BYTE	$$$CNT

                           50 4D 44  0020       	.ASCII	\DMP\

                                 F8  0023       	.BYTE	-PROG_CNT

                                 03  0024       	.BYTE	$$$CNT

                           4C 42 43  0025       	.ASCII	\CBL\

                                 F7  0028       	.BYTE	-PROG_CNT

                                 03  0029       	.BYTE	$$$CNT

                           42 4B 54  002A       	.ASCII	\TKB\

                                 F6  002D       	.BYTE	-PROG_CNT

                                 03  002E       	.BYTE	$$$CNT

                           42 49 4C  002F       	.ASCII	\LIB\

                                 F5  0032       	.BYTE	-PROG_CNT

                                 03  0033       	.BYTE	$$$CNT

                           52 42 4C  0034       	.ASCII	\LBR\

                                 F4  0037       	.BYTE	-PROG_CNT

                                 03  0038       	.BYTE	$$$CNT

                           32 50 42  0039       	.ASCII	\BP2\

                                 F3  003C       	.BYTE	-PROG_CNT

                                 03  003D       	.BYTE	$$$CNT

                           44 46 55  003E       	.ASCII	\UFD\

                                 F2  0041       	.BYTE	-PROG_CNT

                                 03  0042       	.BYTE	$$$CNT

                           54 52 53  0043       	.ASCII	\SRT\

                                 F1  0046       	.BYTE	-PROG_CNT

                                 03  0047       	.BYTE	$$$CNT

                           46 49 44  0048       	.ASCII	\DIF\

CMDGEN          - COMMAND GENERATOR                              22-AUG-1978 05:16:42   VAX-11 MACRO X0.3-11               Page   4

HJ                                                                                                                               (3)



                                     004B    64 ;	.SBTTL	CMDGEN COMMAND GENERATOR

                                     004B    65 ;+

                                     004B    66 ; BACKTRANSLATOR CMDGEN

                                     004B    67 ;

                                     004B    68 ; CONVERTS INTERNALLY BUILT TABLES TO MCR LINE

                                     004B    69 ;

                                     004B    70 ;

                                     004B    71 ; INPUTS:

                                     004B    72 ;  THE INPUTS ARE STRINGS PLACED IN TABLES BY THE BACKTRANSLATOR

                                     004B    73 ;  ROUTINE FOR THE GIVEN COMMAND

                                     004B    74 ;

                                     004B    75 ;

                                     004B    76 ; OUTPUTS:

                                     004B    77 ;  THE OUTPUT CONSISTS OF TWO STRINGS OR AN ERROR MESSAGE AND ABORT.

                                     004B    78 ;  THE CALLER OPENS THE IMAGE AND INVOKES THE COMPATIBILITY EMULATOR

                                     004B    79 ;  IF NO ERROR OCCURS.

                                     004B    80 ;

                                     004B    81 ;  1- FILENAME STRING OF COMPATIBILITY MODE IMAGE TO BE ACTIVATED.

                                     004B    82 ;

                                     004B    83 ;  2- COMMAND LINE TO BE GIVEN TO THE IMAGE.

                                     004B    84 ;

                                     004B    85 ;-

                                     004B    86 COMMAND_GEN::

            50       0000'CF     8E  004B    87 	MNEGB	W^PROGINDEX,R0		;GET THE PROGRAM NUMBER TO RUN

       00C8 8F            50     3A  0050    88 	LOCC	R0,#200,PROGTAB		;FIND THE PROGRAM NAME

                       A9 AF         0055       

                                     0057    89 

                          51     D6  0057    90 	INCL	R1			;POINT TO ITS LENGTH

       0058'CF            81     9A  0059    91 	MOVZBL	(R1)+,W^PROG_DESC	;SAVE THE LENGTH OF THE NAME

       005C'CF            51     D0  005E    92 	MOVL	R1,W^PROG_DESC+4	;STORE THE ADDRESS OF THE NAME

                                     0063    93 

                                     0063    94 	.ENABL	LSB

                                     0063    95 

                                     0063    96 COMMAND_GEN1::

            55       0009'CF     9E  0063    97 	MOVAB	W^RESULT_STR+1,R5	;GET AREA TO BUILD RESULT STRING

            54            01     D0  0068    98 	MOVL	#1,R4			;INITIALIZE THE RESULT LENGTH

                          59     D4  006B    99 	CLRL	R9			;SET UP TO LOOP THRU OUTPUT ARGUMENTS

                          53     D4  006D   100 	CLRL	R3			;SET UP FOR NO LEADING ','

            59         F6 8F     91  006F   101 10$:	CMPB	#PRIM_INPUT,R9		;ARE WE SWITCHING TO INPUT NOW?

                          03     12  0073   102 	BNEQ	20$			;BRANCH IF NOT

            53            3D     90  0075   103 	MOVB	#^A\=\,R3		;PUT IN INPUT INDICATOR

            58       0000'CF     9E  0078   104 20$:	MOVAB	W^ARGSLIST,R8		;GET ADDRESS OF ARGUMENT STRINGS

            57       0000'CF     D0  007D   105 	MOVL	W^ARGSLISTPTR,R7	;GET LAST USED SLOT IN LIST

                          1D     10  0082   106 	BSBB	DOTEXT			;MOVE POSITIONS TEXT TO RESULT STRING

            58       0000'CF     9E  0084   107 	MOVAB	W^OPTLIST,R8		;GET ADDRESS OF OPTION STRINGS

            57       0000'CF     D0  0089   108 	MOVL	W^OPTLISTPTR,R7		;GET LAST USED SLOT IN LIST

                          11     10  008E   109 	BSBB	DOTEXT			;MOVE POSITIONS OPTIONS INTO RESULT

                          59     97  0090   110 	DECB	R9			;BUMP TO NEXT PARAMETER

            53            2C     90  0092   111 	MOVB	#^A/,/,R3		;SET UP TO OUTPUT LEADING ','

            59         EC 8F     91  0095   112 	CMPB	#LAST_PARAM,R9		;ARE WE THRU ALL THE PARAMETERS?

                          D4     15  0099   113 	BLEQ	10$			;BRANCH TO KEEP GOING

       0000'CF            54     B0  009B   114 	MOVW	R4,W^RESULT_DESC	;SAVE IT

                                 05  00A0   115 RSB1$:	RSB				;RETURN TO CALLER

                                     00A1   116 

                          67     94  00A1   117 DOTEXT:	CLRB	(R7)			;FORCE TERMINATOR AT END OF TEXT

            57            58     D1  00A3   118 30$:	CMPL	R8,R7			;MAKE SURE DON'T GO PASSED END

                          F8     1E  00A6   119 	BGEQU	RSB1$			;BRANCH IF REACHED END OF TEXT

CMDGEN          - COMMAND GENERATOR                              22-AUG-1978 05:16:42   VAX-11 MACRO X0.3-11               Page   5

HJ                                                                                                                               (3)



            59            88     91  00A8   120 	CMPB	(R8)+,R9		;DOES STRING GO IN THIS POSITION?

                          F6     12  00AB   121 	BNEQ	30$			;BRANCH IF NOT

            56            53     90  00AD   122 	MOVB	R3,R6			;TEST AND SET FLAG/CHARACTER

                          04     13  00B0   123 	BEQL	40$			;BRANCH IF NOP

                          0C     10  00B2   124 	BSBB	PUTBYT			;OUTPUT IT AS DELIMITER

                          53     D4  00B4   125 	CLRL	R3			;CLEAR THE FLAG

                          68     95  00B6   126 40$:	TSTB	(R8)			;ARE WE STILL IN PART OF SAME STRING?

                          E9     15  00B8   127 	BLEQ	30$			;BRANCH IF NOT

                       F9 AF     9F  00BA   128 	PUSHAB	40$			;INSERT THE BYTE INTO RESULT STRING

                                     00BD   129 					;LOOP THRU STRING

                                     00BD   130 

            56            88     90  00BD   131 PUTADB:	MOVB	(R8)+,R6		;GET THE BYTE TO SAVE

            85            56     90  00C0   132 PUTBYT:	MOVB	R6,(R5)+		;MOVE THE BYTE IN

                          54     96  00C3   133 	INCB	R4			;BUMP LENGTH

            54         50 8F     91  00C5   134 	CMPB	#GCMLSIZE,R4		;IS RESULT GETTING TO LONG

                          D5     14  00C9   135 	BGTR	RSB1$			;BRANCH IF LENGTH OK	

                                     00CB   136 	ERROR	STRINGOVR,FATAL		;REPORT ERROR AND ABORT

            50            14     9A  00CB       	MOVZBL	#BTR$_STRINGOVR+FATAL&^XFF,R0

                          FF2F'  31  00CE       	BRW	ERR_EXIT

                                     00D1   137 

                                     00D1   138 	.DSABL	LSB

                                     00D1   139 

                                     00D1   140 	.END

CMDGEN          - COMMAND GENERATOR                              22-AUG-1978 05:16:42   VAX-11 MACRO X0.3-11               Page   6

SYMBOL TABLE                                                                                                                     (3)



$$$CNT         = 00000003            PROG_MAC       = 00000004            

ARGSLIST         ********   X   04   PROG_MAR       = 00000003            

ARGSLISTPTR      ********   X   04   PROG_PIP       = 00000001            

BIT...         = 00000008            PROG_SLP       = 00000006            

BTR$M_DECIMAL  = 00000080            PROG_SOS       = 00000005            

BTR$M_EXPLICIT = 00000020            PROG_SRT       = 0000000E            

BTR$M_FORCE    = 00000002            PROG_TKB       = 00000009            

BTR$M_LIST     = 00000040            PROG_UFD       = 0000000D            

BTR$M_MULTKEY  = 00000010            PUTADB           000000BD R     04   

BTR$M_RETURN   = 00000001            PUTBYT           000000C0 R     04   

BTR$M_TEMPPOS  = 00000004            RESULT_DESC      00000000 RG    03   

BTR$M_VALREQ   = 00000008            RESULT_STR       00000008 R     03   

BTR$V_DECIMAL  = 00000007            RSB1$            000000A0 R     04   

BTR$V_EXPLICIT = 00000005            SAVE_REG_MASK  = 00000FFC            

BTR$V_FORCE    = 00000001            

BTR$V_LIST     = 00000006            

BTR$V_MULTKEY  = 00000004            

BTR$V_RETURN   = 00000000            

BTR$V_TEMPPOS  = 00000002            

BTR$V_VALREQ   = 00000003            

BTR$_AMBIGKEYW = 00688030            

BTR$_ILLEGOPT  = 00688018            

BTR$_IMGFNF    = 00688060            

BTR$_INTFAIL   = 00688048            

BTR$_INVALKEYW = 00688028            

BTR$_KEYVALOVR = 00688038            

BTR$_MISSNGVAL = 00688008            

BTR$_NOTIMPLEM = 00688020            

BTR$_OPTVALOVR = 00688050            

BTR$_STRINGOVR = 00688010            

BTR$_TOOMANY   = 00688058            

BTR$_UNEXPLIST = 00688040            

BTRAN          = 00680000            

COMMAND_GEN      0000004B RG    04   

COMMAND_GEN1     00000063 RG    04   

DOTEXT           000000A1 R     04   

ERR_EXIT         ********   X   04   

FATAL          = 00000004            

GBL...         = 00000000            

GCMLSIZE       = 00000050            

LAST_PARAM     = FFFFFFEC            

NONE           = 00000000            

OPTLIST          ********   X   04   

OPTLISTPTR       ********   X   04   

PRIM_INPUT     = FFFFFFF6            

PRIM_OUTPUT    = 00000000            

PROGINDEX        ********   X   04   

PROGTAB          00000000 R     04   

PROG_BP2       = 0000000C            

PROG_CBL       = 00000008            

PROG_CNT       = 0000000F            

PROG_DESC        00000058 RG    03   

PROG_DIF       = 0000000F            

PROG_DMP       = 00000007            

PROG_F4V       = 00000002            

PROG_LBR       = 0000000B            

PROG_LIB       = 0000000A            

CMDGEN          - COMMAND GENERATOR                              22-AUG-1978 05:16:42   VAX-11 MACRO X0.3-11               Page   7

PROGRAM SECTION SYNOPSIS                                                                                                         (3)







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  

$ABS$            00000000      02     NOPIC   USR   CON   ABS   LCL NOSHR   EXE   RD    WRT BYTE  

IMPURE_          00000060      03     NOPIC   USR   CON   REL   LCL NOSHR NOEXE   RD    WRT LONG  

PURE_            000000D1      04     NOPIC   USR   CON   REL   LCL NOSHR   EXE   RD  NOWRT BYTE  





THERE WERE NO ERRORS OR WARNINGS.

24594. BYTES LEFT IN FREE MEMORY POOL.

4. BYTES OF RECLAIMED MEMORY.

OBJ$:CMDGEN,LIS$:CMDGEN/-SP/LI:MEB=EXECML$/ML,LIB$:B/ML,SRC$:CMDGEN

19 MLB DIR RDS - 149 GETS TO DEFINE 14 MACROS. 17 INTER. FILE WRITES. 

