From: SMTP%"ichihara@rikvax.riken.go.jp" 1-OCT-1993 13:55:42.00 To: EVERHART CC: Subj: Re: What's a Homed Arglist on a VMS Alpha? X-Newsgroups: comp.os.vms,vmsnet.alpha Subject: Re: What's a Homed Arglist on a VMS Alpha? Message-ID: <1993Sep30.030607.15140@riksun.riken.go.jp> From: ichihara@rikvax.riken.go.jp (Takashi Ichihara) Date: Thu, 30 Sep 1993 03:06:07 GMT Reply-To: ichihara@rikvax.riken.go.jp Sender: usenet@riksun.riken.go.jp Organization: RIKEN (The Institute of Physical and Chemical Research) 2-1 Hirosawa, Wako, Saitama, 351-01 Japan Nntp-Posting-Host: rikvax Lines: 140 To: Info-VAX@KL.SRI.COM X-Gateway-Source-Info: USENET In article <28d845$22a@news.u.washington.edu>, seymour@stein2.u.washington.edu (Richard Seymour) writes: >Well, after an hour or so torturing my eyeballs using BookReader to not find > something, i'm again throwing my stupidity at the mercy of the net to ask: > "What's homing an arglist in AXP Macro"? > >scenario: using AXP Macro-64 assembler to convert a VAX Macro program (below) > to Alpha-dom. The macro program is plucking arguments from the stack (using > (AP)-relative addressing), and the AXP Assembler has two complaints: > AMAC-I-MAXARGUSE; MAX_ARGS value used for homed arglist in routine FOO is 3 >and > AMAC-I-ARGLISHOME; arglist must be homed in routine FOO > >(froth,rant,rave) neither of those two error messages are mentioned in the > Macro-64 Error appendix. "arglist" and "homed" do not exist in the manual's > index (there isn't even an "H" section). Hello What you are using is not a Macro-64 assembler, but a Macro-32 compiler. Macro-64 is a native assembler of an Alpha/AXP architecture with 32 64-bit general registers etc.; of course different from VAX. Macro-32 compiler is something like a cross assembler to compile a VAX macro assembler code on Alpha/AXP. There are something needed to change in the source code when you compile a VAX-macro code in Alpha AXP. You can get this information by Book-reader On-line documentation of Open VMS/AXP V1.5 CD ROM domumentation Open VMS/AXP V1.5 Operating system OpenVMS Programming Documents. (or $ Help Mac/mig compiler_directive) In UGZ006, Change the following entry statement .ENTRY UGZ006,^M by the following macro-32 directive. Then it will work in alpha/VMS. UGZ006:: .call_entry ,20,true In AXP, max_arg (in this case, 20) must be specified to reserve the buffer area to store the arguments. Otherwise, the macro-32 compiler will check the source statement and assume the value by the immediate use of the argument variables. In the case of UGZ006, the macro-32 compiler assumed the value to be 3, this makes a problem. By the way, I have successfully ported the UGS from VAX/VMS to Alpha-AXP two month ago. I will write some TIPS of this porting and post it here, if it will would be helpful for you. Various permutations and thread- > followings lead me to believe that it based upon the difference between the > way VAXen and AXPen pass arguments upon the stack (only 3 words are used on > Alphas?), No. You can specify it by the max_arg parameter in the .call_entry directive as mentioned above. > and that the Macro-assembler noticed we were plucking things more > than 3 entries away (smart, that...). > >Another solution to my problem would be to recode this into Fortran (matching > the rest of the package)... but it's a variable-argument-list-length routine. > The suspect chunk of it is finding out how many arguments it has, and then > it moves them to a local array (ARGL) for use by a called routine. You can use IARGCOUNT() Fortran intrinsic function (undocumented) to get argument count of the subroutine in AXP-Fortran V6.1 or later. >An AXP-VMS-Fortran-compatible NUMARG function would help a bunch. >An explanation of "homed", or example of doing it, would help. >Making whoever generates an error message in a compiler/assembler get the > ^$%^$%^%$ message into the documentation would help... using words which > the Index helps locate... but that would be -too- perfect a world, wouldn't it? >thanks...--dick >.....................code follows, pardon the all-caps, (it's very old)... >(yes, it's a chunk of Stanford's Unified Graphics System (UGS)) > > .TITLE UGZ006 > .IDENT /01/ > .PSECT $UGCODE,LONG >; * SUBROUTINE TO EXECUTE A SUBROUTINE WITH POINTER ARGUMENTS * >; * THIS SUBROUTINE MAY BE USED TO EXECUTE A SUBROUTINE WHEN THE * >; * ADDRESS OF THE SUBROUTINE AND/OR THE ADDRESSES OF THE * >; * SUBROUTINE'S ARGUMENTS ARE KNOWN. THIS VERSION OF THE * >; * SUBROUTINE IS CALLED BY THE DEVICE-INDEPENDENT MODULES. * >; * * >; * THE CALLING SEQUENCE IS: * >; * CALL UGZ006(SADR,NARG,IARG,ARG1,ARG2,...) * >; * * >; * THE PARAMETERS IN THE CALLING SEQUENCE ARE: * >; * SADR THE ADDRESS OF THE SUBROUTINE TO BE CALLED. THIS * >; * ADDRESS MUST HAVE BEEN DEVELOPED BY SUBROUTINE UGZ002 * >; * OR UGZ004. * >; * NARG THE NUMBER OF ARGUMENTS THAT ARE GIVEN BY ADDRESSES. * >; * IARG AN ARRAY CONTAINING THE INDICES OF THE ARGUMENTS GIVEN * >; * BY ADDRESSES. * >; * ARG1 FIRST ACTUAL ARGUMENT. * >; * ARG2 SECOND ACTUAL ARGUMENT. * >; * ... ... * >; .ENTRY UGZ006,^M ; * make this line comment out* UGZ006:: .call_entry ,20,true >; >NARG = 16 ; LENGTH OF ARGUMENT LIST. >; >; OBTAIN THE ARGUMENT LIST. > MOVZBL (AP),R2 ; GET LENGTH OF ARGUMENT LIST. > SUBL3 #3,R2,B^ARGL ; MOVE ARGUMENT LIST LENGTH. > MOVL #3,R3 ; INITIALIZE INDICES. > CLRL R4 >OBT1: CMPL R2,R3 ; CHECK FOR END OF LIST. > BLEQ PAG1 > INCL R3 ; INCREMENT THE INDICES. > INCL R4 > MOVL (AP)[R3],B^ARGL[R4] ; MOVE AN ARGUMENT POINTER. > BRB OBT1 >; >; PROCESS THE ARGUMENT LIST. >PAG1: MOVL @8(AP),R2 ; GET MODIFICATION COUNT. > CLRL R3 ; INITIALIZE INDEX. > MOVL 12(AP),R4 ; GET ADDRESS OF CHANGE FLAGS. >PAG2: CMPL R2,R3 ; CHECK FOR END OF LIST. > BLEQ CAL1 > MOVL (R4)[R3],R5 ; GET CHANGE INDEX. > INCL R3 ; INCREMENT THE INDEX. > MOVL B^ARGL[R5],R6 ; ADJUST THE ARGUMENT POINTER. > MOVL (R6),B^ARGL[R5] > BRB PAG2 >; >; CALL THE REQUESTED SUBROUTINE. >CAL1: MOVL @4(AP),R2 ; GET SUBROUTINE ADDRESS. > CALLG B^ARGL,(R2) ; CALL THE SUBROUTINE. > >; RETURN TO CALLING SUBROUTINE. > RET ; RETURN TO CALLER. > >; INTERNAL VARIABLE STORAGE. > .ALIGN LONG >ARGL: .BLKL NARG ; ARGUMENT LIST. > .END