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
Orthogonal instruction set
(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!
===Multiple data=== Complexity arises when one considers common patterns in which memory is accessed. One very common pattern is that a single operation may be applied across a large amount of similar data. For instance, one might want to add up 1,000 numbers. In a simple two-address format of instructions,{{efn|assuming that the address cannot be operated on}} there is no way to change the address, so 1,000 additions have to be written in the [[machine language]]. ISAs fix this problem with the concept of ''indirect addressing'', in which the address of the next point of data is not a constant, but itself held in memory or a machine register. This means the programmer can change the address by performing addition on that memory location or register. ISAs also often include the ability to offset an address from an initial location, by adding a value held in one of its registers, in some cases a special ''index register''. Others carry out this addition automatically as part of the instructions that use it.<ref name=format/> The variety of [[addressing mode]]s leads to a profusion of slightly different instructions. Considering a one-address ISA, for even a single instruction, <code>ADD</code>, we now have many possible "addressing modes": * Immediate (constant): <code>ADD.C ''constant 1''</code> β adds the constant value to the result in the accumulator * Direct address: <code>ADD.A ''address 1''</code> β add the value stored at address 1 * Memory indirect: <code>ADD.M ''address 1''</code> β read the value in address 1, use that value as another address and add that value Many ISAs also have registers that can be used for addressing as well as math tasks. This can be used in a one-address format if a single address register is used. In this case, a number of new modes become available: * Register direct: <code>ADD.R ''register 1''</code> β add the value stored in the address held in register one * Displacement: <code>ADD.D ''constant 1''</code> β add the constant to the address register, then add the value found in memory at that resulting location * Index: <code>ADD.I ''register 1''</code> β add the value in register 1 to the address register to make a new address and then adds the value at that location to the accumulator * Autoindex: <code>ADD.AI ''register 1''</code> β as in the Index case, but automatically increments the address
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)