Assembly Language for Intel-Based Computers, Fifth Edition is based on the Intel IA-32 Processor architecture, seen from a programmer's point of view. It is especially useful for those learning Assembly Language Programming, Fundamentals of Computer Systems, or Fundamentals of Computer Architecture.
Topics covered include:
The book also features examples of many concepts, including:
- Virtual machine concept
- Elementary boolean operations
- Instruction execution cycle
- Memory access using clock cycles
- Interrupts and polling
- Multi-stage pipeline
- Superscalar architecture
- Hardware-based I/O
- Loading and executing programs
- Floating-point binary representation
- IA-32 Protected Memory addressing and paging
- Memory segmentation in Real-address mode
- 16-bit interrupt handling
- MS-DOS and BIOS system calls
- IA-32 Floating-Point Unit architecture and programming
- IA-32 Instruction encoding
Topics and features new to the fifth edition include:
- Searching and sorting algorithms
- High-level language structures
- Finite-state machines
- Code optimization examples
- Improved explanation of the instruction execution cycle.
- An expanded link library with additional subroutines to write rich user interfaces, calculate program timings, generate pseudorandom integers, and parse integer strings. The documentation of the library has improved greatly.
- Improved explanation of conditional jump encoding and relative jump ranges.
- Two-operand and three-operand IMUL instructions are added. Performance comparisons are shown for differing approaches to integer multiplication.
- Completely redesigned so that low-level details of stack frames (activation records) are explained first before introducing MASM's high-level INVOKE and PROC directives.
- Improved documentation of the book's macro library.
- New topic: Dynamic memory allocation in MS Windows applications. Improved coverage of file handling and error reporting in MS Windows applications.
- Improved coverage of calling C and C++ functions from assembly language.
- Introduction to the IA-32 floating-point instruction set. Floating-point data types. IA-32 Instruction encoding and decoding.
The primary focus of this book is to teach you how to write and debug programs at the machine level. It will never replace a complete book on computer architecture, but it does give you the first-hand experience of writing software in an environment that teaches you how the computer really works.
This edition primarily emphasizes 32-bit Protected mode, but it still has three chapters devoted exclusively to Real-mode programming. For example, there is an entire chapter on BIOS programming for the keyboard, video display (including graphics), and mouse. There is another chapter exclusively on MS-DOS programming using interrupt (function) calls.
The examples in the first part of the book are nearly all presented as 32-bit text-oriented applications running in Protected mode using the flat memory model. This is extremely straightforward. You will not have to deal with segment-offset addressing. There are specially marked paragraphs and pop-up boxes that note the small differences between Protected mode and Real-mode programming. Most of the differences are hidden away in the book's two link libraries.
There are two versions of the link library that you can use for basic input-output, simulations, timing, etc. The 32-bit version (Irvine32.lib) works in Win32 Console mode, under any version of MS Windows. The 16-bit version (Irvinel6.lib) works under MS-DOS, MS Windows, and a Linux DOS emulator. They contain more than 30 procedures that simplify user input-output, numeric processing, disk and file handling, and string handling. In the beginning stages of the book, you can use this library to enhance your programs. Later, all the functions in these two libraries are exposed, and you will learn how to create your own procedures and add them to the library. Complete source code for the 16-bit and 32-bit link libraries is included.
All the example programs have been tested with the Microsoft Macro Assembler Version 8.0, which is included on CD-ROM with the book or may be downloaded free of charge.
Author Kip R. Irvine designed this book to broaden your interest and knowledge in topics related to assembly language, and to teach you to approach programming problems with a machine-level mindset. "It is important to think of the CPU as an interactive tool, and to learn to monitor each of its actions as directly as possible," he writes. "A debugger is a programmer's best friend, not only for catching errors, but as an educational tool that teaches about the CPU and operating system. I encourage students to look beneath the surface of high-level languages, and to realize that most programming languages are designed to be portable and, therefore, independent of their host machines."
In addition to the short examples, Assembly Language for Intel-Based Computers contains more than 115 ready-to-run programs that demonstrate instructions or ideas as they are presented in the text. Reference materials, such as guides to MS-DOS interrupts and instruction mnemonics, are available at the end of the book. There is a comprehensive link library that makes the user interface much more accessible for those writing their first programs. The macro library included with the book may also provide inspiration for further development by professors and students.
The reader of this book should already be able to program confidently in at least one other programming language, preferably Pascal, Java, C, or C++. One chapter goes into C++ interfacing in some depth, so it is very helpful to have a compiler on hand. Microsoft Visual C++.NET and Borland Turbo Assembler were used for the examples that deal with high-level language interfacing.
Topic Summaries Programming Logic. Two chapters emphasize boolean logic and bit-level manipulation. A conscious attempt is made to relate high-level programming logic to the low-level details of the machine. This helps you to create more efficient implementations and to better understand how language compilers generate object code.
Hardware and Operating System Concepts. The first two chapters introduce basic hardware and data representation concepts, including binary numbers, CPU architecture, status flags, and memory mapping. A survey of the computer's hardware and a historical perspective of the Intel processor family helps you to better understand your target computer system.
Structured Programming Approach. Beginning with Chapter 5, procedures and module decomposition are strongly emphasized. You are given more complex programming problems that require you to focus on design before starting to write code.
Disk Storage Concepts. You will learn the fundamental principles behind the disk storage system on the PC, from both hardware and software points of view.
Creating Link Libraries. You are free to add your own procedures to the book's link library and can create libraries of your own. You will learn to use a toolbox approach to programming and to write code that is useful in more than one program.
Macros and Structures. A chapter is devoted to creating structures, unions, and macros, which are important in both assembly language and systems programming. Conditional macros with advanced operators serve to make the macros more professional.
Interfacing to High-Level Languages. A chapter is devoted to interfacing assembly language to C and C++. This is an important job skill for those who are looking to find jobs programming in high-level languages. You can learn to optimize your code and see actual examples of how C++ compilers optimize code.
View detailed Table of Contents
Hardcover; 722 pages