# AssemblyTutorials **Repository Path**: xiaowu-army/assembly_tutorials ## Basic Information - **Project Name**: AssemblyTutorials - **Description**: 这是一个用于存放汇编代码的仓库 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-12-22 - **Last Updated**: 2025-12-22 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 汇编实验 ## nasm -f elf main.asm 这行命令是 编译汇编源码。 nasm:是 Netwide Assembler,一个非常流行的汇编器。 -f elf:告诉 NASM 生成 ELF 格式(Executable and Linkable Format) 的目标文件。 ELF 是 Linux 系统中常用的目标文件/可执行文件格式。 main.asm :是你写的汇编源码文件。 ## ld -m elf_i386 main.o -o main 这行命令是 链接(linking)阶段。 ld :是 GNU 链接器(linker)。 -m elf_i386 :指定目标架构是 32位 x86 架构(因为默认 Ubuntu 是 64 位,必须手动指定)。 main.o :刚才生成的目标文件。 -o main :指定输出文件名为 main(最终的可执行文件)。