I searched and found I can not use __asm
in x64 in visual studio. Instead I have to use an external assembly file.
How can I add external assembly file to my win32 console project?
How can compile them?
Can you explain step by step.
I searched and found I can not use __asm
in x64 in visual studio. Instead I have to use an external assembly file.
How can I add external assembly file to my win32 console project?
How can compile them?
Can you explain step by step.
How to build a mixed-source x64-project with a x64 assembly file in Visual Studio:
1) Start Visual Studio (Community) 2015 and choose
FILE - New - Project
.2) In the next window choose
Win 32 Console Application
.3) You get a confirmation. Click on
Next >
.4) In the next window you can accept the default settings. Click on
Finish
.5) Make sure, that the project is highlighted in the Solution Explorer and and choose
PROJECT - Build Customizations...
from the menu.6) In the next window tick
masm(.targets,.props)
and click onOK
.7) Choose
Build - Configuration Manager...
8) Change the
Active solution platform
to x649) Create callee.asm:
PROJECT - Add New Item
.10) In the next window choose
C++File(.cpp)
and - IMPORTANT! - give it a name with an.asm
extension. Click onAdd
.10) Now check if the
.asm
file has the right properties. In the Solution Explorer right-click on the file and chooseProperties
.11) In the Property Page you should see at least:
Under
Command Line
ensure thatml64.exe
is chosen as the assembler.Click on
OK
.12) Now you can fill the files with content.
ConsoleApplication1.cpp:
callee.asm:
13) Build the .exe
and run it with CTRL-F5.
The application will be opened in a new window.