x86汇编入门

 

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

 

你可能感兴趣的:(入门)