How to Use MASM in Visual Studio 2022

wikiHow is a “wiki,” similar to Wikipedia, which means that many of our articles are co-written by multiple authors. To create this article, volunteer authors worked to edit and improve it over time.

This article has been viewed 41,638 times.

This tutorial allows you to use MASM which is an Assembly Language for x86 Processors. This is what your CPU interprets when you write a piece of code in a programming language like C++, Python, or Java and is translated by the compiler. Note: This tutorial only works for Windows devices and this guide uses Visual Studio Community edition, but you can use any edition of visual studio. If you already have Visual Studio installed, skip to the second part.

Part 1 of 3:

Installing Visual Studio 2022 Community Edition

Visual Studio Website.png

\nLicense: Creative Commons\n">

Navigate to the Visual Studio download website. Scroll down and click on download Visual Studio and from drop down menu, select the “Community 2022” option.

VS_Installer.png

Fair Use (screenshot)
\n">

Open the installer. Once you have downloaded the installer, click on the installer to open it. After the installer opens, it will ask you to pick what programming languages you want to install with Visual Studio and we will select “Desktop development with C++” and click on install.

Advertisement Part 2 of 3:

Setting up MASM in Visual Studio

Step 1 Create a new project.

Fair Use (screenshot)
\n">

Create a new project. After installing Visual Studio, open Visual Studio and create a new project, and from there select the Empty Project. After selecting an empty project, it will ask you for a project name. You may name it whatever you would like. Then click “Create.”

Step 2 Set up MASM.

Fair Use (screenshot)
\n">

Set up MASM. After you have created the project, go to the solution explorer on the left side and right-click on your project name, from the menu navigate to "Build Dependencies" -> Build Customizations. A small window will pop up from the window, check MASM, and hit “Ok.”

New_file_VS.png

Fair Use (screenshot)
\n">

Add a new file to the project. Right-click on Template and navigate to Add Item, New File. Select the C++ File from the window and on the bottom change the name from “Source.cpp” to “main.asm”

Build_Setting_Warning_VS.png

Fair Use (screenshot)
\n">

Copy and paste the template from the pastebin linked in the Things You'll Need section. You are advised to check that the build mode is set to x86 and not x64.

Done! The IDE is now set to build MASM. However, these steps will need to be followed every time you need to build in MASM so to make it easier, follow along in the third part of the tutorial which will show how to make a project template.

Advertisement Part 3 of 3:

Creating A Project Template for a Visual Studio Project

Step 1 Create the template.

Fair Use (screenshot)
\n">

Create the template. To create the template, go to Project on the top, and then from the drop down menu, select "Export Template." A window will pop and then hit next. it will then ask you for a template name, icon and description. Name it “Assembly Language Project” and hit "Finish."

Create_Project_VS.png

Fair Use (screenshot)
\n">

Create a new project. After creating the template, all that's needed to do build MASM is to create a new project in visual studio and search up the template name in the search bar.

Advertisement

Expert Q&A

Ask a Question 200 characters left Include your email address to get a message when this question is answered. Advertisement

Tips

Submit a Tip All tip submissions are carefully reviewed before being published Please provide your name and last initial Thanks for submitting a tip for review! Things You'll Need

You Might Also Like

Change Code on Schlage Lock

How to Change 4-Digit User Codes on Schlage Locks

Convert from Binary to Decimal

Converting Binary to Decimal: Positional Notation & Doubling

Format Text as Code in Discord

2 Simple Ways to Format Text Into Code on Discord

Reset Schlage Keypad Lock Without Programming Code

How to Factory Reset a Schlage Lock & Restore the Default Programming Code

Delay a Batch File

How to Delay a Batch File: Timeout, Pause, Ping, Choice & Sleep

Run a Program from the Command Line on Linux

Run a Program from the Command Line on Linux

Write Pseudocode

Learn to Write Pseudocode: What It Is and Why You Need It

Make an Exe File

Make an Exe File

Convert from Decimal to Hexadecimal

Convert from Decimal to Hexadecimal: A Quick Guide + Examples

<a href=Make a Program Using Notepad" width="342" height="184" />

Make a Program Using Notepad

View Source Code

How to View Source Code

Download a GitHub Folder

3 Ways to Download GitHub Directories and Repositories