In the early days of programming, most applications were partially or entirely written in assembly language. They had to adapt to small memory and run efficiently on slow processors. As memory capacity increased and processor speeds rapidly improved, programs became increasingly complex. Programmers also turned to high-level languages such as C, FORTRAN, COBOL, which offered many structured capabilities. Recently, object-oriented languages like Python, C++, C#, and Java have been able to write complex programs containing millions of lines of code. It is rare to see large applications completely written in assembly language, as they require a significant amount of time to write and maintain. However, assembly language can be used to optimize parts of an application’s code to enhance speed or to access computer hardware. The table below compares the adaptability of assembly language and high-level languages for various types of applications.
Application Type | High-Level Language | Assembly Language |
---|---|---|
Commercial or scientific applications written for a single medium or large platform | Structured specifications make it easy to organize and maintain large amounts of code | Minimal structured specifications, thus must be maintained by programmers with varying levels of experience. This leads to difficulties in maintaining existing code. |
Hardware device drivers | The language does not necessarily provide direct access to hardware. Even if it does, it may require complex coding techniques that are hard to control, leading to maintenance difficulties. | Direct and simple access to hardware. When the program is short and well-documented, it is easy to maintain. |
Commercial or scientific applications written for multiple platforms (different operating systems) | Generally portable. The source program can be recompiled with minimal modifications on each target operating system. | Requires rewriting code separately for each platform, as each assembler uses different syntax. Maintenance is difficult. |
Embedded systems and computer games that require direct access to hardware | May generate large executable files that exceed the device’s memory capacity. | Ideal, as the executable code is small and runs quickly. |
Both C and C++ languages have a unique feature that allows balancing between high-level structure and low-level details. Direct access to hardware is possible, but it is completely non-portable. Most C and C++ compilers allow embedding assembly statements in their code to provide access to hardware details.