In article <
28a3759f-1a18-4e01...@n11g2000yqe.googlegroups.com>, Tom Adams <
w.tom...@gmail.com> writes:
>On May 15, 8:46=A0pm, "John Reagan" <
johnrrea...@earthlink.net> wrote:
>> > "Tom Adams" =A0wrote in message
>> >news:7d84b7ec-c9cc-45ed...@e13g2000yqp.googlegroups.com..=
>..
>>
>> Negative Macro-32 comments aside, here are my comments:
>>
>> > =A0 =A0 =A0 =A0 .psect data
>> > prcnam: .ascid =A0/ =A0 =A0 =A0 =A0 =A0 =A0 =A0 /
>> > namlng: .blkl
>> > .psect code
>> > =A0 =A0 =A0 =A0 .CALL_ENTRY LABEL=3DXXX,MAX_ARGS=3D15,HOME_ARGS=3DTRUE
>> > =A0 =A0 =A0 =A0 pushal =A0namlng =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
>=A0 =A0 =A0 =A0;Put buffer length on
>> > stack
>> > =A0 =A0 =A0 =A0 pushal =A0prcnam =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
>=A0 =A0 =A0 =A0;Put name buffer on stack
>> > =A0 =A0 =A0 =A0 calls =A0 #2, prc_getnam =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
>=A0 =A0;Get process name
>>
>> This pushes the address of the 32-bit namlng variable (INTEGER*4 since yo=
>u
>> seem to be using Fortran along with the Macro-32). =A0And it pushes the
>> address of a descriptor which describes 'prcnam'. =A0It isn't pushing the
>> address of buffer but the address of the descriptor to the buffer. =A0Is =
>that
>> intentional? =A0Is 'prc_getnam' in Fortran?
>>
>> > =A0 =A0 =A0 =A0 pushal =A0prcnam =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
>=A0 =A0 =A0 =A0;Save process name
>>
>> Again, this pushes the address of the descriptor to the name. =A0How is t=
>he
>> mc$pcs_trckbck error string defined in the .msg file? =A0What FAO codes a=
>re
>> used? =A0Did 'prc_getnam' update the passed descriptor?
>>
>> There isn't anything wrong with using Macro-32 to copy over the argument
>> list, add 3 more arguments to it, and then call LIB$SIGNAL. =A0That is do=
>ne
>> several times inside of the OpenVMS code base itself.
>>
>> If you can give more info, I'm happy to help. =A0Of course giving up and
>> rewriting it will avoid whatever problem you have now.
>>
>> John
>
>prc_getnam is in FORTRAN
>
>The code I posted still gives these informational messages: AMAC-I-
>VARSIZSTK and AMAC-I-RUNTIMSTK
>
>The orginal code with .ENTRY instead of .CALL_ENTRY gave these
>additoinal informationals:
>
>AMAC-I-ARGLISHOME and AMAC-I-MAXARGUSE
>
>but MAXARGUSE was actually a bug indicator, since it says the the
>maximum arguments of PCS_TRCBCK was set to 6
>
>The mystery is that, even after I "fix" this by using .CALL_ENTRY,
>testing indicates that it is still the case that only 6 arguments are
>used.
From what you've ported to date, I've taken the liberty of coding this for
you. I'm assuming that the "PCS_PRCNAM" is getting the process name. For
this, I chose to use LIB$GETJPI. I've also removed the static storage of
the descriptor so now this should be AST-reentrant.
.TITLE PCS_TRCBCK
.IDENT /01/
TOBITS = 3 ; convert: shift for bytes to bits
.LIBRARY "SYS$LIBRARY:STARLET.MLB" ; look here for:
$DSCDEF ; OpenVMS descriptor definitions
$JPIDEF ; $GETJPI item code definitions
$LIB$ROUTINESDEF; LIB$ RTL macro definitions
$STR$ROUTINESDEF; LIB$ RTL macro definitions
.PSECT CODE,NOWRT,EXE,5
.CALL_ENTRY LABEL=PCS_TRCBCK,MAX_ARGS=15,HOME_ARGS=TRUE
;++
; Create a Dynamic String Descriptor on the stack.
; LIB$GETJPI will place the process name into this.
;--
CLRL -(SP)
PUSHL #<DSC$K_CLASS_D@<DSC$B_CLASS@TOBITS>>!-
<DSC$K_DTYPE_T@<DSC$B_DTYPE@TOBITS>>
$lib_getjpi_S item_code = #JPI$_PRCNAM,-
resultant_string = (SP)
.BRANCH_LIKELY ; assume success andd tell compiler
BLBS R0,10$ ; continue if LIB$GETJPI successful
RET
10$: MOVZBL (AP),R0 ; get the passed in argument count
.DISABLE FLAGGING ; disable compiler informational
20$: PUSHL (AP)[R0] ; copy passed arguments to stack
.ENABLE FLAGGING ; enable compiler informational
SOBGTR R0,20$ ; one by one until all exhausted
MOVZBL (AP),R0 ; get the passed in argument count
PUSHAL (SP)[R0] ; process name is at end of list
PUSHL #2 ; MC$PCS_TRCBCK has 2 FAO arguments
PUSHL #MC$PCS_TRCBCK ; push the MC$PCS_TRCBCK error code
ADDL2 #3,R0 ; correct argument count for above
.DISABLE FLAGGING ; disable compiler informational
CALLS R0,G^LIB$SIGNAL ; signal the error(s)
.ENABLE FLAGGING ; enable compiler informational
;++
; Free up the memory acquired for the process name
; via the Dynamic String Descriptor on the stack.
;--
$str_free1_dx_S string_descriptor = (SP)
MOVL #SS$_NORMAL,R0
RET
.END