Re: Assembling Visual Studio generated listing files
- From: Geoff <geoff@xxxxxxxxxxxxxxx>
- Date: Sun, 09 Dec 2007 03:19:00 -0800
On Sat, 8 Dec 2007 22:55:16 -0800 (PST), TahoeKid <rfdunn@xxxxxxxxxxx>
wrote:
I'm using VS 2005 and MASM 8.0.
I generated a .asm listing from a simple C++ program and the assembler
choked on it.
It would have been nice if you had something a little more precise
than 'it choked on it'.
Lacking that, here it is as simple as I can explain a step by step way
of testing asm output. If this doesn't work for you then I don't know
what you are doing wrong.
Using VC 2005 EE and MASM 8.00.50727.104.
Create simple console app, like a Hello World:
#include "stdafx.h"
#include <stdio.h>
int _tmain(int argc, _TCHAR* argv[])
{
printf("Hello World.\n");
return 0;
}
Set project to create ASM file, alt-f7, Output Files, Assembly With
Source Code (/FAs). Do this for all Win32 configurations.
MASM setup in IDE:
Title: MASM 8.0
Command: C:\Program Files\Microsoft Visual Studio 8\VC\bin\ml.exe
Arguments: /Cp /c $(ItemPath)
Initial directory: $(targetdir)
Use output window: yes
Build project for debug and release builds.
Open the generated asm file in IDE from debug folder. With the focus
on the open .ASM document in the IDE, click Tools|MASM 8.0
Masm runs and chokes with syntax errors on line 25 and 29 in the debug
version of the asm output. These are the initializations of the
runtime check segments:
\Debug\simple_console.asm(25) : error A2008: syntax error : .
\Debug\simple_console.asm(29) : error A2008: syntax error : .
Microsoft (R) Macro Assembler Version 8.00.50727.104
MASM doesn't like this stuff:
rtc$TMZ SEGMENT
__RTC_Shutdown.rtc$TMZ DD FLAT:__RTC_Shutdown <------------ A2008
rtc$TMZ ENDS
; COMDAT rtc$IMZ
rtc$IMZ SEGMENT
__RTC_InitBase.rtc$IMZ DD FLAT:__RTC_InitBase <------------ A2008
; Function compile flags: /Odtp /RTCsu /ZI
rtc$IMZ ENDS
Open the generated asm file in IDE from release folder.
MASM works fine on Release build version of the asm output.
If you do this in the IDE, it's very important that the ASM file has
the focus when you launch the MASM tool or MASM will attempt to
assemble the wrong file.
Again, it is strictly not necessary to use MASM in any way with the
VC++ compiler since the objects are generated and linked by the
compiler and linker, never masm. The only time you ever really need
MASM is for driver development and then you should not be using
compiler output but you should be writing your own ASM source files
and adding them to the project for processing by masm as part of the
build cycle, not by this method. I do not have a solution for getting
MASM 8.x to understand the error lines above since they are part of
the IDE and the CRT runtime checks in the debugger and MASM is
operating as an external tool.
.
- Follow-Ups:
- Re: Assembling Visual Studio generated listing files
- From: Joseph M . Newcomer
- Re: Assembling Visual Studio generated listing files
- References:
- Assembling Visual Studio generated listing files
- From: TahoeKid
- Re: Assembling Visual Studio generated listing files
- From: Geoff
- Re: Assembling Visual Studio generated listing files
- From: Joseph M . Newcomer
- Re: Assembling Visual Studio generated listing files
- From: TahoeKid
- Re: Assembling Visual Studio generated listing files
- From: Geoff
- Re: Assembling Visual Studio generated listing files
- From: TahoeKid
- Assembling Visual Studio generated listing files
- Prev by Date: Re: Assembling Visual Studio generated listing files
- Next by Date: Re: Wizard in MFC !! (How do I design one?)
- Previous by thread: Re: Assembling Visual Studio generated listing files
- Next by thread: Re: Assembling Visual Studio generated listing files
- Index(es):
Relevant Pages
|