Two steps to using Assembly in Linux (ubuntu 9.10)
⚠️ Update (2026) This article was originally written several years ago and uses older 32-bit Linux assembly methods. While the concepts are still useful for learning, modern Linux systems now use 64-bit architecture by default, and some commands shown below may no longer work as expected. ✅ Recommended Modern Approach * Use **64-bit assembly (`elf64`)** * Use **`syscall` instead of `int 0x80`**I * Use registers like `rax`, `rdi`, `rsi`, `rdx` 🔧 Quick Working Example (64-bit) ``` section .data msg db "Hello, world!", 10 len equ $ - msg section .text global _start _start: mov rax, 1 mov rdi, 1 mov rsi, msg mov rdx, len syscall mov rax, 60 xor rdi, rdi syscall ``` 🛠Compile & Run ``` nasm -f elf64 hello.asm -o hello.o ld hello.o -o hello ./hello ``` --- 📌 Note The original content below is kept unchanged for reference ...