Reputation: 159
I would like to ask about something I am thinking to try with Visual Studio 2010.
I am generating an .asm file from the.cpp file by setting the option to the "Assembler Output" in the project properties --> C/C++ --> Output Files (/FAs).
My question is, how can I on a next step use that .asm generated file to link again from that one without using anymore the .cpp file, in case I want to do some modifications inside the .asm file and then link again by keeping the modifications I did at assembly level.
It would be very helpful if you could provide the exact steps, including the correct configuration may needed in the project properties.
Upvotes: 8
Views: 3626
Reputation: 5472
Simply drag the .obj files into the Project (Solution Explorer tree): How to include .obj files into the project
Upvotes: 1
Reputation: 33659
I did this recently. Here is a repeat of the answer I gave here compile-assembly-output-generated-by-vc. It turns out you can still do this in 32-bit mode in MSVC2012 but I think 64-bit mode is hopeless.
For 32-bit mode here is what you do.
Create an empty project and a source file Source.cpp
#include <stdio.h>
int main() {
printf("hello world\n");
return 0;
}
/GL
). This adds the line INCLUDELIB MSVCRT
/SAFESEH:NO
)I have used this for more complicated functions. I usually do it on a separate module and use extern "C"
on the function name to remove the C++ name mangling.
Upvotes: 1
Reputation: 530
Here is a tutorial http://www.cs.virginia.edu/~evans/cs216/guides/vsasm.html
Upvotes: 2