Łańcuch narzędzi: asembler, linker i uruchamianie
Prześledź drogę pliku źródłowego asemblera — od tekstu do działającego programu — i dowiedz się, jak asembler, linker oraz loader współpracują, by zamienić mnemoniki w plik wykonywalny.
Łańcuch narzędzi: asembler, linker i uruchamianie to bezpłatna lekcja Assembly Language & x86 Low-Level Systems Programming na CoddyKit. To lekcja 4 z 4. Możesz przeczytać całą lekcję poniżej za darmo — a potem ćwiczyć ją interaktywnie w przeglądarce z wbudowanym edytorem kodu i tutorem AI dostępnym 24/7. To część ścieżki edukacyjnej Assembly Language & x86 Low-Level Systems Programming, a Twój postęp synchronizuje się między webem a aplikacją CoddyKit. Kurs Assembly Language & x86 Low-Level Systems Programming zawiera 4 lekcji w sumie.
Części tej lekcji nie zostały jeszcze przetłumaczone i są wyświetlane po angielsku.
From Mnemonics to Machine Code
You write assembly in mnemonics like MOV and ADD, but the CPU only speaks binary machine code. The toolchain bridges that gap.
Step 1: The Assembler
Step 1: the assembler translates each mnemonic into its machine-instruction bytes, producing an object file (.o or .obj).
nasm -f elf64 hello.asm -o hello.oObject Files
An object file holds machine code plus metadata — symbols, sections, relocations. It isn't runnable yet because addresses aren't final.
Sections
Code and data live in named sections: .text for instructions, .data for initialized data, .bss for uninitialized data.
Step 2: The Linker
Step 2: the linker combines object files, resolves the symbol references between them, and assigns final addresses to build the executable.
ld hello.o -o helloSymbols and Relocation
When code calls a label defined elsewhere, the assembler leaves a placeholder. The linker fills in the real address during relocation.
Step 3: The Loader
Step 3: when you run it, the OS loader maps the sections into memory, sets up the stack, and jumps to the entry point.
./helloThe Entry Point
Execution begins at a start symbol — typically _start for raw Linux assembly, or main when you link with the C runtime.
global _start
_start:Static vs Dynamic Linking
Static linking copies library code into the binary; dynamic linking loads shared libraries at run time, keeping the executable smaller.
Inspecting the Output
Inspect each stage: objdump disassembles, readelf shows headers and sections, and nm lists the symbols.
objdump -d helloPutting It Together
The full flow: assembler turns .asm into objects, the linker joins objects into an executable, and the loader runs it as a process.
Quick Check
Test your understanding of the toolchain.
Recap
You learned the toolchain: assembler makes objects, the linker resolves symbols into an executable, and the loader turns it into a running process.
Często zadawane pytania
Czy lekcja „Łańcuch narzędzi: asembler, linker i uruchamianie” jest bezpłatna?
Tak — pełny tekst „Łańcuch narzędzi: asembler, linker i uruchamianie” jest dostępny za darmo tutaj w sieci. Aby ćwiczyć ją interaktywnie (wbudowany edytor kodu i tutor AI dostępny 24/7) i odblokować resztę kursu Assembly Language & x86 Low-Level Systems Programming, przejdź na CoddyKit PRO. Kurs Assembly Language & x86 Low-Level Systems Programming zawiera 4 lekcji w sumie.
Co nauczysz się w „Łańcuch narzędzi: asembler, linker i uruchamianie”?
Prześledź drogę pliku źródłowego asemblera — od tekstu do działającego programu — i dowiedz się, jak asembler, linker oraz loader współpracują, by zamienić mnemoniki w plik wykonywalny. Ćwiczysz Assembly Language & x86 Low-Level Systems Programming z praktycznym kodem, który uruchamiasz bezpośrednio w przeglądarce, a tutor AI dostępny 24/7 odpowiada na Twoje pytania podczas pracy nad lekcją.
Czy potrzebuję doświadczenia, aby zacząć Assembly Language & x86 Low-Level Systems Programming?
Nie wymagamy żadnego doświadczenia. Assembly Language & x86 Low-Level Systems Programming w CoddyKit jest strukturyzowany dla początkujących i zaawansowanych użytkowników, więc możesz zacząć tutaj lub od początku i uczyć się w swoim tempie. To lekcja 4 z 4.
Ile czasu zajmuje lekcja „Łańcuch narzędzi: asembler, linker i uruchamianie”?
Większość lekcji CoddyKit trwa około 5–10 minut. Każda lekcja to mały, interaktywny krok, dzięki czemu robisz systematyczne postępy i zawsze wracasz dokładnie do tego samego miejsca — na webie i w aplikacji.
Czy mogę pisać i uruchamiać kod w tej lekcji Assembly Language & x86 Low-Level Systems Programming?
Tak. Każda lekcja Assembly Language & x86 Low-Level Systems Programming zawiera wbudowany edytor kodu, więc piszesz i uruchamiasz prawdziwy kod bezpośrednio w przeglądarce i od razu otrzymujesz sprzężenie zwrotne od AI — bez konfiguracji na komputerze.
Wszystkie lekcje w tym kursie
- Czym jest język asemblera?
- Podstawy architektury x86
- Pierwszy program w asemblerze
- Łańcuch narzędzi: asembler, linker i uruchamianie