In this article at OpenGenus, we have explained how learning assembly instructions can be useful and who should learn it in this age of high level programming languages.
Example of Assembly instructions are VPOPCNT, XCHG, MOV, ADD and others.
Table of contents:
- Who should learn assembly instructions?
- Why learn assembly instructions?
- Assembly Instructions in Low level programming
- Assembly Instructions in Reverse Engineering
Who should learn assembly instructions?
Following people should learn assembly instructions:
- Anyone who works extensively in the field of Low level programming, Reverse engineering, Security, Embedded systems and Computer Architecture.
- If a Programmers uses C, C++ or Rust as their main programming language, then learning Assembly instruction is a big plus.
- Any Programmer who on optimizing code to the maximum level.
- Any programmer who is working with compilers.
Why learn assembly instructions?
The main reasons to learn assembly instructions in this age of high level programming languages are:
- Optimize code at a low level and do not depend on compiler optimizations only
- Reverse engineering a piece of software (mainly used in Computer forensics)
- Assembly instructions are frequently used in the development of Operating System and Compilers
- Development of Embedded systems
Assembly Instructions in Low level programming
If you are using C, C++ or Rust, you can use assembly instructions through intrinsics. With this, you are not dependent on compiler optimizations.
Today, compilers are highly optimized but it can slow down a highly optimized software as compilers are build to perform best in the major of the cases (not all cases).
Assembly Instructions in Reverse Engineering
If you aim to be in the field of Computer forensic, mastering assembly instructions is a must.
Whenever a program (As an executable) runs on a computer system, we (as an user) can have access to the generated assembly instructions but no access to the source code. If we have an unknown software, the only data we have is the assembly instructions and by analyzing it, one needs to infer everything.
Such situations can arise in different cases like:
- Computer virus
If a dangerous computer virus infects a major chunk of systems, the only safe way out is to crack the code of the virus by analyzing the assembly code and disable it.
- Software from competitor
If your competitor has released a highly optimized software and the optimizations are not known, the only way to decode it is to analyze the assembly instructions and reverse engineer the algorithms.
Note that even if you come to know about the optimizations, you may need to check if it is patented idea or not before using. Many expert programmers have come to know of trade secrets using this method.
- Understand hardware architecture
By analyzing the assembly instructions, one can easily get key information about the hardware without the need to disassembly the hardware.
With this article at OpenGenus, you must be able to judge better if you need to learn Assembly instructions.