Setting up Visual Studio 2019 for Assembly MASM

Dr. Nina Javaher
10 Sept 202007:33

Summary

TLDRThis video tutorial guides viewers through setting up Visual Studio 2019 for assembly programming using MASM. It covers creating an empty project, adding an ASM file, configuring build customizations, and enabling Microsoft Macro Assembler. The instructor demonstrates a simple program that adds two 32-bit integers and provides a step-by-step walkthrough of using the debugger, including setting breakpoints, inspecting registers, memory, and watch windows. By the end of the session, viewers gain practical knowledge on setting up the assembly environment and effectively using Visual Studio's debugging tools to monitor program execution and variable values.

Takeaways

  • 🖥️ Visual Studio 2019 can be configured to work with MASM (Microsoft Macro Assembler) for assembly programming.
  • 📁 Start by creating an Empty Project and remove unnecessary default files and folders.
  • ➕ Add a new ASM file (e.g., masm_test.asm) ensuring ASM and C++ file type is selected and Visual C++ is highlighted.
  • ⚙️ Enable MASM in build settings via Build Dependencies → Build Customization → select MASM.
  • 📝 Configure the project properties under Microsoft Macro Assembler and apply changes to complete setup.
  • 💾 A simple assembly program can add two 32-bit integers using registers like EAX and storing the result in a variable.
  • 🐞 Running the program without a breakpoint provides limited visibility into the program's behavior.
  • ⏸️ Adding a breakpoint allows you to step through instructions and monitor registers and memory in the debugger.
  • 👀 Use Debug → Windows → Registers, Memory, and Watch to inspect variable values and program state.
  • 🔢 Adjust memory display to match data type (e.g., 4 bytes for 32-bit integers, signed display for decimal values).
  • 📊 The Watch window allows dynamic tracking of variables like 'sum' to monitor their values throughout execution.
  • ✅ The video demonstrates both setup and basic debugging, but does not cover advanced assembly programming concepts.

Q & A

  • What is the first step to setting up MASM in Visual Studio?

    -The first step is to open Visual Studio, then click on 'Create New Project', select 'Empty Project', and click 'Create'.

  • Why is it necessary to delete the default folders in the project?

    -The default folders are not needed for the MASM setup and can be deleted to keep the project environment clean and focused on the assembly programming.

  • What file type should be selected when adding the assembly file to the project?

    -When adding the assembly file, ensure that 'ASM and C++ File' is selected, and that 'Visual C++' is highlighted.

  • How do you enable MASM build customization in Visual Studio?

    -To enable MASM build customization, right-click on the project, go to 'Build Dependencies', then click on 'Build Customization' and select 'MASM'.

  • What is the purpose of the line 'mov eax, 7' in the assembly code?

    -The line 'mov eax, 7' moves the value 7 into the EAX register, which is the starting value for the addition operation.

  • How can you set a breakpoint in Visual Studio for debugging the assembly code?

    -To set a breakpoint, click on the left margin next to the line of code where you want to pause execution (e.g., line 15 with 'mov eax, 7').

  • What is the significance of using the 'Watch Window' in debugging?

    -The 'Watch Window' allows you to monitor the value of specific variables or memory locations while stepping through the code, helping track changes in real time.

  • What is the purpose of changing the memory display from hexadecimal to signed integer?

    -Changing the memory display from hexadecimal to signed integer helps to easily interpret the value in human-readable form (e.g., 11 instead of 0xB).

  • How can you inspect the state of the registers during debugging?

    -To inspect the registers, go to 'Debug' → 'Windows' → 'Registers'. This will show you the values stored in the CPU registers during execution.

  • Why is it important to use the debugger when working with assembly language?

    -Using the debugger is important because it allows you to step through the code, observe changes in registers and memory, and ensure the program works as expected.

Outlines

plate

Esta sección está disponible solo para usuarios con suscripción. Por favor, mejora tu plan para acceder a esta parte.

Mejorar ahora

Mindmap

plate

Esta sección está disponible solo para usuarios con suscripción. Por favor, mejora tu plan para acceder a esta parte.

Mejorar ahora

Keywords

plate

Esta sección está disponible solo para usuarios con suscripción. Por favor, mejora tu plan para acceder a esta parte.

Mejorar ahora

Highlights

plate

Esta sección está disponible solo para usuarios con suscripción. Por favor, mejora tu plan para acceder a esta parte.

Mejorar ahora

Transcripts

plate

Esta sección está disponible solo para usuarios con suscripción. Por favor, mejora tu plan para acceder a esta parte.

Mejorar ahora
Rate This

5.0 / 5 (0 votes)

Etiquetas Relacionadas
Visual StudioMASMAssembly LanguageDebuggingProgramming TutorialBeginner GuideCode SetupRegistersMemory WatchStep-by-Step
¿Necesitas un resumen en inglés?