2024年5月5日发(作者:)

Assembly Language For Intel-Based Computers, 5/e

Updated 8/30/2008, for Visual Studio 2008

If you've recently purchased Assembly Language for Intel-Based Computers, 5th edition, you

probably want to get the software set up so you can start working. This tutorial should make the process

easier. If you're in a hurry to get started, you only need to read Item 1.

1. Required setup for 32-bit applications

2. Building 16-bit applications (Chapters 12-16)

3. Project properties settings

4. Creating a project from scratch

5. Generating a source listing file

6. Using the Visual Studio 2005 debugger

7. MASM syntax highlighting

8. Assembling, linking, and debugging with a batch file

Found an error in this document? Please email me immediately. Except where noted, all instructions in

this document apply equally to Visual Studio 2008 and Visual C++ 2008 Express.

Required Setup for 32-bit Applications

If you are using Visual Studio 2008 Professional or Team Suite, these products already contain the

Microsoft Assembler 9.0. You can skip Steps 1 and 2 and go directly to Step 3. Also, Visual C++ 2008

Express edition Service Pack 1 includes the Visual C++ 2008 Feature Pack, which includes MASM

9.0. (The initial edition of VC++ 2008 express did not.)

Step 1: Install Visual C++ 2005 Express Edition, Service Pack 1

Click here to download Visual C++ 2005 Express from Microsoft. When you run the Visual C++ setup

program, make a note of the location where the C++ compiler is installed. This information will be useful

to you later.

Step 2: Download and Install the Microsoft Assembler

Visit Microsoft's MASM 8.0 download site. Follow the download and installation instructions on the

Microsoft page. If the link is broken, please let us know by email. Note that this MASM download only

works with Visual C++ 2005 Express. MASM 8.0, by the way, is functionally identical to MASM 9.0.

Step 3: Install the Book's Example Programs

Click this linkis link to get the latest copy of the book's link libraries and example programs. The

examples are stored in a self-extracting archive file that automatically extracts to the c:Irvine folder.

Unless you have some objection to using that location, do not alter the path. (Lab managers: you can

designate c:Irvine directory as read-only.) If you plan to change the installation location, read our

instructions relating to changing project properties.

The folllowing files will be copied into the c:Irvine directory:

file:///E|/个人部分文档/Intel汇编程序设计IDE搭建/Assembly Language For Intel-Based Computers, (第 1/26 页)2008-9-19 17:04:33

Assembly Language For Intel-Based Computers, 5/e

Filename

Description

Include file for writing Windows applications

Include file used with the Irvine16 link library (16-bit applications)

16-bit link function library used with this book

Include file used with the Irvine32 link library (32-bit applications)

16-bit linker

32-bit link function library used with this book

Include file containing macros (explained in Chapter 10)

Small-sized include file, used by

Batch file for building 16-bit applications

board code definitions file, used by

A subdirectory named Examples will contain all the example programs shown in the book.

Step 4: Building a Sample Assembly Language Program

Preliminary Step: Set Tab Size to 5

Start Visual C++ Express, and select Options from the Tools menu. Select Text Editor, Select All

Languages, and select Tabs:

Set the Tab Size and Indent Size to 5.

Opening a Project

Visual Studio and Visual C++ Express require assembly language source files to belong to a project,

which is a kind of container. A project holds configuration information such as the locations of the

assembler, linker, and required libraries. A project has its own folder, and it holds the names and

locations of all files belonging to it. We have created a sample project folder in the c:IrvineExamples

directory, and its name is Project_Sample.

Do the following steps, in order:

1. Start Visual Studio or Visual C++ Express.

2. If you're using Visual Studio, select Open Project from the File menu. Or, if you're using Visual C+

+ Express, select Open, and select Project/Solution.

3. Navigate to the c:IrvineExamplesProject_Sample folder and open the file named Project.

file:///E|/个人部分文档/Intel汇编程序设计IDE搭建/Assembly Language For Intel-Based Computers, (第 2/26 页)2008-9-19 17:04:33