Skip to content

Masm in Visual Studio 2022

Follow these steps to set up a 64bit assembly language project in Visual Studio 2022

  • Create a new Empty Project using the C++, Windows Console template
  • Delete Header Files
  • Delete Resource Files
  • Delete Source Files
  • Enable MASM Support
    • Right click on Project Name
    • Click Build Dependencies
    • Click Build Customisations
    • Click Masm(.targets, .props)
  • Add new file ( lets call it main .asm )
    • Right click on Project Name
    • Click Add
    • Click New Item
    • Rename file to main.asm
    • Right click on main.asm
    • Click General
    • Change ‘Item Type’ to Microsoft Macro Assembler
  • Setup the linker
    • Right click on Project Name
    • Click Properties
    • Click (expand) Linker
    • Click Advanced
    • Fill in ‘Entry Point’ with name of entry function, e.g ‘main’

Smallest 64bit Assembly Program


.CODE
main PROC
	xor rax, rax
	ret
main ENDP
END

Leave a Reply

Your email address will not be published. Required fields are marked *