[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::c_plus_plus

Title:C++
Notice:Read 1.* and use keywords (e.g. SHOW KEY/FULL KIT_CXX_VAX_VMS)
Moderator:DECCXX::AMARTIN
Created:Fri Nov 06 1987
Last Modified:Thu Jun 05 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:3604
Total number of notes:18242

3488.0. "Producing assembly language (MACRO-32) output file?" by VAXCPU::michaud (Jeff Michaud - ObjectBroker) Wed Mar 12 1997 16:28

	I'm having trouble using the /LIST/MACHINE qualifiers to CXX.
	I get a .LIS file that contains the C++ source lines, the Command
	Line, but no assembly (MACRO-32) code for variables or constants.
	For example:

int foo = 5;
const int bar = 9;

	produces no assembly code listing in the .LIS file.  Only for
	functions does it ever appear to generate a listing for.  This
	is with "DEC C++ V5.0-003 on OpenVMS VAX V6.1".

	What I really want is not a .LIS file, but a separate assembly
	language source (MACRO-32, ala .MAR) file.  The Digital UNIX
	version supports this (with the -S option).
T.RTitleUserPersonal
Name
DateLines
3488.1Non-goalDECCXX::AMARTINAlan H. MartinWed Mar 12 1997 16:469
We've been through this before (although I can't find the reference).  This has
never been a goal of /MACHINE_CODE on the VAX.

In the past 5 years, we haven't even been able to implement the symbol table
listing from VAX C.  We're certainly not going to dive into the VCG at this late
date to try and generate perfect assembly language files.

Sorry, but you'll have to use $ ANALYZE/OBJECT to get the information you want.
				/AHM
3488.2VAXCPU::michaudJeff Michaud - ObjectBrokerWed Mar 12 1997 17:1624
> We've been through this before (although I can't find the reference).

	I did do a [case-insensitive] topic title search for assemb,
	machine and macro, and came up with unrelated matches (I can't
	get a list of keywords to do a keyword search using the NOTES
	client I'm using).

> This has never been a goal of /MACHINE_CODE on the VAX.

	if it's not in the .HLP in the current version, maybe
	the online HELP for /MACHINE_CODE should list the
	restrictions (ie. it's an incomplete macro listing).

	From my understanding the backend doesn't create an .OBJ file
	directly, but creates MACRO-32 code that it passes to the MACRO
	assembler.  If so, it should be easy to simply not delete the
	temporary file if a /ASSEMBLY_CODE qualifier is given (and of
	course name or rename the temporary file appropriately).

> Sorry, but you'll have to use $ ANALYZE/OBJECT to get the information you want

	How do you use ANALYZE/OBJECT to generate a .MAR file? :-)

	Is there a disassembler on VAX/VMS?
3488.3We always compile without assemblingWIBBIN::NOYCEPulling weeds, pickin' stonesWed Mar 12 1997 17:476
>	From my understanding the backend doesn't create an .OBJ file
>	directly, but creates MACRO-32 code that it passes to the MACRO
>	assembler.

This has never been true for any Digital-developed compilers on VMS, and
is not true for current Digital-developed compilers on UNIX either.
3488.4Works (I think) with DEC C++ V5.5-002 on OpenVMSDECC::SULLIVANJeff SullivanWed Mar 12 1997 18:0530
I don't think that there is an equivalent to -S on VMS, but I was able to
generate the following on AlphaVMS using DEC C V5.5-002.

              1 int foo = 5;
              2 const int bar = 9;


                                .PSECT  FOO, OCTA, NOPIC, OVR, REL, GBL, NOSHR,-
                                        NOEXE, RD, WRT
                        FOO:
00000005     0000               .LONG   5
                                .BYTE   0 [12]

                                .PSECT  BAR, OCTA, NOPIC, OVR, REL, GBL, NOSHR,-
                                        NOEXE, RD, NOWRT
                        BAR:
00000009     0000               .LONG   9
                                .BYTE   0 [12]

Command Line
------- ----

CC/LIS/MACH T.C


Is that what you are looking for?

-Jeff


3488.5Rationalization; abuse; pointersDECCXX::AMARTINAlan H. MartinWed Mar 12 1997 18:2435
Re .2:

>> This has never been a goal of /MACHINE_CODE on the VAX.
>
>	if it's not in the .HLP in the current version, maybe
>	the online HELP for /MACHINE_CODE should list the
>	restrictions (ie. it's an incomplete macro listing).

Seems clear to me - after all, the switch isn't called ``/MACHINE_DATA''.

On the other hand, if like other people I know, you've been invoking the
compiler as:

$ CXX MYPROG/LIST/MACHO

then I can understand the confusion.


>>Sorry, but you'll have to use $ ANALYZE/OBJECT to get the information you want
>
>	How do you use ANALYZE/OBJECT to generate a .MAR file? :-)

Pipe it through a sed filter?


>	Is there a disassembler on VAX/VMS?

That's a very good question.  I see no mention in the [Open]VMS FAQ, but the
advanced AltaVista query ``disassem* near vax'' reveals something called DISM32
available from DECUS.  I didn't look to see if other VAX disassemblers exist.

The AltaVista Notes query ``dism32'' hints that it is available from the
Toolshed, etc.
				Hope this helps,
				/AHM
3488.6VAXCPU::michaudJeff Michaud - ObjectBrokerWed Mar 12 1997 18:287
> I don't think that there is an equivalent to -S on VMS, but I was able to
> generate the following on AlphaVMS using DEC C V5.5-002.
> CC/LIS/MACH T.C
> Is that what you are looking for?

	Not quite :-)  I was looking for C++ and on VAX specifically.
	Thanks anyways however  /jeff
3488.7VAXCPU::michaudJeff Michaud - ObjectBrokerWed Mar 12 1997 18:4040
>>> This has never been a goal of /MACHINE_CODE on the VAX.
>>	if it's not in the .HLP in the current version, maybe
>>	the online HELP for /MACHINE_CODE should list the
>>	restrictions (ie. it's an incomplete macro listing).
> Seems clear to me - after all, the switch isn't called ``/MACHINE_DATA''.

	You are joking I hope?  "Machine code listing" has always meant
	either an assembly code listing or machine code dump (in hex, octal,
	etc), it has never meant, at least in what I've come across in my
	prior 18 years of computing, til now, to only mean "machine
	instructions" only and not data.

> On the other hand, if like other people I know, you've been invoking the
> compiler as:
> $ CXX MYPROG/LIST/MACHO
> then I can understand the confusion.

	?????  actually I tried both:

		$ cxx foo.cxx/list/machine

	and for yuks:

		$ cxx/list/machine foo.cxx

	but the results were the same.

>>>Sorry, but you'll have to use $ ANALYZE/OBJECT to get the information you want
>>	How do you use ANALYZE/OBJECT to generate a .MAR file? :-)
> Pipe it through a sed filter?

	Now I know you've been pulling my leg!

>>	Is there a disassembler on VAX/VMS?
> advanced AltaVista query ``disassem* near vax'' reveals something called DISM32
> available from DECUS....
> Hope this helps,

	I was really looking for a Digital supported one, but thanks
	for checking, in the end I may need to use even an unsupported one.
3488.8ClarificationsDECCXX::AMARTINAlan H. MartinWed Mar 12 1997 18:5726
Re .7:

>> Seems clear to me - after all, the switch isn't called ``/MACHINE_DATA''.
>
>	You are joking I hope?  ...

That would be telling.


>> On the other hand, if like other people I know, you've been invoking the
>> compiler as:
>> $ CXX MYPROG/LIST/MACHO
>> then I can understand the confusion.
>
>	?????  actually I tried both:
>
>		$ cxx foo.cxx/list/machine
>
>	and for yuks:
>
>		$ cxx/list/machine foo.cxx
>
>	but the results were the same.

I was referring to the spelling of the switches, not their order.
				/AHM
3488.9VAXCPU::michaudJeff Michaud - ObjectBrokerWed Mar 12 1997 20:059
>>> On the other hand, if like other people I know, you've been invoking the
>>> compiler as:
>>> $ CXX MYPROG/LIST/MACHO
>>> then I can understand the confusion.
>> .....
> I was referring to the spelling of the switches, not their order.

	Ah, sorry I missed such an obvious joke!  I thought the typo
	was accidental!