From: mckinneyj@cpva.saic.com Sent: Wednesday, June 18, 2003 3:22 PM To: Info-VAX@Mvb.Saic.Com Subject: Re: DCL$AL_TAB_VEC equivalent for OpenVMS Alpha In article <8ss0fvgq17oe4vclbhs08rntjcm48a51vj@4ax.com>, David M Smith writes: > In 1993 Chris Chiesa posted some code which showed how to invoke a DCL COPY > command from an executable image. This code relied on the use of an undocumented > (as far as I can see) global symbol, DCL$AL_TAB_VEC, the address in > DCLTABLES.EXE of the start of the DCL command table. > > For details, see Google Groups and search for DCL$AL_TAB_VEC. > > This symbol does not appear to be defined / available on OpenVMS Alpha. Does > anyone know of an equivalent symbol, or technique, for Alpha? > ------------------------------------------------------------------------- > David M. Smith 302.391.8533 dsmit115 at csc dot com > Computer Sciences Corporation (Opinions are those of the writer only) > ------------------------------------------------------------------------- "technique" - I assume that your goal is to $IMGACT COPY or some other program? And I assume that MACRO's ok? this might be enought to get you going... I can give you a working example of $IMGACTing if this doesn't do it for you. It was rather lengthy (650+ lines) so I refrained from posting. If you'd like the entire program it email to mckinneyj AT saic DOT com Anyway, here're (all, I hope) the pertinent symbols and code. $CLIDEF ;CLI symbols $IACDEF ;Image Activator symbols .IF DEFINED, ALPHA $EIHADEF ;Image Activator Transfer Array symbols $EIHDDEF ;Image Header symbols .IFF $IHADEF ;Image Activator Transfer Array symbols $IHDDEF ;Image Header symbols .ENDC $PSLDEF ;Process mode symbols home_range: ; Address range called program "wants" .IF DEFINED, ALPHA ; to inhabit (assume default base) .address ^x00010000 ; AXP start at %x10000 (2nd AXP page) .address ^x00FFFFFF ; more than we'd ever need (32639 pages) .IFF .address ^x00000200 ; VAX start at %x200 (2nd VAX page) .address ^x00FFFFFF ; more than we'd ever need (32766 pages) .ENDC ; $IMGACT will only take what is needed extdefault: .ascid \SYS$SYSTEM:.EXE\ ; command image default string image_dsc: .ascid \COPY\ ; command image img_header_buf: ; buffer contains image header .blkb block ; of program to be $IMGACT'ed vm_actual: ; "actual" address range into .blka ; which called program gets .blka ; mapped at run time imgact_command: .blkb 132 imgact_command_desc: imgact_command_len: .word command_size .byte dsc$k_dtype_t .byte dsc$k_class_s imgact_command_line_addr: .address imgact_command ; let DCL parse the command line... pushl g^CTL$AG_CLITABLE ; address of command tables pushaq imgact_command_desc ; address of command descriptor calls #2,g^CLI$DCL_PARSE ; check the command bsbw error_check ; check for errors movq extdefault,-(sp) ; build descriptor on the stack movl sp,r0 ; then point r0 there $IMGACT_S - ; since we'll not call another .EXE NAME=image_dsc,- ; we needn't worry about cleaning up DFLNAM=(r0),- ; (recovering the VA space) afterwards HDRBUF=img_header_buf,- IMGCTL=#,- INADR=home_range,- RETADR=vm_actual,- ACMODE=#PSL$C_USER addl #8,sp ; remove temp desc from stack bsbw error_check ; check for errors $IMGFIX_S bsbw error_check ; check for errors ;+ ; When calling a program there should be six arguments on the stack... ; 4(AP) = address of image transfer array ; 8(AP) = address of CLI callback routine ; 12(AP) = address of image header buffer ; 16(AP) = address of image filespec descriptor ; 20(AP) = address of image linker option flags ; 24(AP) = address of image run time flags ;- movaq img_header_buf,r4 movl (r4),r4 ; the image header pushl #0 ; ignore run time flags .IF DEFINED, ALPHA pushl EIHD$L_LNKFLAGS(r4) ; linker option flags .IFF pushl IHD$L_LNKFLAGS(r4) ; linker option flags .ENDC pushaq image_dsc ; image file filespec pushal img_header_buf ; image header pushl CTL$AL_CLICALBK ; CLI callback routine .IF DEFINED, ALPHA movl EIHD$L_ACTIVOFF(r4),r0 ; offset to activation data movab EIHA$L_TFRADR1(r4)[r0],r1 ; offset to trans vector array .IFF movzwl IHD$W_ACTIVOFF(r4),r0 ; offset to activation data movab IHA$L_TFRADR1(r4)[r0],r1 ; offset to trans vector array .ENDC pushl r1 ; the transfer vector array calls #6,@(r1) ; call image's entry point pushl r0 ; save the status