Guide to Assembly Language Programming in Linux

In assembly language, specification of data required by instructions can be done in a variety of ways. In Chapter 9 we discussed four different addressing modes: register, immediate, direct, and indirect. The last two addressing modes specify operands in memory. However, such memory operands can be specified by several other addressing modes. Here we give a detailed description of these memory addressing modes.
Arrays are important for organizing a collection of related data. Although one-dimensional arrays are straightforward to implement, multidimensional arrays are more involved. This chapter discusses these issues in detail. Several examples are given to illustrate the use of the addressing modes in processing one- and two-dimensional arrays.
Addressing mode refers how we specify the location of an operand that is required by an instruction. An operand can be at any of the following locations: in a register, in the instruction itself, in the memory, or at an I/O port. Chapter 20 discusses how operands located at an I/O port can be specified. Here we concentrate on how we can specify operands located in the first three locations. The three addressing modes are:
Register Addressing Mode: In this addressing mode, as discussed in Chapter 9, processor registers provide the input operands and results are stored back in registers. Since the IA-32 architecture uses a two-address format, one operand specification acts as both source and destination. This addressing mode is the best way of specifying operands, as the delay in accessing the operands is minimal.
Immediate...