Assemblying and Executing the Program


The following steps show how to use Microsoft MASM assembler for Intel CPUs. The symbol * means the step is for the first-time use only.
  1. *Download and install Visual C++ 2005 Express Edition and Visual C++ 2008 Express Edition.

  2. *Download and install Microsoft MASM 8.0.

  3. *Download some Example Programs.

  4. Start the Visual C++ 2008 Express: Select from the Start menu of Windows:
       Start  All Programs  Visual C++ 2008 Express Edition
        Microsoft Visual C++ 2008 Express Edition
  1. *Set Tab size to 5: Select the following options from the Visual C++ 2008 Express:
       Tools  Options  Text Editor  All Languages  Tabs
    and set the Tab size and Indent size to 5.

  1. Build and execute an assembly-language program.

    1. Copy the folder C:\Irvine\Examples\Project_Sample to another folder such as C:\532\exercise\1.

    2. Select the options of Visual C++ 2008 Express:
         File  Open  Project/Solution...
    3. Open a project such as C:\532\exercise\1\.

    4. In the Solution Explorer window, click the mouse next to the item named Project to expand it. Double-click the file named main.asm to open it in the Editor window. Use this program, a template, as a starting point to write your own programs.

    5. Select Build Solution from the Build menu of Visual C++ 2008 Express. In the Output window at the bottom of the Visual C++ Express, you should see the messages indicating the build progress such as:
         1>------ Rebuild All started: Project: Project, Configuration: Debug Win32 ------
         1>Deleting intermediate and output files for project 'Project', configuration 'Debug|Win32'
         1>Assembling...
         1> Assembling: .\main.asm
         1>Linking...
         1>Embedding manifest...
         1>Build log was saved at "file://c:\532\exercise\1\Debug\BuildLog.htm"
         1>Project - 0 error(s), 0 warning(s)
         ========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
    6. Select Start Without Debugging from the Debug menu. The console window should appear such as:


      The “Press any key to continue...” message is automatically generated by Visual C++ Express. Press any key to close the console window.