Skip to content

Assembly Language for Intel-Based Computers

Best in textbook rentals since 2012!

ISBN-10: 0132383101

ISBN-13: 9780132383103

Edition: 5th 2007 (Revised)

Authors: Kip R. Irvine

List price: $133.00
Blue ribbon 30 day, 100% satisfaction guarantee!
what's this?
Rush Rewards U
Members Receive:
Carrot Coin icon
XP icon
You have reached 400 XP and carrot coins. That is the daily max!

Description:

This widely used, fully updated assembly language book provides basic information for the beginning programmer interested in computer architecture, operating systems, hardware manipulation, and compiler writing. Uses the Intel IA-32 processor family as its base, showing how to program for Windows and DOS. Is written in a clear and straightforward manner for high readability. Includes a companion CD-ROM with all sample programs, and Microsoftreg; Macro Assembler Version 8, along with an extensive companion Website maintained by the author. Covers machine architecture, processor architecture, assembly language fundamentals, data transfer, addressing and arithmetic, procedures, conditional…    
Customers also bought

Book details

List price: $133.00
Edition: 5th
Copyright year: 2007
Publisher: Prentice Hall PTR
Publication date: 6/16/2006
Binding: Hardcover
Pages: 752
Size: 7.25" wide x 9.50" long x 1.25" tall
Weight: 2.684
Language: English

Kip Irvine has written four computer programming textbooks, for Intel Assembly Language, C++, Visual Basic, and COBOL. His "Assembly Language for Intel-Based Computers" has been translated to six languages, and has been a best seller since 1990. Kip grew up in Hawaii as a surfer, sailor, and surfboard maker. He studied classical guitar and music composition at University of Hawaii, eventually earning his music doctorate from the University of Miami. He began programming computers for music synthesis around 1982, and taught at Miami-Dade Community College. He has a Masters degree in Computer Science from the University of Miami, and is currently on the computer science faculty at Florida…    

Preface
Basic Concepts
Welcome to Assembly Language
Good Questions to Ask
Assembly Language Applications
Section Review
Virtual Machine Concept
History of PC Assemblers
Section Review
Data Representation
Binary Numbers
Binary Addition
Integer Storage Sizes
Hexadecimal Integers
Signed Integers
Character Storage
Section Review
Boolean Operations
Truth Tables for Boolean Functions
Section Review
Chapter Summary
IA-32 Processor Architecture
General Concepts
Basic Microcomputer Design
Instruction Execution Cycle
Reading from Memory
How Programs Run
Section Review
IA-32 Processor Architecture
Modes of Operation
Basic Execution Environment
Floating-Point Unit
Intel Microprocessor History
Section Review
IA-32 Memory Management
Real-Address Mode
Protected Mode
Section Review
Components of an IA-32 Microcomputer
Motherboard
Video Output
Memory
Input-Output Ports and Device Interfaces
Section Review
Input-Output System
How It All Works
Section Review
Chapter Summary
Assembly Language Fundamentals
Basic Elements of Assembly Language
Integer Constants
Integer Expressions
Real Number Constants
Character Constants
String Constants
Reserved Words
Identifiers
Directives
Instructions
The NOP (No Operation) Instruction
Section Review
Example: Adding Three Integers
Alternative Version of AddSub
Program Template
Section Review
Assembling, Linking, and Running Programs
The Assemble-Link-Execute Cycle
Section Review
Defining Data
Intrinsic Data Types
Data Definition Statement
Defining BYTE and SBYTE Data
Defining WORD and SWORD Data
Defining DWORD and SDWORD Data
Defining QWORD Data
Defining TBYTE Data
Defining Real Number Data
Little Endian Order
Adding Variables to the AddSub Program
Declaring Uninitialized Data
Section Review
Symbolic Constants
Equal-Sign Directive
Calculating the Sizes of Arrays and Strings
EQU Directive
TEXTEQU Directive
Section Review
Real-Address Mode Programming (Optional)
Basic Changes
Chapter Summary
Programming Exercises
Data Transfers, Addressing, and Arithmetic
Data Transfer Instructions
Introduction
Operand Types
Direct Memory Operands
MOV Instruction
Zero/Sign Extension of Integers
LAHF and SAHF Instructions
XCHG Instruction
Direct-Offset Operands
Example Program (Moves)
Section Review
Addition and Subtraction
INC and DEC Instructions
ADD Instruction
SUB Instruction
NEG Instruction
Implementing Arithmetic Expressions
Flags Affected by Addition and Subtraction
Example Program (AddSub3)
Section Review
Data-Related Operators and Directives
OFFSET Operator
ALIGN Directive
PTR Operator
TYPE Operator
LENGTHOF Operator
SIZEOF Operator
LABEL Directive
Section Review
Indirect Addressing
Indirect Operands
Arrays
Indexed Operands
Pointers
Section Review
JMP and LOOP Instructions
JMP Instruction
LOOP Instruction
Summing an Integer Array
Copying a String
Section Review
Chapter Summary
Programming Exercises
Procedures
Introduction
Linking to an External Library
Background Information
Section Review
The Book's Link Library
Overview
Individual Procedure Descriptions
Library Test Programs
Section Review
Stack Operations
Runtime Stack
PUSH and POP Instructions
Section Review
Defining and Using Procedures
PROC Directive
CALL and RET Instructions
Example: Summing an Integer Array
Flowcharts
Saving and Restoring Registers
Section Review
Program Design Using Procedures
Integer Summation Program (Design)
Integer Summation Implementation
Section Review
Chapter Summary
Programming Exercises
Conditional Processing
Introduction
Boolean and Comparison Instructions
The CPU Flags
AND Instruction
OR Instruction
XOR Instruction
NOT Instruction
TEST Instruction
CMP Instruction
Setting and Clearing Individual CPU Flags
Section Review
Conditional Jumps
Conditional Structures
Jcond Instruction
Types of Conditional Jump Instructions
Conditional Jump Applications
Bit Testing Instructions (Optional)
Section Review
Conditional Loop Instructions
LOOPZ and LOOPE Instructions
LOOPNZ and LOOPNE Instructions
Section Review
Conditional Structures
Block-Structured IF Statements
Compound Expressions
WHILE Loops
Table-Driven Selection
Section Review
Application: Finite-State Machines
Validating an Input String
Validating a Signed Integer
Section Review
Decision Directives
Signed and Unsigned Comparisons
Compound Expressions
.REPEAT and .WHILE Directives
Chapter Summary
Programming Exercises
Integer Arithmetic
Introduction
Shift and Rotate Instructions
Logical Shifts and Arithmetic Shifts
SHL Instruction
SHR Instruction
SAL and SAR Instructions
ROL Instruction
ROR Instruction
RCL and RCR Instructions
Signed Overflow
SHLD/SHRD Instructions
Section Review
Shift and Rotate Applications
Shifting Multiple Doublewords
Binary Multiplication
Displaying Binary Bits
Isolating MS-DOS File Date Fields
Section Review
Multiplication and Division Operations
MUL Instruction
IMUL Instruction
Benchmarking Multiplication Operations
DIV Instruction
Signed Integer Division
Implementing Arithmetic Expressions
Section Review
Extended Addition and Subtraction
ADC Instruction
Extended Addition Example
SBB Instruction
Section Review
ASCII and Unpacked Decimal Arithmetic
AAA Instruction
AAS Instruction
AAM Instruction
AAD Instruction
Section Review
Packed Decimal Arithmetic
DAA Instruction
DAS Instruction
Section Review
Chapter Summary
Programming Exercises
Advanced Procedures
Introduction
Stack Frames
Stack Parameters
Local Variables
ENTER and LEAVE Instructions
LOCAL Directive
WriteStackFrame Procedure
Section Review
Recursion
Recursively Calculating a Sum
Calculating a Factorial
Section Review
.MODEL Directive
Language Specifiers
Section Review
INVOKE, ADDR, PROC, and PROTO (Optional)
INVOKE Directive
ADDR Operator
PROC Directive
PROTO Directive
Parameter Classification
Example: Exchanging Two Integers
Debugging Tips
Section Review
Creating Multimodule Programs
Hiding and Exporting Procedure Names
Calling External Procedures
Using Variables and Symbols Across Module Boundaries
Example: ArraySum Program
Creating the Modules Using Extern
Creating the Modules Using INVOKE and PROTO
Section Review
Chapter Summary
Programming Exercises
Strings and Arrays
Introduction
String Primitive Instructions
MOVSB, MOVSW, and MOVSD
CMPSB, CMPSW, and CMPSD
SCASB, SCASW, and SCASD
STOSB, STOSW, and STOSD
LODSB, LODSW, and LODSD
Section Review
Selected String Procedures
Str_compare Procedure
Str_length Procedure
Str_copy Procedure
Str_trim Procedure
Str_ucase Procedure
String Library Demo Program
Section Review
Two-Dimensional Arrays
Ordering of Rows and Columns
Base-Index Operands
Base-Index-Displacement Operands
Section Review
Searching and Sorting Integer Arrays
Bubble Sort
Binary Search
Section Review
Chapter Summary
Programming Exercises
Structures and Macros
Structures
Defining Structures
Declaring Structure Variables
Referencing Structure Variables
Example: Displaying the System Time
Structures Containing Structures
Example: Drunkard's Walk
Declaring and Using Unions
Section Review
Macros
Overview
Defining Macros
Invoking Macros
Additional Macro Features
Using the Book's Macro Library
Example Program: Wrappers
Section Review
Conditional-Assembly Directives
Checking for Missing Arguments
Default Argument Initializers
Boolean Expressions
IF, ELSE, and ENDIF Directives
The IFIDN and IFIDNI Directives
Example: Summing a Matrix Row
Special Operators
Macro Functions
Section Review
Defining Repeat Blocks
WHILE Directive
REPEAT Directive
FOR Directive
FORC Directive
Example: Linked List
Section Review
Chapter Summary
Programming Exercises
MS-Windows Programming
Win32 Console Programming
Background Information
Win32 Console Functions
Displaying a Message Box
Console Input
Console Output
Reading and Writing Files
File I/O in the Irvine32 Library
Testing the File I/O Procedures
Console Window Manipulation
Controlling the Cursor
Controlling the Text Color
Time and Date Functions
Section Review
Writing a Graphical Windows Application
Necessary Structures
The MessageBox Function
The WinMain Procedure
The WinProc Procedure
The ErrorHandler Procedure
Program Listing
Section Review
Dynamic Memory Allocation
HeapTest Programs
Section Review
IA-32 Memory Management
Linear Addresses
Page Translation
Section Review
Chapter Summary
Programming Exercises
High-Level Language Interface
Introduction
General Conventions
Section Review
Inline Assembly Code
_asm Directive in Microsoft Visual C++
File Encryption Example
Section Review
Linking to C/C++ in Protected Mode
Using Assembly Language to Optimize C++ Code
Calling C and C++ Functions
Multiplication Table Example
Calling C Library Functions
Directory Listing Program
Section Review
Linking to C/C++ in Real-Address Mode
Linking to Borland C++
ReadSector Example
Example: Large Random Integers
Section Review
Chapter Summary
Programming Exercises
16-Bit MS-DOS Programming
MS-DOS and the IBM-PC
Memory Organization
Redirecting Input-Output
Software Interrupts
INT Instruction
Coding for 16-Bit Programs
Section Review
MS-DOS Function Calls (INT 21h)
Selected Output Functions
Hello World Program Example
Selected Input Functions
Date/Time Functions
Section Review
Standard MS-DOS File I/O Services
Create or Open File (716Ch)
Close File Handle (3Eh)
Move File Pointer (42h)
Get File Creation Date and Time
Selected Library Procedures
Example: Read and Copy a Text File
Reading the MS-DOS Command Tail
Example: Creating a Binary File
Section Review
Chapter Summary
Chapter Exercises
Disk Fundamentals
Disk Storage Systems
Tracks, Cylinders, and Sectors
Disk Partitions (Volumes)
Section Review
File Systems
FAT12
FAT16
FAT32
NTFS
Primary Disk Areas
Section Review
Disk Directory
MS-DOS Directory Structure
Long Filenames in MS-Windows
File Allocation Table (FAT)
Section Review
Reading and Writing Disk Sectors (7305h)
Sector Display Program
Section Review
System-Level File Functions
Get Disk Free Space (7303h)
Create Subdirectory (39h)
Remove Subdirectory (3Ah)
Set Current Directory (3Bh)
Get Current Directory (47h)
Get and Set File Attributes (7143h)
Section Review
Chapter Summary
Programming Exercises
BIOS-Level Programming
Introduction
BIOS Data Area
Keyboard Input with INT 16h
How the Keyboard Works
INT 16h Functions
Section Review
VIDEO Programming with INT 10h
Basic Background
Controlling the Color
INT 10h Video Functions
Library Procedure Examples
Section Review
Drawing Graphics Using INT 10h
INT 10h Pixel-Related Functions
DrawLine Program
Cartesian Coordinates Program
Converting Cartesian Coordinates to Screen Coordinates
Section Review
Memory-Mapped Graphics
Mode 13h: 320 x 200, 256 Colors
Memory-Mapped Graphics Program
Section Review
Mouse Programming
Mouse INT 33h Functions
Mouse Tracking Program
Section Review
Chapter Summary
Chapter Exercises
Expert MS-DOS Programming
Introduction
Defining Segments
Simplified Segment Directives
Explicit Segment Definitions
Segment Overrides
Combining Segments
Section Review
Runtime Program Structure
Program Segment Prefix
COM Programs
EXE Programs
Section Review
Interrupt Handling
Hardware Interrupts
Interrupt Control Instructions
Writing a Custom Interrupt Handler
Terminate and Stay Resident Programs
Application: The No_Reset Program
Section Review
Hardware Control Using I/O Ports
Input-Output Ports
PC Sound Program
Chapter Summary
Floating-Point Processing and Instruction Encoding
Floating-Point Binary Representation
IEEE Binary Floating-Point Representation
The Exponent
Normalized Binary Floating-Point Numbers
Creating the IEEE Representation
Converting Decimal Fractions to Binary Reals
Section Review
Floating-Point Unit
FPU Register Stack
Rounding
Floating-Point Exceptions
Floating-Point Instruction Set
Arithmetic Instructions
Comparing Floating-Point Values
Reading and Writing Floating-Point Values
Exception Synchronization
Code Examples
Mixed-Mode Arithmetic
Masking and Unmasking Exceptions
Section Review
Intel Instruction Encoding
IA-32 Instruction Format
Single-Byte Instructions
Move Immediate to Register
Register-Mode Instructions
IA-32 Processor Operand-Size Prefix
Memory-Mode Instructions
Section Review
Chapter Summary
Programming Exercises
MASM Reference
The IA-32 Instruction Set
BIOS and MS-DOS Interrupts
Answers to Review Questions
Index