Register + Offset Addressing | ||||||||||||||
Direct
addressing and indirect addressing using a single register are two basic
forms of memory access. Another possibility is to use different
combinations of direct and indirect references. In the above example we
used BX to access different array elements which were placed
consecutively in memory like an array. We can also place in BX only the
array index and not the exact address and form the exact address when we
are going to access the actual memory. This way the same register can be
used for accessing different arrays and also the register can be used
for index comparison like the following example does.
Inside the debugger we observe that the memory access instruction is shown as “mov ax, [011F+bx]” and the actual memory accessed is the one whose address is the sum of 011F and the value contained in the BX register. This form of access is of the register indirect family and is called base + offset or index + offset depending on whether BX or BP is used or SI or DI is used. | ||||||||||||||
Previous | TOC | Next | ||||||||||||