Types of computer codes, from more computer-friendly to human-friendly:
- Machine code
- Assembly language
- Source code
Assembly language is sometimes known as assembler language or symbolic machine code, and commonly abbreviated with the acronym ASM.
Early computer programs were written in assembly language, as programming languages did not exist yet.
Assembly language is unique for each processor architecture (x86, ARM, ARM64, etc.). Portability of assembly languages is complicated.
However, some syntax is common to different architectures, such as the AT&T syntax. On the other hand, other syntax are specific to an architecture, such as the Intel syntax for the x86 architecture.
Assembly language is relevant even nowadays in the following computer science fields:
- Compilers (and related toolchains)
- Reverse engineering
- OS kernel development
- Very low level embedded programs
An assembler is a computer program that translates assembly language to machine language.
An assembly language has different type of operations:
- Pseudo-operation
A pseudo-operation, colloquially known as pseudo-op, is an instruction for the assembler that does not generate any machine code.
The pseudo-ops cannot recovered by disassemblers because they are no traces of it within the machine code.
The pseudo-ops are not necessarily defined in the assembly syntax (e.g., x86) and are dependant of the assemblers. Because of this, pseudo-ops may vary significantly from one assembler to another.
Assembly Language and OSs
There are some assembly language calls that are universal for all OSs and other that are OS-specific.
Universal aspects:
- Registers
- Basic instructions
- Math/logic operations
OS-dependent aspects:
- System Calls: How to print, read files, allocate memory.
- Direct hardware access: e.g. writing to the video card.
- Memory/ABI (Calling Conventions): Register usage, stack rules.
- Executable Structure: Headers, sections, linking.
Assembler Software
You can read this post about assembler software.
Assembly Languages for specific Processor Families
Assembly language are very close to the processor architecture. Because of this, an assembly language is aimed to a specific processor family.
In addition, there are many possible assembly languages for a given processor family.
x86 Assembly Language
You can read this post about x86 assembly language.
External References
- YASM
- Tortall Network; “Yasm User Manual“; Tortal Network