[Info-vax] VAX VMS going forward
Arne Vajhøj
arne at vajhoej.dk
Tue Jul 28 09:53:54 EDT 2020
On 7/28/2020 9:01 AM, Arne Vajhøj wrote:
> On 7/28/2020 8:51 AM, Simon Clubley wrote:
>> On 2020-07-28, Arne Vajhøj <arne at vajhoej.dk> wrote:
>>> On 7/28/2020 8:31 AM, Simon Clubley wrote:
>>>>
>>>> Only on VMS. This is (mostly) not a significant problem on other
>>>> operating systems because the vast majority of the work is done for
>>>> you by the compiler and linker in those environments after you tell
>>>> the compiler whether you want your code to run with 32-bit or 64-bit
>>>> addresses and other features.
>>>
>>> ????
>>>
>>> On what other platform is it common to pass 64 bit addresses
>>> as 32 bit bit values with implicit values for the remaining bits?
>>
>> As you should well know, you simply don't have to worry about this
>> in those environments. My answer above should have been enough for
>> you to understand the point I was making.
>>
>> You tell the compiler whether you want a 32-bit or 64-bit executable
>> and it, the linker, and OS support libraries takes care of most of
>> the work for you (if not all the work).
>>
>> I wish it was that simple on VMS.
>
> Other environments are not doing this at all.
>
> Many other environments has 32 bit mode and 64 bit mode. Different
> instruction sets and address size in the CPU. Two sets of
> libraries. Etc..
>
> But that is completely different from what VMS has.
>
> VMS Alpha/Itanium only has 64 bit mode and 64 bit addresses in the
> CPU, single instruction set and one set of libraries. That single set
> of libraries just have a lot of API's only passing lower half of
> addresses and a few passing full addresses.
>
> Totally apples and oranges.
Example.
Windows - two different builds producing two different
programs a 32 bit and a 64 bit running in different CPU modes:
C:\Work>type ptr.c
#include <stdio.h>
int main()
{
int v = 123;
int *p = &v;
printf("pointer %p (%d bytes) pointing to %d\n", p, (int)sizeof(p),
*p);
return 0;
}
C:\Work>gcc -Wall -m32 ptr.c -o ptr.exe
C:\Work>ptr
pointer 0028FEB8 (4 bytes) pointing to 123
C:\Work>gcc -Wall -m64 ptr.c -o ptr.exe
C:\Work>ptr
pointer 000000000022FE44 (8 bytes) pointing to 123
VMS - a single program running on a 64 bit CPU mixing
32 and 64 bit pointers:
$ type ptr.c
#include <stdio.h>
int main()
{
int v = 123;
#pragma pointer_size 32
int *p32 = &v;
#pragma pointer_size 64
int *p64 = &v;
printf("pointer %p (%d bytes) pointing to %d\n", p32,
(int)sizeof(p32), *p32);
printf("pointer %p (%d bytes) pointing to %d\n", p64,
(int)sizeof(p64), *p64);
return 0;
}
$ cc /pointer=32 ptr
$ link ptr
$ run ptr
pointer 7AE13A58 (4 bytes) pointing to 123
pointer 7AE13A58 (8 bytes) pointing to 123
Quite different.
Arne
More information about the Info-vax
mailing list