汇编语言寄存器更改

时间:2014-10-29 16:50:41

标签: linux assembly operating-system

我在ubuntu 14.04 LTS 64bit上运行汇编语言64位代码

global _start

section .text
_start:
    ;display on screen
    mov rax, 1
    mov rdi, 1
    mov rsi, message
    mov rdx, length
    syscall

    ;exit gracefuly
    mov rax, 60
    mov rdi, 11
    syscall

section .data
    message: db 'Hello world!',0xa
    length: equ $-message

但是当我使用gdb对它进行反汇编时,它分别倾销了rax,rdi,rdx,rax和rdi寄存器的eax,edi,edx,eax和edi寄存器......

Dump of assembler code for function _start:
   0x00000000004000b0 <+0>:     mov    eax,0x1
   0x00000000004000b5 <+5>:     mov    edi,0x1
   0x00000000004000ba <+10>:    movabs rsi,0x6000d8
   0x00000000004000c4 <+20>:    mov    edx,0xd
   0x00000000004000c9 <+25>:    syscall 
   0x00000000004000cb <+27>:    mov    eax,0x3c
   0x00000000004000d0 <+32>:    mov    edi,0xb
   0x00000000004000d5 <+37>:    syscall 
End of assembler dump.

为什么会这样?

0 个答案:

没有答案