| Line 1: |
Line 1: |
| − | An '''assembly language''' is a low-level [[programming language]] that is specific to a given [[CPU]]'s instruction set. For instance, the [[Zilog Z80]] assembly language is different from the [[Intel 8080]] assembly language, despite the similarities in the underlying instruction sets. | + | An '''assembly language''' is a low-level [[programming language]] that is specific to a given [[CPU]]'s instruction set in an one-to-one relationship. For instance, the [[Zilog Z80]] assembly language is different from the [[Intel 8080]] assembly language, despite the similarities in the underlying instruction sets. Each assembly instruction maps directly to a machine language instruction and vice versa. This also means that machine language instructions can easily be converted ("disassembled") to assembly language for, for example, purposes of debugging and reverse engineering. In other words, assembly language is "just" a human-comprehensible way of displaying processor instructions. |
| | | | |
| | A program, called an '''assembler''' converts source code written in assembly language into the CPU's machine code. Each CPU instruction is assigned a short mnemonic code (traditionally 3 or 4 characters in length). Additional syntax supports registers, addressing modes, labels and other symbolic names, comments, and directives. Assembly languages supporting macro processing (substitution, etc) used to be called macro assembly languages, but as most assembly languages now support macros, the "macro" prefix has been dropped from common usage. | | A program, called an '''assembler''' converts source code written in assembly language into the CPU's machine code. Each CPU instruction is assigned a short mnemonic code (traditionally 3 or 4 characters in length). Additional syntax supports registers, addressing modes, labels and other symbolic names, comments, and directives. Assembly languages supporting macro processing (substitution, etc) used to be called macro assembly languages, but as most assembly languages now support macros, the "macro" prefix has been dropped from common usage. |
| Line 8: |
Line 8: |
| | Assembly languages do not provide many of the useful abstractions of high-level languages, such as memory management, object and other complex data structure support, or string manipulation. Such features are often available through libraries of assembly code, though. | | Assembly languages do not provide many of the useful abstractions of high-level languages, such as memory management, object and other complex data structure support, or string manipulation. Such features are often available through libraries of assembly code, though. |
| | | | |
| − | Assembly language is essential when a new CPU is developed since it allows the development of higher-level language compilers for that CPU. Assembly is also required for access to unique and low-level features of a CPU which is why portions of most [[operating system]]s must be written using assembly language. Because assembly provides no abstractions, code written with it can run faster than equivalent code written in a high-level programming language. However, modern '''optimizing compilers''' are often better at generating efficient machine code than human-crafted assembly. Finally, writing assembly code is more tedious (and therefore more error-prone) than using a high-level language. | + | Assembly language is essential when a new CPU is developed since it allows the development of higher-level language compilers for that CPU. Assembly is also required for access to unique and low-level features of a CPU which is why portions of most [[operating system]]s must be written using assembly language. Because assembly provides no abstractions, code written with it can run faster than equivalent code written in a high-level programming language. However, modern '''optimizing compilers''' are often better at generating efficient machine code than human-crafted assembly. Finally, writing assembly code is more tedious (and therefore more error-prone) than using a high-level language. The most notable |
| | | | |
| | ==Macros== | | ==Macros== |