[Search for users]
[Overall Top Noters]
[List of all Conferences]
[Download this site]
Title: | "ASK THE WIZARDS" |
|
Moderator: | QUARK::LIONEL |
|
Created: | Mon Oct 30 1995 |
Last Modified: | Mon May 12 1997 |
Last Successful Update: | Fri Jun 06 1997 |
Number of topics: | 1857 |
Total number of notes: | 3728 |
1488.0. "Open: recompiling VAX Macro-32 code" by STAR::JKEENAN () Mon Feb 03 1997 10:45
Return-Path: "VMS001::WWW"@vms001.das-x.dec.com
Received: by vmsmkt.zko.dec.com (UCX V4.1-12, OpenVMS V6.2 VAX);
Thu, 2 Jan 1997 22:26:38 -0500
Received: from vms001 by mail13.digital.com (8.7.5/UNX 1.5/1.0/WV)
id WAA11926; Thu, 2 Jan 1997 22:17:29 -0500 (EST)
Date: Thu, 2 Jan 1997 22:16:11 -0500
Message-Id: <[email protected]>
From: "VMS001::WWW"@vms001.das-x.dec.com (02-Jan-1997 2216)
To: [email protected], [email protected], [email protected]
Subject: Ask the Wizard: '[email protected]'
X-VMS-To: [email protected]
Remote Host: bootp117.acc5.amherst.edu
Browser Type: Mozilla/3.01 (Macintosh; I; PPC)
Remote Info: <null>
Name: John W. Manly
Email Address: [email protected]
CPU Architecture: VAX and Alpha
Version: v 6.2
Questions:
Hi there. I have two questions about recompiling VAX MACRO-32 code on an
Alpha that I wonder if "the wizard" could help me with.
--------------------
First, the easy one. Suppose I have a subroutine like the following,
that is called via a JSB instruction:
test: POPL R0
SUBL R1,SP
...
JMP (R0)
Note that what I am doing here is popping off the return address of the
JSB into R0, and then later just jumping directly to that saved address
rather than using an RSB to pop it off the stack. This seems very
straightforward, but when I try to compile it on the Alpha under the MACRO
compiler, I get an error on the "JMP (R0)" line of
%AMAC-I-MUSTBEJSB, branch target must be declared JSB_ENTRY
What gives? Is there some other way to effect this kind of control
construct that allows me to push things onto the stack, effectively
masking out the the return address. I suppose I could try something
like the following, and just save the original stack address:
test: .JSB_ENTRY32
MOVAL (SP),R0
SUBL R1,SP
...
MOVL R0,SP
RSB
But is this reliable? How does the Alpha translate instructions like
this, where the VAX used 32 bits of addressing and the Alpha uses 64?
And what would I do if I WANTED to leave more material on the stack after
returning from the subroutine than I had when I entered it. Could I do
something like the following, and again, would it work reliably?
test: .JSB_ENTRY32
POPL R0
SUBL R1,SP
...
PUSHL R0
RSB
--------------------
The second question is that I'm trying to write some code that I can use on
both the VAX and the Alpha. That is, I want to use a common code base for
both platforms. To do this, I currently have to do something like the
following in those places (like JSB entry points or things that manipulate
the PSW) where the code needs to be different:
.IF_DEFINED ALPHA
.IF_TRUE
(Alpha code goes here)
.IF_FALSE
(VAX code goes here)
.ENDC
The problem is the way I compile this. On the VAX, I just give a normal
"MACRO file" command, and the right things happen. But on the Alpha, in
order to get the "ALPHA" symbol defined, I have to do something like
$ MACRO file+SYS$LIBRARY:ARCH_DEFS
which seems really ugly. And ugly or not, I can't use the same MACRO
command on the VAX, since the VAX doesn't have an ARCH_DEFS.MAR file by
default.
My question then is do I have all of this right, or is there a cleaner way
to do builds on multiple architectures than this? Is there a way to get
the ARCH_DEFS.MAR file loaded into the Alpha MACRO compiler by default,
so that I can just do "MACRO file" on either platform?
Thanks for any pointers or advice.
- John W. Manly <[email protected]> Acting Director, Amherst College ACC
T.R | Title | User | Personal Name | Date | Lines |
---|
1488.1 | See Macro Porting; VAX ARCH_DEFS | XDELTA::HOFFMAN | Steve, OpenVMS Engineering | Mon Feb 03 1997 19:18 | 23 |
|
Please see the Macro Porting documentation included in
the OpenVMS manual set, as well as the 64-bit addressing
documentation in the V7.0 and later manual set.
The calling standard used under OpenVMS Alpha is quite
different from that of OpenVMS VAX -- tools that directly
access (and modify) the call stack are discouraged.
SYS$LIBRARY:ARCH_DEFS is "available" for OpenVMS VAX -- it's
not at all difficult to create if you don't have it:
$ ty SYS$COMMON:[SYSLIB]ARCH_DEFS.MAR;1
;
; This is the VAX version of ARCH_DEFS.MAR, which contains
; architectural definitions for compiling VMS sources for
; VAX systems.
;
VAX = 1
VAXPAGE = 1
ADDRESSBITS = 32
$
|