Science  People  Locations  Timeline
Index: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Home > 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.

For example, a computer with the appropriate processor will understand this x86/IA-32 machine instruction:

10110000 01100001

For programmers, however, it is easier to remember the equivalent assembly language representation

mov al, 0x61

which means to move the hexadecimal value 61 (97 decimal) into the processor register with the name 'al'. The mnemonic "mov" is short for "move," and a comma-separated list of arguments or parameters follows it; this is a typical instruction.

Unlike in high-level languages, there is (to a close approximation) a 1-to-1 correspondence between simple assembly and machine language. Transforming assembly into machine languages is accomplished by an assembler, and the reverse by a disassembler.

Every computer architecture has its own machine language, and therefore its own assembly language (the example above is from the i386). These languages differ by the number and type of operations that they support. They may also have different sizes and numbers of registers, and different representations of data types in storage. While all general-purpose computers are able to carry out essentially the same functionality, the way they do it differs.

In addition, multiple sets of mnemonics or assembly-language syntax may exist for a single instruction set. In these cases, the most popular one is usually that used by the manufacturer in their documentation.

1 Machine instructions

Instructions in assembly language are generally very simple, unlike in a high-level language. Any instruction which 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:

Specific instruction sets will often have single, or a few instructions for common operations which would otherwise take many instructions. Examples:



Read more »

Non User