[Info-vax] VAX Macro to C conversion

Stephen Hoffman seaohveh at hoffmanlabs.invalid
Sat Jul 13 00:30:10 EDT 2019


On 2019-06-25 16:09:32 +0000, John Reagan said:

> On Tuesday, June 25, 2019 at 10:32:13 AM UTC-4, Bill Gunshannon wrote:
>> 
>> Do any of the VMS C Compilers have the equivalent of -S in most Unix C 
>> Compilers?  I would love to see a few simple programs (starting with 
>> "Hello World") written in Macro, converted to C and then compiled with 
>> the option to list the assembler just to see how they compared.

The existing CC /SHOW=MACHINE_CODE support will provide a fair 
approximation of the request here, at least for the purposes of 
examining the generated code.

See pages 49 to 51 of the fine manual for details: 
https://vmssoftware.com/docs/VSI_OpenVMS_BaseOS/5492_c_users_gd.pdf

> Not currently.   LLVM provides that feature and our current internal 
> cross-compilers have a /SWITCH=ASSEMBLY qualifier that causes a ".s" 
> file to be written instead of an ".obj" file.  In theory, you should be 
> able to turn around and assemble that file (using the LLVM llvm-mc 
> tool) to get the identical ".obj" file.  I did that a few times in the 
> past month or so and it seemed to work.

There are all sorts of interesting back-ends available for LLVM too, 
and not the least of which is Emscripten.

> However, on OpenVMS, ANALYZE/OBJECT/DISASSEMBLE is the equivalent of 
> what objdump would give you on a Linux system.  (There is also an 
> llvm-objdump equivalent tool that we'll provide too).  That just gives 
> you the code but is lacking for static data initialization, etc.  You 
> have to get that from the Alpha or Itanium compiler listings.

Is there an ANALYZE/IMAGE/DISASSEMBLE planned, too?  objdump can 
provide that with ELF executable files on some platforms.  Otherwise 
we're porting libbfd or efitools or bintools.



ps: Bill: most of the places I've encountered that were or are still 
using Ratfor and the rest of FORTRAN 66-era FORTRAN "fun" are usually 
still using F66 constructs, and haven't migrated or haven't completed a 
migration forward to FORTRAN 77 and/or to Ratfiv (FORTRAN 77 era), or 
preferably to more recent Fortran constructs.  Migrating F66 and F77 
source code to the now ~thirty year old F90, or to the less-old F95, or 
preferably to Fortran-from-this-millennium if/when that's available can 
be a tedious slog, too.  But then I've occasionally misread the recent 
FF7-related reboot chatter as F77 chatter, too.  But then I re-read it 
and remember that FF7 is one of many things far more interesting than 
F77 and ~forty year old and oft-under-maintained FORTRAN code.


-- 
Pure Personal Opinion | HoffmanLabs LLC 




More information about the Info-vax mailing list