| 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 isntruction sets. | + | 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. |
| | | | |
| − | 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 mnuemonic 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. |
| | | | |
| − | The instruction mnuemonics are typically defined by the manufacturer of the CPU. Although anyone could assign their own arbitrary set of mnuemonics for a CPU's instruction set, in practice this is seldom done. | + | The instruction mnemonics are typically defined by the manufacturer of the CPU. Although anyone could assign their own arbitrary set of mnemonics for a CPU's instruction set, in practice this is seldom done. |
| | | | |
| − | ==Advantages and Diadvantages of Assembly Language== | + | ==Advantages and Disadvantages of Assembly Language== |
| | 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. |
| | | | |
| Line 11: |
Line 11: |
| | | | |
| | ==Macros== | | ==Macros== |
| − | Macros provide short-hand for assembly programmers. The most common macro feature is the '''substitution macro'''. This allows the programmer to define his own mnuemonic in place of several pre-existing mnuemonics. When the macro is used, the assembler will substitute the corresponding mnuemonics in place of the macro, as if the programmer had included those mnuemonics at that point in the source code. Another form of macro is the '''iteration macro''' which allows the programmer to duplicate something without having the manually duplicate it numerous times. Thus macros can reduce the size, and complexity, of the assembler source code. | + | Macros provide short-hand for assembly programmers. The most common macro feature is the '''substitution macro'''. This allows the programmer to define his own mnemonic in place of several preexisting mnemonics. When the macro is used, the assembler will substitute the corresponding mnemonics in place of the macro, as if the programmer had included those mnemonics at that point in the source code. Another form of macro is the '''iteration macro''' which allows the programmer to duplicate something without having the manually duplicate it numerous times. Thus macros can reduce the size, and complexity, of the assembler source code. |
| | | | |
| | ==Example== | | ==Example== |
| − | Without an assembler, a person who wanted to increment the Zilog Z80 "C" register, would have to figure out the numeric code (in this case 4 hexadecimal or 00000100 binary). Assembly allows this operation to be specified with the mnuemonic: | + | Without an assembler, a person who wanted to increment the Zilog Z80 "C" register, would have to figure out the numeric code (in this case 4 hexadecimal or 00000100 binary). Assembly allows this operation to be specified with the mnemonic: |
| | | | |
| | INC C | | INC C |
| Line 54: |
Line 54: |
| | | | |
| | ==References== | | ==References== |
| − | *The 8086 Family User's Manual, Intel Coporation, 1979 | + | *The 8086 Family User's Manual, Intel Corporation, 1979 |
| | *VAX 11 Structured Assembly Language Programming, Robert W. Sebesta, Benjamin/Cummings Publishing, ISBN 0-8053-7001-3 | | *VAX 11 Structured Assembly Language Programming, Robert W. Sebesta, Benjamin/Cummings Publishing, ISBN 0-8053-7001-3 |
| | *Programming the Z80, Rodnay Zaks, Sybex, ISBN 0-89588-069-5 | | *Programming the Z80, Rodnay Zaks, Sybex, ISBN 0-89588-069-5 |