ITeye博客

x86汇编入门

splayx · 2014-12-01 19:51 · 汇编 · 编程语言 · Markdown

section .data
msg:
db "hello, world", 10
len equ $-msg

section .text
global main
main:
mov edx, len
mov ecx, msg
mov ebx, 1
mov eax, 4
int 0x80

mov ebx, 0
mov eax, 1
int 0x80

 

nasm -f elf64 -l hello.lst -g -O0 hello.asm

gcc -g -O0 -o hello hello.o

 

gdb:

set language asm

set disassembly-flavor intel

define nd

nexti

disassemble

end

 

gdb hello

source gdb

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。