Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Addressing mode
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Indexed absolute=== +------+-----+-----+--------------------------------+ | load | reg |index| address | +------+-----+-----+--------------------------------+ (Effective address = address + contents of specified index register) This also requires space in an instruction for quite a large address. The address could be the start of an array or vector, and the index could select the particular array element required. The processor may scale the index register to allow for the [[stride of an array|size of each array element]]. Note that this is more or less the same as base-plus-offset addressing mode, except that the offset in this case is large enough to address any memory location. ''Example 1'': Within a subroutine, a programmer may define a string as a local constant or a [[static variable]]. The address of the string is stored in the literal address in the instruction. The offset—which character of the string to use on this iteration of a loop—is stored in the index register. ''Example 2'': A programmer may define several large arrays as globals or as [[field (computer science)|class variables]]. The start of the array is stored in the literal address (perhaps modified at program-load time by a [[relocating loader]]) of the instruction that references it. The offset—which item from the array to use on this iteration of a loop—is stored in the index register. Often the instructions in a loop re-use the same register for the loop counter and the offsets of several arrays.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)