13

While debugging one of the assembly code examples, I found following piece of information:

   (gdb) x /10i 0x4005c4
   0x4005c4:    push   %rbp
   0x4005c5:    mov    %rsp,%rbp
   0x4005c8:    sub    $0xa0,%rsp
   0x4005cf:    mov    %fs:0x28,%rax
   0x4005d8:    mov    %rax,-0x8(%rbp)
   0x4005dc:    xor    %eax,%eax
   0x4005de:    movabs $0x6673646c6a6b3432,%rax
   0x4005e8:    mov    %rax,-0x40(%rbp)
   0x4005ec:    movl   $0x323339,-0x38(%rbp)
   0x4005f3:    movl   $0x553059,-0x90(%rbp)

As per my understanding movabs should not be used, it seems like it was introduced intentionally. Am I right in my understanding?

What should be the equivalent MOV command to replace it?

CDspace
  • 2,639
  • 18
  • 30
  • 36
Mangoman_123
  • 131
  • 1
  • 1
  • 3

1 Answers1

7

As a direct copy from this question: https://reverseengineering.stackexchange.com/questions/2627/what-is-the-meaning-of-movabs-in-gas-x86-att-syntax

[...] The movabs instruction to load arbitrary 64-bit constant into register and to load/store integer register from/to arbitrary constant 64-bit address is available.

http://www.ucw.cz/~hubicka/papers/amd64/node1.html

It does exactly what you'd expect from it - it puts the immediate into the register.

Mark Segal
  • 5,427
  • 4
  • 31
  • 69