码迷,mamicode.com
首页 > 其他好文 > 详细

VisualStudio 编写汇编代码相关设置

时间:2020-06-24 23:53:29      阅读:121      评论:0      收藏:0      [点我收藏+]

标签:none   ddr   point   ram   方案   int   汇编   bug   enc   

VS编写汇编代码方法

  1. 新建空项目,不创建解决方案

  2. 项目右键,Build Customizations,选择masm

  3. 新建源文件,后缀为.ASM

  4. 编写代码

    .386                            ; Tells MASM to use Intel 80386 instruction set.
    
    .model flat,stdcall             ; Flat memory model
    
    option casemap:none             ; Treat labels as case-sensitive
    
    include    \masm32\include\windows.inc
    include    \masm32\include\kernel32.inc
    includelib    \masm32\lib\kernel32.lib
    
    include    \masm32\include\user32.inc
    includelib    \masm32\lib\user32.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
    
  5. 项目属性,Linker--->General--->Additional Library Directories--->添加masm32\include masm32\lib masm32\macros

  6. Linker--->Input--->Additional Dependencies--->添加masm32.lib

  7. Linker--->General Manifest--->NO

  8. Linker--->System--->Windows

  9. Linker--->Advance--->Entry Point--->start

  10. Microsoft Macro Assembly--->Suppress Banner--->Yes

  11. Microsoft Macro Assembly---> Include Paths--->where masm32 located

  12. Test and debug

VisualStudio 编写汇编代码相关设置

标签:none   ddr   point   ram   方案   int   汇编   bug   enc   

原文地址:https://www.cnblogs.com/oasisyang/p/13190342.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!