Assembly Language is a low-level programming language specific to a certain computer architecture.
This low-level programming Language is also known as Assembler or simply ASM is used primarily in programmable devices and computers. Therefore Assembly Language is not very a good candidate when it comes to portability of computer programs and device drivers and other binaries.
Portability is a feature of high-level programming languages which normally hides the computer architecture implementations from the programmer. This is done by wrapping the language instructions behind dynamic or static libraries and through run-time environments. Assembly language and other low-level languages do not really do this. That is where we make the distinction.
Getting Started with Assembly Language
The Assembler commands also known as Opcode mnemonics and extended mnemonics among other terms are usually one-to-one mappings of the specific computer architecture’s machine code. This mapping is done through the machine language instruction sets. The following is an example of a single instruction set in x86 ASM.
Mov EAX, 10
What the programmer writes is converted to the actual machine language using a tool called an assembler. A good example of such x86 assemblers are but not limited to NASM or The Netwide Assembler which is cross-platform and MASM or Microsoft Macro Assembler which only works for Microsoft Windows and Ms-Dos operating systems.
What is Machine Language?
Machine Language in the simplest terms is a series of 0s and 1s in certain orders that can be interpreted by the specific computer or device architecture it has been designed for. Machine Language is difficult for a human being to work with directly and therein lies the case for the use of low level and high-level programming languages that abstract this fact via assemblers and compilers.
Assemblers have generally been around much longer than compilers. One of the reasons was the assemblers have always been easier to build taking into account the one-to-one mapping from assembly to machine language. Compilers, on the other hand, are more complex as they have to convert the high-level language code to either assembly, bytecode or object code among others.
What are the Advantages or Learning Assembly Language?
- Usage of ASM in reverse engineering software. Most software that needs reversing is that which is distributed in binary. With the use of debuggers, de-compilers, and disassemblers the resulting code is normally in the form of Assembly.
- Used in certain optimization embedded in other languages such as C and C++. This is normally when the programmer wants to fine-tune control of whatever they are writing.
- Certain levels of debugging and software auditing. The knowledge of Assembly is key n allowing the engineer to diagnose and root out bugs and vulnerabilities in a software where the source code is not available
- Bios and another microprocessor programming. The use of assembly is critical in Bios programming and coding for programmable devices. These are normally devices that do not rely on an underlying operating system and therefore must talk to the bare metal hardware
- Certain aspects of the Linux operating system kernel also require the skills in Assembly
- To understand how computer programs work at low/machine levels as well as how memory, CPUs, GPUs and hardware in general work
- Compiler and debugger design and development would need these critical skills as well
- Working with Self-modifying code is usually implemented at low-level and therefore again a critical requirement of writing such code is Assembly Language
- Certain device driver programming or most of it is done in Assembly language
- Where complete control and security over the run-time environment is required and this is also important when you need to de-link with operating systems and run-time environments
- Coding in situations where no underlying operating system exists or when you need to bypass the operating system. This is true in certain aspects of graphics programming, audio programming and so on.
- Ability to write low-level libraries and frameworks such as those for networking, graphics, audio, and other peripherals
We have just scratched the surface on this topic by addresses minor and basic aspects in this article. We will be dealing with this topic more in-depth through an upcoming Assembly Language programming tutorial series in the next few weeks. Meanwhile, you can have a look at the following resources for further Reading: