Microsoft Store
 

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.

Usage of assembly language

There is some debate over the usefulness of assembly language. It is often said that modern compilers can render higher-level languages into codes that run as fast as hand-written assembly, but counter-examples can be made, and there is no clear consensus on this topic. It is reasonably certain that, given the increase in complexity of modern processors, effective hand-optimization is increasingly difficult and requires a great deal of knowledge.

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

However, some discrete calculations can still be rendered into faster running code with assembly, and some low-level programming is simply easier to do with assembly. Some system-dependent tasks performed by operating systems simply cannot be expressed in high-level languages. In particular, assembly is often used in writing the low level interaction between the operating system and the hardware, for instance in device drivers. Many compilers also render high-level languages into assembly first before fully compiling, allowing the assembly code to be viewed for debugging and optimization purposes.

Related Topics:
Operating systems - Device drivers

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

It's also common, especially in relatively low-level languages such as C, to be able to embed assembly language into the source code with special syntax. Programs using such facilities, such as the Linux kernel, often construct abstractions where different assembly language is used on each platform the program supports, but it is called by portable code through a uniform interface.

Related Topics:
C - Linux kernel

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

Many embedded systems are also programmed in assembly to obtain the absolute maximum functionality out of what is often very limited computational resources, though this is gradually changing in some areas as more powerful chips become available for the same minimal cost.

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

Another common area of assembly language use is in the system BIOS of a computer. This low-level code is used to initialize and test the system hardware prior to booting the OS and is stored in ROM. Once a certain level of hardware initialization has taken place, code written in higher level languages can be used, but almost always the code running immediately after power is applied is written in assembly language. This is usually due to the fact that system RAM may not yet be initialized at power-up and assembly language can execute without explicit use of memory, especially in the form of a stack.

Related Topics:
BIOS - ROM - RAM - Stack

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

Computer systems vendors may charge high prices for compiler language runtime libraries, thereby

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

virtually assuring not every installation supports applications that are written in a particular language, except assembly language. Under this

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

premise, assembly language is forced on Independent Software Vendors to keep the prospective

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

buyer's costs down. What is good from a software engineering viewpoint is bad for business.

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

Assembly language is also valuable in reverse engineering, since many programs are distributed only in machine code form, and machine code is usually easy to translate into assembly language and carefully examine in this form, but very difficult to translate into a higher-level language. Tools such as the Interactive Disassembler make extensive use of disassembly for such a purpose.

Related Topics:
Reverse engineering - Interactive Disassembler

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

Assembly language is also the primary programing language of MenuetOS, a floppy-based system with a fully functional GUI. The author claims that only through assembly language could he produce his system in less than 1.4 megabytes.

~ ~ ~ ~ ~ ~ ~ ~ ~ ~