Page 138 - Handout of Computer Architecture (1)..
P. 138

multiple general- purpose registers, placing a burden for efficient execution on the assembly- language
               programmer (e.g., compiler writer).

               Register Indirect Addressing

               Just as register addressing is analogous to direct addressing, register indirect addressing is analogous to
               indirect addressing. In both cases, the only difference is whether the address field refers to a memory
               location or a register. Thus, for register indirect address,

               EA = (R)

               The  advantages  and  limitations  of  register  indirect  addressing  are  basically  the  same  as  for  indirect
               addressing. In both cases, the address space limitation (limited range of addresses) of the address field is
               overcome by having that field refer to a word- length location containing an address. In addition, register
               indirect addressing uses one less memory reference than indirect addressing

               Displacement  Addressing  A  very  powerful  mode  of  addressing  combines  the  capabilities  of  direct
               addressing and register indirect addressing. It is known by a variety of names depending on the context
               of its use, but the basic mechanism is the same. We will refer to this as displacement addressing:

               EA = A + (R)

               Displacement addressing requires that the instruction have two address fields, at least one of which is
               explicit. The value contained in one address field (value = A) is used directly. The other address field, or
               an implicit reference based on opcode, refers to a register whose contents are added to A to produce the
               effective address. We will describe three of the most common uses of displacement addressing:

               ■ Relative addressing

               ■ Base- register addressing

               ■ Indexing relative addressing for relative addressing, also called PC- relative addressing, the implicitly
               referenced register is the program counter (PC). That is, the next instruction address is added to the
               address field to produce the EA. Typically, the address field is treated as twos complement number for
               this operation. Thus, the effective address is a displacement relative to the address of the instruction.
               Relative addressing exploits the concept of locality that was discussed in Chapters 4 and 8. If most memory
               references are relatively near to the instruction being executed, then the use of relative addressing saves
               address bits in the instruction.

               base- register addressing for base- register addressing, the interpretation is the following: The referenced
               register contains  a main memory  address,  and the  address  field contains  a displacement  (usually  an
               unsigned integer representation) from that address. The register reference may be explicit or implicit.
               Base- register addressing also exploits the locality of memory references. In some implementations, a
               single segment- base register is employed and is used implicitly. In others, the programmer may choose a
               register to hold the base address of a segment, and the instruction must reference it explicitly. In this


                                                             138
   133   134   135   136   137   138   139   140   141   142   143