VisualStudio 编写汇编代码相关设置
Posted oasisyang
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了VisualStudio 编写汇编代码相关设置相关的知识,希望对你有一定的参考价值。
VS编写汇编代码方法
-
新建空项目,
不创建解决方案
-
项目右键,
Build Customizations
,选择masm
-
新建源文件,后缀为
.ASM
-
编写代码
.386 ; Tells MASM to use Intel 80386 instruction set. .model flat,stdcall ; Flat memory model option casemap:none ; Treat labels as case-sensitive include masm32includewindows.inc include masm32includekernel32.inc includelib masm32libkernel32.lib include masm32includeuser32.inc includelib masm32libuser32.lib .data ; Begin initialized data segment MsgBoxCaption db "Win32 Assembly Programming",0 MsgBoxText db "Hello World!!!Welcome to ASM Programming under CLR",0 .code ; Beginning of code start: ; Entry point of the code invoke MessageBox, NULL, addr MsgBoxText, addr MsgBoxCaption, MB_OK invoke ExitProcess, NULL end start
-
项目属性,
Linker
--->General
--->Additional Library Directories
--->添加masm32include
masm32lib
masm32macros
-
Linker
--->Input
--->Additional Dependencies
--->添加masm32.lib
-
Linker
--->General Manifest
--->NO
-
Linker
--->System
--->Windows
-
Linker
--->Advance
--->Entry Point
--->start
-
Microsoft Macro Assembly
--->Suppress Banner
--->Yes
-
Microsoft Macro Assembly
--->Include Paths
--->where masm32 located
-
Test and debug
以上是关于VisualStudio 编写汇编代码相关设置的主要内容,如果未能解决你的问题,请参考以下文章