- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Does anybody know which MASM switches are required in order compile assembly listings?
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I found the answer to my question. I realize I had asked the same question several months ago and received an authoritative answer from a Compaq assembly language expert. Here is the answer that I had misplaced until now:
The Microsoft Macro Assembler (MASM) command line for properly assembling the asm listing files produced (optionally produced when compiling a CVF program) into .obj files is:
ML /I. /Zm /Cp /Fl /Sa filename.asm
The Microsoft Macro Assembler (MASM) command line for properly assembling the asm listing files produced (optionally produced when compiling a CVF program) into .obj files is:
ML /I. /Zm /Cp /Fl /Sa filename.asm
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Does anyone have a patch file which would add the opcodes employed by CVF with /arch=p6? The MASM which we have available is about 9 years old and requires me to run 486 instructions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well, Microsoft's Visual C++ 6.0 Processor Pack seems to claim that it contains a MASM with the latest processor instructions (assuming I can read between the lines of the MS documentation correctly - haven't tried it yet myself.)
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, after installing Visual Studio SP5 and the corresponding processor pack, changing the .486 to .686 in asmfile enables ML to assemble the p6 code. Required options appear to be:
ML -Zi -c -coff -Zm ...
-Zi enables Vtune to display the .asm source.
ML -Zi -c -coff -Zm ...
-Zi enables Vtune to display the .asm source.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I noticed a few things since I started this thread. First off, the version of MASM discussed above is 6.15. Also, it may be that those MASM options required to replicate the object file from an asm listing that was produced by a CVF compile-link of Fortran source code differ from the options a user would use in writing an assembly program from scratch. Another MASM switch that may be important is -Zp4 (to align structures along 4-byte boundaries). Also, one of the reasons I wanted to re-assemble an asm listing was to generate timings for each assembly instruction (not given in the CVF asm listings); this requires the -Sc switch.
So here is what I think should be a good set of switches to compile assembly language code into an CVF-compatible object file (especially if you are trying to get an insight into exactly how your Fortran code compiled from the CVF asm listing):
ML.EXE -I. -Zm -Cp -Fl -Sa -Sc -coff -Zp4 -c asmlistingfile.asm
One more thing, even with older assembler versions one can always embed the newer processor instructions by directly embedding op codes using the "DB" (define byte command). For example to encode a CPUID instruction insert the two lines: "db 0fh" then "db 0a2h" (see Intel documentation AP-485 on this particular example and on the CPUID instruction in general).
So here is what I think should be a good set of switches to compile assembly language code into an CVF-compatible object file (especially if you are trying to get an insight into exactly how your Fortran code compiled from the CVF asm listing):
ML.EXE -I. -Zm -Cp -Fl -Sa -Sc -coff -Zp4 -c asmlistingfile.asm
One more thing, even with older assembler versions one can always embed the newer processor instructions by directly embedding op codes using the "DB" (define byte command). For example to encode a CPUID instruction insert the two lines: "db 0fh" then "db 0a2h" (see Intel documentation AP-485 on this particular example and on the CPUID instruction in general).
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page