Description #
Assembly language is a low-level programming language that provides direct control over a computer’s hardware using symbolic code that closely corresponds to machine instructions.
History #
Assembly emerged in the 1940s and 1950s as a readable alternative to raw binary machine code. Early pioneers like Kathleen Booth and David Wheeler used it to program the first stored-program computers. Every CPU architecture (x86, ARM, MIPS, etc.) has its own unique assembly language. It played a foundational role in early computing and continues to be used in system bootloaders, embedded programming, and performance-critical software.
Hello World Code #
section .data
msg db "Hello, World!", 0Ah
section .text
global _start
_start:
mov edx, 14 ; message length
mov ecx, msg ; message to write
mov ebx, 1 ; file descriptor (stdout)
mov eax, 4 ; syscall number (sys_write)
int 0x80 ; make kernel call
mov eax, 1 ; syscall number (sys_exit)
xor ebx, ebx ; exit code 0
int 0x80
How to Run #
Option 1: Online
https://tio.run/##S0pKzv7/PyU1JzEsvyUlPTczJT9E3sDQwTq1QsFCpBQowCjQz0jczS1PwzEvMTVXI1wUAc7cFeg==
Option 2: Local
- Install NASM
- Compile and run: bashCopyEdit
nasm -f elf32 hello.asm ld -m elf_i386 -s -o hello hello.o ./hello
Key Concepts #
- Syntax style: Mnemonic opcodes (e.g.,
mov
,add
) - Typing discipline: N/A (low-level, typed by hardware)
- Execution model: Direct execution on CPU
- Common use cases: Bootloaders, embedded systems, performance optimization
- Toolchain or ecosystem: NASM, GAS, MASM, debugger tools (GDB)
- Paradigms supported: Imperative
- Compilation details: Translated to machine code using an assembler
- Strengths or quirks: Maximal performance and control, very verbose
- Libraries/frameworks: None (bare-metal)
- Community/adoption: Specialized, still active in OS dev and embedded communities
Try It Online #
Fun Facts #
Assembly language is often used in programming competitions like IOCCC and remains crucial for understanding how computers work at the hardware level. Some malware and reverse engineering still require reading raw assembly.