How to insert an assembly file to a project in the VC Environment

Source: Internet
Author: User
In the Visual C ++ project, add the. ASM file as required by MASM. In Solution Explorer, right-click the file and select the "properties" menu item. In the "properties" dialog box, click "Custom generation step" to set the following items:

Command Line: ml.exe/nologo/C/coff "-fo $ (intdir)/$ (inputname). OBJ" "$ (inputpath )"
Output: $ (intdir)/$ (inputname). OBJ

To generate debugging information, you can add the "/Zi" parameter to the command line, and generate. lst and. SBR files as needed.

If you want to call Windows API in an assembly file, you can download the masm32 package from the Internet (including the MASM Assembly Tool, a very complete Windows API header file/library file, a practical macro, and a large number of Win32 Assembly examples ). Correspondingly, the "/I X:/masm32/include" parameter should be added to the command line to specify the path of the Windows API Assembly header file (. Inc. Masm32 home page is: http://www.masm32.com, which can download the latest version of the masm32 package.
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.