Getting Started with MASM and Visual Studio

  • Installing masm32 SDK and Irvine

Click here to get masm32. After install masm32 SDK, the files are stored into C:\masm32 folder. 

Click this link to get the latest copy of the book's link libraries and example programs. The examples are stored in a Microsoft Install (.MSI) file that installs into the c:\Irvine folder. Unless you have some objection to using that location, do not alter the path. (Note to lab administrators: you can designate c:\Irvine directory as read-only.) If you plan to change the installation location, read our instructions relating to Creating a Project from Scratch.

The folllowing files will be copied into the c:\Irvine directory:

FilenameDescription
b16.asm, b32.asmBlank templates for 16-bit and 32-bit assembly language source files
GraphWin.incInclude file for writing Windows applications
Irvine16.incInclude file used with the Irvine16 link library (16-bit applications)
Irvine16.lib16-bit link function library used with this book
Irvine32.incInclude file used with the Irvine32 link library (32-bit applications)
Irvine32.libIrvine's 32-bit link library
Irvine64.objIrvine's 64-bit library
Kernel32.lib32-bit link library for Windows API
Link16.exe16-bit Microsoft linker
Macros.incIrvine's macro include file (see Chapter 10)
make16_vs2012.batVisual Studio 2012 batch file for building 16-bit applications
make16_vs2013.batVisual Studio 2013 batch file for building 16-bit applications
SmallWin.incSmall-sized include file containing MS-Windows definitions, used by Irvine32.inc
User32.libMS-Windows basic I/O link library
VirtualKeys.incKeyboard code definitions file, used by Irvine32.inc

A subdirectory named Examples will contain all the example programs shown in the book, source code for the book's 16-, 32-, and 64-bit libraries, and two sample projects for earlier versions of Visual Studio.

  • Include Paths

Right-click the project name in the Solution Explorer window and select Properties from the popup menu. Expand the entry under Configuration Properties. Then expand the entry named Microsoft Macro Assembler. This is what you should see:

Modify the Include Paths option so it equals "C:\Irvine C:\masm32\include". 

 

 

Next, select the Listing File entry, also in the Microsoft Macro Assembler group. Modify the Assembled Code Listing File entry (shown below) so it contains $(ProjectName).lst. This uses a built-in variable to identify the name of the source input file, with a file extension of .lst. So, if your project were named MyProject, the listing file would be named MyProject.lst:

 

  • Add Irvine32.lib in the Additional Dependiencies;

Find the Linker entry under Configuration Properties. Select the Input entry in the left panel and insertirvine32.lib; at the beginning of the Additional Dependencies entry. The irvine32.lib file is the link library file supplied with this book. The filenames must be separated by semicolons.

 

Select Linker under Configuration Properties, and then select General. The Additional Library Directories entry must contain c:\Irvine so the linker can find the Irvine32.lib library file:

Select Linker under the Configuration Properties and select Debugging. Verify that the Generate Debug Info option is equal to Yes(/DEBUG)

Select Advanced under the Linker entry. Set the Image Has Safe Exception Handlers option to No.

Click the OK button to close the Property Pages window. Verify that your project has been created correctly by building and debugging the program as you did in an earlier tutorial.

转载于:https://www.cnblogs.com/dreamafar/p/5978006.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Visual Studio 2022支持使用MASM(Microsoft Macro Assembler)进行x64汇编开发。下面是一些关于在Visual Studio 2022中使用MASM x64汇编的基本步骤: 1. 安装Visual Studio 2022:首先,确保你已经安装了最新版本的Visual Studio 2022。你可以从官方网站下载并安装Visual Studio 2022。 2. 创建一个新的空白项目:打开Visual Studio 2022,创建一个新的空白项目。选择合适的语言和平台(如C++和Windows),然后点击“下一步”。 3. 添加汇编源文件:在解决方案资源管理器中,右键单击项目,选择“添加” -> “新建项”。在弹出的对话框中,选择“汇编源文件”并命名它。这将为你创建一个以.asm为扩展名的汇编源文件。 4. 配置项目属性:右键单击项目,选择“属性”。在属性页中,选择“配置属性” -> “常规”。确保“字符集”设置为“使用多字节字符集”。 5. 编写汇编代码:打开汇编源文件,并开始编写你的x64汇编代码。使用MASM语法编写代码,并确保按照正确的指令格式和语义进行编写。 6. 构建和运行:保存汇编源文件后,按下F7键或选择“生成” -> “生成解决方案”来构建项目。如果没有编译错误,你可以运行生成的可执行文件来执行你的汇编代码。 这只是一个简单的指南,帮助你入门使用MASM x64汇编语言在Visual Studio 2022中进行开发。你可以查阅更多的文档和教程来深入了解和扩展你的汇编开发经验。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值