Visual C++ Optimization with Assembly Code

Visual C++ Optimization with Assembly Code

by Yury Magda

Paperback

$39.95

Overview

Describing how the Assembly language can be used to develop highly effective C++ applications, this guide covers the development of 32-bit applications for Windows. Areas of focus include optimizing high-level logical structures, creating effective mathematical algorithms, and working with strings and arrays. Code optimization is considered for the Intel platform, taking into account features of the latest models of Intel Pentium processors and how using Assembly code in C++ applications can improve application processing. The use of an assembler to optimize C++ applications is examined in two ways, by developing and compiling Assembly modules that can be linked with the main program written in C++ and using the built-in assembler. Microsoft Visual C++ .Net 2003 is explored as a programming tool, and both the MASM 6.14 and IA-32 assembler compilers, which are used to compile source modules, are considered.

Product Details

ISBN-13: 9781931769327
Publisher: A-List, LLC
Publication date: 05/28/2004
Pages: 400
Product dimensions: 7.42(w) x 9.24(h) x 0.97(d)

About the Author

Yury Magda has developed data-processing systems and designed applications used to improve the performance of C++ and Delphi programs with Assembly code. He has written articles for Circuit Cellar and Electronic Design.

Table of Contents

Prefaceix
Introduction1
Optimization Methods3
Chapter 1Developing Efficient Program Code15
Optimization Potentials15
Two Approaches to Using Assembly Language16
Main Optimization Points17
Loops and Conditional Jumps17
Mathematical Calculations18
Processor-Level Optimization (Using the SIMD Technologies)18
Optimizing High-Level Language Applications20
Optimizing Loop Calculations21
Decrementing the Loop Counter21
Unrolling the Loop22
Optimizing Conditional Jumps30
Eliminating Conditional Jumps30
Optimizing Program Branching34
Optimizing Unconditional Jumps and Function Calls35
Reducing Unconditional Jumps and Branches35
Avoiding Double Returns36
Repeating the Code Fragment39
Replacing Loop Commands by Jumps and Comparisons42
Using String Commands for Data Transfer43
Optimizing Mathematical Calculations45
Using the Floating-Point Unit (FPU)45
FPU Commands46
Using the SIMD Technologies (MMX, SSE)47
MultiMedia eXtensions (MMX)47
Streaming SIMD Extensions (SSE)50
Conclusion51
Chapter 2Optimizing Calculation Algorithms53
Mathematical Functions54
Floating-Point Unit54
The FPU Program Model55
FPU Commands and Algorithm Optimization56
Main Methods of Optimizing Mathematical Calculations74
Method 1.Using Integer Instructions75
Method 2.Optimizing Zero Test for Floating-Point Numbers75
Method 3.Using the LEA Commands for Optimization77
Working with Strings and Data Arrays79
String Operations in Assembly Language79
Basic String Commands80
The Use of String Commands82
Optimizing String Operations without Using String Commands94
Conclusion97
Chapter 3Developing and Using Procedures in Assembly Language99
Chapter 4Optimizing C++ Logical Structures with Assembly Language121
The if Statement122
The while Loop129
The do... while Loop134
The for Loop136
The switch Conditional Statement138
Chapter 5Assembly Module Interface to C++ Programs143
General Principles of Developing Interfaces to High-Level Languages144
Chapter 6Developing and Using Assembly Subroutines163
Chapter 7Linking Assembly Modules with C++ .Net Programs193
Chapter 8Dynamic Link Libraries and Their Development in Assembly Language233
Chapter 9Basic Structures of Visual C++ .Net 2003 Inline Assembler253
Chapter 10Inline Assembler and Application Optimization.mmx and SSE Technologies271
Inline Assembler and Optimizing Mathematical Operations271
Inline Assembler and MMX Extension286
SSE Extension and Programming It in Inline Assembler321
Processing Strings with Inline Assembler350
Chapter 11Optimizing Multimedia Applications with Assembly Language355
Chapter 12Optimizing Multithread Applications with Assembly Language363
Chapter 13C++ Inline Assembler and Windows Time Functions375
Chapter 14Using Assembly Language for System Programming in Windows405
Chapter 15Optimizing Procedure-Oriented Applications and System Services415
Conclusion445
On the CD446
Index447

Customer Reviews

Most Helpful Customer Reviews

See All Customer Reviews