[Info-vax] VAX vs. MV/8000 [was Re: Hard links on VMS ODS5 disks]

terry-...@glaver.org terry-groups at glaver.org
Wed Aug 30 04:35:36 EDT 2023


On Monday, August 28, 2023 at 8:32:05 AM UTC-4, Johnny Billquist wrote:
> I've tried to stay out, and don't want to get too deep in. 
> But in a sense, my question/issue would be: Can you take a binary for 
> x86 and run it without any "mode bit", or anything else, on an x86-64 
> and it works? 

Sure:

(0:283) 165h:~terry% cat test.c
#include <stdio.h>
int main() {
   printf("Hello, cruel world...\n");
   return 0;
}
(0:284) 165h:~terry% cc -o test test.c
(0:285) 165h:~terry% file test
test: ELF 64-bit LSB executable, x86-64, version 1 (FreeBSD), dynamically linked, 
interpreter /libexec/ld-elf.so.1, for FreeBSD 13.2 (1302507), FreeBSD-style, with 
debug_info, not stripped
(0:286) 165h:~terry% ./test
Hello, cruel world...
(0:287) 165h:~terry% cc -o test -m32 -DCOMPAT_32BIT -L/usr/lib32 -B/usr/lib32 test.c
(0:288) 165h:~terry% file test
test: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), dynamically linked, 
interpreter /libexec/ld-elf.so.1, for FreeBSD 13.2 (1302507), FreeBSD-style, with 
debug_info, not stripped
(0:289) 165h:~terry% ./test                                                     
Hello, cruel world...

Yes, it also works for programs compiled before there was a 64-bit architecture:

(0:2) 165h:~/foo/stand% file sh
sh: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), statically linked, 
for FreeBSD 5.3, stripped
(0:3) 165h:~/foo/stand% ./sh
$ 

I have some 100K+ LoC monstrosities that are not 32-bit clean that I
still compile and run in 32-bit mode.

True, this is under an operating system and the OS relies on ELF Notes
in the executable to set up the appropriate 32-bit runtime. But since no
current x86 processor starts up in 64-bit mode (you have to set things
up and get there first) that seems fair.

> Oh, and with that said. The DG way was *horrible*. You had two different 
> stacks, a total of 7 registers to deal with the two stacks (don't even 
> ask), if I remember right even duplicates of similar instructions for if 
> you wanted to make use of the larger address space and registers. 
> It was *not* something I would want to throw on anyone. The VAX way was 
> much better, and that compatibility mode could be dropped, or shifter 
> over to software when it became less important, and leave the actual VAX 
> clean and nice (relatively speaking). 

There was very little new stuff being written in DG assembler by that
point - DG had switched to DG/L for operating system implementation
and all that were left were (presumably) some small routines to do stuff
that couldn't be implemented in DG/L. At least that's what I heard from
inside DG - RDOS and XBASIC didn't go in for any of that new-fangled
HLL stuff. 8-}

By the time DEC got to IA-64 (many years later, of course) pretty much 
the same was true for them - they just 'cheated' and made Macro-32
a compiler.

One extremely popular platform these days, Espressif's ESP-32, doesn't
even have a publicly-documented assembly language.



More information about the Info-vax mailing list