[Info-vax] VAX VMS going forward
John Reagan
xyzzy1959 at gmail.com
Tue Jul 28 18:04:26 EDT 2020
On Tuesday, July 28, 2020 at 1:49:14 PM UTC-4, Stephen Hoffman wrote:
> On 2020-07-28 14:42:33 +0000, John Reagan said:
>
> > We must be working with different compilers. There is no qualifier or
> > setting to tell the compilers to generate 32-bit code or 64-bit code.
> > The code is the same. You can ask the linker to place it different
> > with LINK/SEG=CODE=P2 or =P0. You can even copy code from P0 into P2
> > on Alpha, Itanium, and x86. You might have to readjust some
> > relocations but the instructions are perfectly fine in either area (the
> > exception is the Itanium C++ compiler).
>
> 32-bit or 64-bit pointer selection in various compilers, BASIC was
> still 32-bit when last I checked, and the thicket of APIs on OpenVMS is
> a confusing mash-up of 32-bit and 64-bit and mixed-bit calls.
>
BASIC doesn't have a pointer type which makes it even more difficult.
COBOL has USAGE IS POINTER and USAGE IS POINTER-64 but without recursion and other modern features, I don't see many COBOL programs working with heap storage. Things like RMS buffer management is all hidden away in the RTL.
Reading any of Hein's COBOL examples over the years that demo itemlist
based services have often made me reconsider my career choice.
Fortran's 64-bit pointer support does not let you have 64-bit pointers in a
structure, only 32-bit pointers. You can only have 64-bit pointers as "1st
level" variables. It has been a "to be added in a future release" for the past
several decades.
C, C++, and Pascal have both and you can mix-and-match them pretty well if
you're up for the challenge.
BLISS makes you choose between two compilers. :) There is no way to deal with
64-bit anything in BLISS-32
The Macro compiler has a boatload of EVAX_ builtins for 64-bit operations.
And the compiler even tries to preserve 64-bits of address for when you do a
PUSHAB (Rn)
and the argument will be in a register. But deferred addressing is always
32-bits to match VAX. And there is an ".ENABLE QUADWORD" to modify the
compiler's compile-time expression processing and operand processing. If you
forget, you're on your own.
I'll agree 100% that the various APIs and having to remember malloc32 vs
malloc64 if you want to have a combo C program (and unfortunately you do when
dealing with many/most VMS APIs).
More information about the Info-vax
mailing list