安裝軟件
# 安裝nasm匯編編譯器:nasm
yum install nasm
# 安裝gas匯編編譯器:as
yum install binutils*
第一個(gè)匯編程序
section .text
global main
main:
mov eax,4
mov ebx,1
mov ecx,msg
mov edx,14
int 80h
mov eax,1
int 80h
msg:
db "Hello World!",0ah,0dh
編譯,鏈接和執(zhí)行程序唯竹。
$> nasm -f elf hello.asm
$> ld -m elf_i386 -s -o hello hello.o
$> ./hello