Question: Write the C code that produces the assembly code: (gdb) x/8x 0x4005b8 0x4005b8: 0x00000000004004e6 0x0000000000400516 0x4005c8: 0x00000000004004ed 0x0000000000400502 0x4005d8: 0x00000000004005160x0000000000400509 0x4005e8: 0x0000000000400516 0x000000000040050f Dump of

Write the C code that produces the assembly code:

Write the C code that produces the assembly code: (gdb) x/8x 0x4005b8

(gdb) x/8x 0x4005b8 0x4005b8: 0x00000000004004e6 0x0000000000400516 0x4005c8: 0x00000000004004ed 0x0000000000400502 0x4005d8: 0x00000000004005160x0000000000400509 0x4005e8: 0x0000000000400516 0x000000000040050f Dump of assembler code for function main: push mov mov mov mov %rdX,-8x28 (%rbp) mov-0x18 (%rbp),%rax mov %rax,-0x8(%rbp) mov-0x20 (%rbp),%rax sub cmp %rbp %rsp,%rbp %rdi,-0x18(%rbp) %rsi,-9x20(%rbp) 0x00000000004004b6 : 0x00000000004004ba : 0x00000000004004be : 0x00000000004004c6 : 0x00000000004004ca(+20> : Ox00000000004004ce : $exd,%rax $0x7,%rax 0x00000000004004d6 : 0x00000000004004da 0x00000000004004dc : mov -0x8(Xrbp), 0x00000000004004f1 0x00000000004004f4 0x00000000004004f8 0x00000000004004fe(+72> : mov %rax,-0x8(Xrbp) 0x0000000000400502 jmpx40051e

0x0000000000400509 0x000000000040050d 0x000000000040050f 0x0000000000400516 : mov-0x8 (%rbp),%rdx 0x0000000000400526(+112> : mov %rdx, (Arax) 0x0000000000400529(+115); pop %rbp 0x000000000040052a retq jmp 0x40051e
mov sh! add add %rdx,%rax $0x2,Arax %rdx.xrax %rax,%rax shlq -0x8(&rbp) Jmp 0x40051e
jmp 0x40051e

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!