Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

Vax macro to Alpha macro

 
SOLVED
Go to solution
selahattin okur
Occasional Advisor

Vax macro to Alpha macro

Hello,
We are trying to create .obj of a macro, which is now running on vax/vms V5.5-2H4(vax v4200) , on an alpha vms 7.3(DS20-e).

When I compile the macro on VMS 7.3 I get this :
L2S::RASIT.OKUR>macro /migrat/diagn=a.a/lis pcount

$sfdef
^
%AMAC-E, unrecognized statement
at line number 88 in file DSA0:[ERDEMIR.RASIT.OKUR]PCOUNT.MAR;5

movzbl @sf$l_save_ap(fp),r0
^
%AMAC-E, undefined symbol SF$L_SAVE_AP
at line number 97 in file DSA0:[ERDEMIR.RASIT.OKUR]PCOUNT.MAR;5

.end
^
%AMAC-E, previous errors prevent further analysis
at line number 99 in file DSA0:[ERDEMIR.RASIT.OKUR]PCOUNT.MAR;5
----------------
On vax system in starlet.mlb I can see the the $sfdef with lib/lis command but on VMS 7.3 I couldnt find these entries in mlb.

I am attaching the source of macro and the mlb files.

Thanks in advance.
9 REPLIES 9
Hoff
Honored Contributor

Re: Vax macro to Alpha macro

This code uses VAX architecture features. Specifically, this code is rummaging around in the VAX call frames, looking at the arguments.

The call frames and the calling standard are among the areas that have seen some of the most significant implementation changes among the architectures.

Start by reading the application porting manuals, if you've not already done so.

Some of the interesting stuff is here:
http://h71000.www7.hp.com/doc/archived.html

Some is here:
http://www.hp.com/go/openvms/doc/

And start with these two documents:
http://h71000.www7.hp.com/doc/82final/5601/aa-pv64e-te.pdf
http://h71000.www7.hp.com/doc/73final/documentation/pdf/ovms_migr_appl.pdf

This code pokes around in the VAX stack frames, which means you'll need to figure out exactly what the code is really doing with the saved argument pointer in the stack frame, and migrate it. There are some LIB$ calls that might be of use here, that allow you to more easily navigate the call frames. But whether you can use those depends on what the code is doing.

PCOUNT.MAR implies you're looking at the program counter (PC), and that sort of thing is specific to the platform. On recent OpenVMS Alpha and OpenVMS I64 versions, there are SDA extensions that can be used to track the PC addresses, as well as traceback and other routines. Put another way, there may well be replacement code available in OpenVMS itself; you may need to rework the existing code to use these routines, rather than the more direct work to re-implement what the code was doing.



selahattin okur
Occasional Advisor

Re: Vax macro to Alpha macro

Pcount.mar has been used for the parameter count of the subroutine, where pcount itsel has been called.
Robert Gezelter
Honored Contributor

Re: Vax macro to Alpha macro

selahattin,

Most likely, MACRO-32 code that dates to VAX/VMS 5.5-2 will require other changes in the declaritives.

The AMACRO compiler is rather strict about what it will allow.

My recommendation is to read the manual on porting VERY carefully, and work through all of the code making the required changes. It is far more frustrating to work one diagnostic at a time.

- Bob Gezelter, http://www.rlgsc.com
Jess Goodman
Esteemed Contributor
Solution

Re: Vax macro to Alpha macro

You can't call routine B from routine A to get the number of arguments passed to routine A on an Alpha, like you could on a VAX.

Instead you have to use a language extension to get the number of arguments to a routine in that routine itself.

In the routine is in Fortran just use the IARGCOUNT intrinsic. It's return value is the number of arguments of the calling routine:
NARGS = IARGCOUNT()

In C/C++ use:
#include
va_count(nargs);
I have one, but it's personal.
Hoff
Honored Contributor

Re: Vax macro to Alpha macro

Ok. I've unrar'd that archive and had a look at the code. (First time I've seen a rar archive in this corner of the programming universe, too.)

Here's what matters from within the rar...

.entry pcount,^m<>
movzbl @sf$l_save_ap(fp),r0
ret

Here's some related reading...

http://h71000.www7.hp.com/wizard/wiz_6246.html

And here's the detailed and serious reading around the code here...

http://h71000.www7.hp.com/doc/82final/5973/5973pro_004.html#bottom_004

Here's some very serious example source code...

http://www.myths.com/~dpm/vms/her/her.c

Or yes, do use the language-specific constructs for whatever language is in use here. And if you're using a language that has this argument count extension, this approach will be the easiest way.