[...]... who’ve made the first edition of The Art of Assembly Language so successful Your comments, suggestions, and corrections have been a big help in the creation of this AAL2E_03.book Page xx Thursday, February 18, 2010 12:49 PM second edition Thank you for purchasing this book and keeping assembly language alive and well When I first began work on this second edition, my original plan was to make the necessary... Chapter 2) Think of memory as a linear array of bytes The address of the first byte is 0 and the address of the last byte is 232−1 For an 80x86 processor, the following pseudo-Pascal array declaration is a good approximation of memory: Memory: array [0 4294967295] of byte; C/C++ and Java users might prefer the following syntax: byte Memory[4294967296]; To execute the equivalent of the Pascal statement... details All of the software you need to compile and run HLA programs can be found at http://www.artofasm.com/ or at http://webster.cs.ucr.edu/ Select High Level Assembly from the Quick Navigation Panel and then the Download HLA link from that page HLA is currently available for Windows, Mac OS X, Linux, and FreeBSD Download the appropriate version of the HLA software for your system From the Download... 12:49 PM The #include statement in this program tells the HLA compiler to include a set of declarations from the stdlib.hhf (standard library, HLA Header File) Among other things, this file contains the declaration of the stdout.put code that this program uses The stdout.put statement is the print statement for the HLA language You use it to write data to the standard output device (generally the console)... "World of Assembly Language" , nl ); He l l o, Wo rl d of A ss e mbl y L angu age 3 AAL2E_03.book Page 4 Thursday, February 18, 2010 12:49 PM Indeed, nl (the newline) is really nothing more than a string constant, so (technically) the comma between the nl and the preceding string isn’t necessary You’ll often see the above written as stdout.put( "Hello, World of Assembly Language" nl ); Notice the lack of. .. changes and get the book out as quickly as possible However, the kind folks at No Starch Press have spent countless hours improving the readability, consistency, and accuracy of this book The second edition you hold in your hands is a huge improvement over the first edition and a large part of the credit belongs to No Starch In particular, the following No Starch personnel are responsible for improving... registers The EFLAGS register is a 32-bit register that encapsulates several singlebit boolean (true/false) values Most of the bits in the EFLAGS register are either reserved for kernel mode (operating system) functions or are of little interest to the application programmer Eight of these bits (or flags) are of interest to application programmers writing assembly language programs These are the overflow,... variable, you must load one of the variables into a register, add the second operand to the value in the register, and then store the register away in the destination variable Registers are a middleman in nearly every calculation Therefore, registers are very important in 80x86 assembly language programs Another thing you should be aware of is that although the registers have the name “general purpose,”... some simple assembly language programs By the conclusion of this chapter, you should understand the basic syntax of an HLA program and should understand the prerequisites that are needed to start learning new assembly language features in the chapters that follow AAL2E_03.book Page 2 Thursday, February 18, 2010 12:49 PM 1.1 The Anatomy of an HLA Program A typical HLA program takes the form shown in... 1-6 shows the layout of the flags within the lower 16 bits of the EFLAGS register 15 Overflow Direction Interrupt Disable Sign Zero Auxiliary Carry 0 Not very interesting to application programmers Parity Carry Figure 1-6: Layout of the FLAGS register (lower 16 bits of EFLAGS) Of the eight flags that are of interest to application programmers, four flags in particular are extremely valuable: the overflow, .
PRAISE FOR THE FIRST EDITION OF
THE ART OF ASSEMBLY LANGUAGE
“My flat-out favorite book of 2003 was Randall Hyde’s The Art of Assembly
Language. ”
—S
OFTWARE. 12:49 PM
THE ART OF
ASSEMBLY L ANGUAGE
2ND EDITION
by Randall Hyde
San Francisco
AAL2E_03.book Page v Thursday, February 18, 2010 12:49 PM
THE ART OF ASSEMBLY
Ngày đăng: 22/03/2014, 09:20
Xem thêm: PRAISE FOR THE FIRST EDITION OF THE ART OF ASSEMBLY LANGUAGE pdf, PRAISE FOR THE FIRST EDITION OF THE ART OF ASSEMBLY LANGUAGE pdf, 3: Some Basic HLA Data Declarations, 6: An Introduction to the Intel 80x86 CPU Family, 8: Some Basic Machine Instructions, 9: Some Basic HLA Control Structures, 10: Introduction to the HLA Standard Library, 2: The Hexadecimal Numbering System, 4: Arithmetic Operations on Binary and Hexadecimal Numbers, 6: Logical Operations on Bits, 8: Signed and Unsigned Numbers, 9: Sign Extension, Zero Extension, Contraction, and Saturation, 11: Bit Fields and Packed Data, 12: An Introduction to Floating-Point Arithmetic, 15: The Unicode Character Set, 1: The 80x86 Addressing Modes, 4: HLA Support for Data Alignment, 8: The stack Segment and the push and pop Instructions, 9: The Stack Is a LIFO Data Structure, 11: Dynamic Memory Allocation and the Heap Segment, 13: Obtaining the Address of a Memory Object, 1: Some Additional Instructions: intmul, bound, into, 2: HLA Constant and Value Declarations, 4: enum and HLA Enumerated Data Types, 10: The HLA String Module and Other String-Related Routines, 15: Character Set Support in the HLA Standard Library, 21: Sorting an Array of Values, 24: Accessing Multidimensional Array Elements in Assembly Language, 28: Arrays/Records as Record Fields, 29: Aligning Fields Within a Record, 35: Dynamic Arrays in Assembly Language, 2: Saving the State of the Machine, 3: Prematurely Returning from a Procedure, 5: Other Local and Global Symbol Types, 7: Functions and Function Results, 12: Procedures and the Stack, 16: Low-Level Implementation of Automatic (Local) Variables, 24: Units and the external Directive, 1: 80x86 Integer Arithmetic Instructions, 4: Machine and Arithmetic Idioms, 6: Converting Floating-Point Expressions to Assembly Language, 7: HLA Standard Library Support for Floating-Point Arithmetic, 4: The Conditional Jump Instructions, 6: Implementing Common Control Structures in Assembly Language, 8: State Machines and Indirect Jumps, 12: Hybrid Control Structures in HLA, 2: Operating on Different-Size Operands, 4: Compile-Time Expressions and Operators, 6: Conditional Compilation (Compile-Time Decisions), 7: Repetitive Compilation (Compile-Time Loops), 2: Instructions That Manipulate Bits, 4: Packing and Unpacking Bit Strings, 5: Coalescing Bit Sets and Distributing Bit Strings, 7: Searching for a Bit, 9: Reversing a Bit String, 13: The HLA Standard Library Bits Module, 1: The 80x86 String Instructions, 2: Performance of the 80x86 String Instructions, 7: Writing Class Methods and Procedures, 9: Constructors and Object Initialization, 11: HLA's _initialize_ and _finalize_ Strings, 14: Calling Base Class Methods