| • Science | • People | • Locations | • Timeline |
An assembler is a computer program for translating assembly language — essentially, a mnemonic representation of machine language — into object code. A cross assembler (see cross compiler) produces code for one processor, but runs on another.
As well as translating assembly instruction mnemonics into opcodes, assemblers provide the ability to use symbolic names for memory locations (saving tedious calculations and manually updating addresses when a program is slightly modified), and macro facilities for performing textual substitution — typically used to encode common short sequences of instructions to run inline instead of in a subroutine.
Assemblers are far simpler to write than compilers for high-level languages, and have been available since the 1950s. Modern assemblers, especially for RISC based architectures, such as MIPS, Sun SPARCSPARC S calable P rocessor ARC hitecture) is a RISC microprocessor architecture originally designed in 1985 by Sun Microsystems. SPARC is a registered trademark of SPARC International, Inc. an organisation established in 1989 to promote the SPARC and to p and HP PA-RISC, optimize instruction schedulingIn computer science, instruction scheduling is a compiler optimization used to improve instruction-level parallelism, which improves performance on machines with instruction pipelines. Put more simply, it tries to rearrange the order of instructions so th to exploit the CPU pipeline efficiently.
High-level assemblerHigh-level assemblers are assembly language translators that incorporate features found in modern high-level languages into an assembler ( compiler for an assembly language). Examples of high-level assemblers include Microsoft's MASM, Borland's TASM, ands provide high-level-language abstractions such as advanced control structures, high-level procedure/function declarations and invocations, and high-level abstract data types including structures/records, unions, classes, and sets.Hundreds of assemblers have been written; some notable examples include:
It is important to note that each assembler has its own dialect within processor groups. Sometimes, some assemblers can read other assembler's dialect, for example, TASM can read old MASM code, but not the reverse. FASM and NASM have similar syntax, but each support different macros that could make them difficult to translate to each other. The basics are all the same, but the advanced features will differ.
Also, Assembly can be portable across different operating systems on the same type of CPU. Calling conventions between Windows and Linux differ slightly to none at all, and is possible to gain the same amount of portability between Linux and Windows as it is possible to gain the same amount of portability in higher languages, such as C++ and C. It is possible to even link assembly with C libraries, and write assembly code that compiles on any Operating System of the same CPU. Again, the portability is limited to the same CPU, and not across operating systems.
Computer programming tools Computer terminology Embedded systems