Sunday, October 5, 2008

QUESTION #4

Justify what situations or applications programmers will rather use Assembly Languages than Higher Level Progamming Languages and vice versa.



When a stand-alone binary executable is required, i.e. one that must execute without recourse to the run-time components or libraries associated with a high-level language; this is perhaps the most common situation. These are embedded programs that store only a small amount of memory and the device is intended to do single purpose tasks. Such examples consist of telephones, automobile fuel and ignition systems, air-conditioning control systems, security systems, and sensors.
When interacting directly with the hardware, for example in device drivers.
When using processor-specific instructions not exploited by or available to the compiler. A common example is the bitwise rotation instruction at the core of many encryption algorithms.
Embedded systems.
When extreme optimization is required, e.g., in an inner loop in a processor-intensive algorithm. Some game programmers are experts at writing code that takes advantage of the capabilities of hardware features in systems enabling the games to run faster.
When a system with severe resource constraints (e.g., an embedded system) must be hand-coded to maximize the use of limited resources; but this is becoming less common as processor price/performance improves
When no high-level language exists, e.g., on a new or specialized processor
Real-time programs that need precise timing and responses, such as simulations, flight navigation systems, and medical equipment. (For example, in a fly-by-wire system, telemetry must be interpreted and acted upon within strict time constraints. Such systems must eliminate sources of unpredictable delays – such as may be created by interpreted languages, automatic garbage collection, paging operations, or preemptive multitasking. Some higher-level languages incorporate run-time components and operating system interfaces that can introduce such delays. Choosing assembly or lower-level languages for such systems gives the programmer greater visibility and control over processing details.)
When complete control over the environment is required (for example in extremely high security situations, where nothing can be taken for granted).
When writing computer viruses, bootloaders, certain device drivers, or other items very close to the hardware or low-level operating system.
When reverse-engineering existing binaries, which may or may not have originally been written in a high-level language, for example when cracking copy protection of proprietary software.
Reverse engineering and modification of video games (known as ROM Hacking), commonly done to games for Nintendo hardware such as the SNES and NES, is possible with a range of techniques, of which the most widely employed is altering the program code at the assembly language level.
Assembly language is still used for writing games and other software for graphing calculators.
Finally, compiler writers usually write software that generates assembly code, and should therefore be expert assembly language programmers themselves.

REFERENCE:
WIKIPEDIA.ORG

No comments: