Assembly language
Assembly language or simply assembly is a human-readable notation for the machine language that a specific computer architecture uses. Machine language, a pattern of bits encoding machine operations, is made readable by replacing the raw values with symbols called mnemonics.
Machine instructions
Instructions in assembly language are generally very simple, unlike in a high-level language. Any instruction that references memory (for data or as a jump target) will also have an addressing mode to determine how to calculate the required memory address. More complex operations must be built up out of these simple operations. Some operations available in most instruction sets include:
Related Topics:
High-level language - Addressing mode
~ ~ ~ ~ ~ ~ ~ ~ ~ ~
- moving
- set a register (a temporary "scratchpad" location in the CPU itself) to a fixed constant value
- move data from a memory location to a register, or vice versa. This is done to obtain the data to perform a computation on it later, or to store the result of a computation.
- read and write data from hardware devices
- computing
- add, subtract, multiply, or divide the values of two registers, placing the result in a register
- perform bitwise operations, taking the conjunction/disjunction (and/or) of corresponding bits in a pair of registers, or the negation (not) of each bit in a register
- compare two values in registers (for example, to see if one is less, or if they are equal)
- affecting program flow
- jump to another location in the program and execute instructions there
- jump to another location if a certain condition holds
- jump to another location, but save the location of the next instruction as a point to return to (a call)
- saving many registers on the stack at once
- moving large blocks of memory
- complex and/or floating-point arithmetic (sine, cosine, square root, etc.)
- performing an atomic test and set instruction
- instructions that combine ALU with an operand from memory rather than a register
Some computers include one or more "complex" instructions in their instruction set. A single "complex" instruction does something that may take many instructions on other computers. Such instructions are typified by instructions that take multiple steps, may issue to multiple functional units, or otherwise appear to be a design exception to the simplest instructions which are implemented for the given processor. Some examples of such instruction include:
~ ~ ~ ~ ~ ~ ~ ~ ~ ~
A form of complex instructions that has become particularly popular recently are SIMD operations that perform the same arithmetic operation to multiple pieces of data at the same time, which have appeared under various trade names beginning with MMX and AltiVec.
Related Topics:
SIMD - MMX - AltiVec
~ ~ ~ ~ ~ ~ ~ ~ ~ ~
The design of instruction sets is a complex issue, with a simpler instruction set (generally grouped under the concept RISC) perhaps offering the potential for higher speeds, while a more complex one (traditionally called CISC) may offer particularly fast implementations of common performance-demanding tasks, may use memory (and thus cache) more efficiently), and be somewhat easier to program directly in assembler. See instruction set for a fuller discussion of this point.
Related Topics:
RISC - CISC - Cache - Instruction set
~ ~ ~ ~ ~ ~ ~ ~ ~ ~
~ Table of Content ~
| ► | Introduction |
| ► | Machine instructions |
| ► | Assembly language directives |
| ► | Usage of assembly language |
| ► | See also |
| ► | Books |
| ► | External links |
~ What's Hot ~
~ Community ~
| ► | History Forum Come and discuss about History, Civilizations, Historical Events and Figures |
| ► | History Web-Ring A community of sites, blogs and forums dedicated to History. Do not hesitate to submit your site. |
and are licensed under the GNU Free Documentation License.
Lexicon - Privacy Policy - Spiritus-Temporis.com ©2005.