在这里,在64位寻址做工精细SYS_WRITE呼叫与ARGS寄存器是一段代码,引起了我的问题: 为什么打算32位寻址
mystr:
.string "ABCDEFGH"
.set mystrlen, . - mystr
.text
.globl main
.type main, @function
main:
sub $0x10, %rsp
movq $0x44434241, 0x8(%rsp)
lea 0x8(%rsp), %rcx
movq $4, %rax
movq $1, %rbx
//movq $mystr, %rcx
//movq $mystrlen, %rdx
movq $4, %rdx
int $0x80
movq $1, %rax
movq $0, %rbx
int $0x80
代表片段不起作用,系统调用参数的64位寻址寄存器中的cuz应分别为rdi, rsi, rdx
,分别对应于第1,第2和第3系统调用参数,而不是rbx, rcx, rdx
(对于x86中的调用)。 但我为什么被注释掉的线与rbx, rcx, rdx
正常工作?
你见过[this](http://stackoverflow.com/questions/10105871/why-cant-i-sys-write-from-a-register) – t0mm13b
使用源代码并找出sys_write调用的位置实现。 – t0mm13b