top of page

Lab3 Cont. Adding additional arguments to printf

Writer: jadach1jadach1

modified printf to

printf("Hello World %d , %d , %d , %d , %d , %d , %d , %d , %d , %d \n", 1, 2,3,4,5,6,7,8,9,10 );


compiled using gcc -g -o0 -fno-builtin $file -o $output


Which provided the following output after running objdump

============================================================


00000000004004e6 <main>:

#include <stdio.h>


int main() {

4004e6: 55 push %rbp

4004e7: 48 89 e5 mov %rsp,%rbp

printf("Hello World %d , %d , %d , %d , %d , %d , %d , %d , %d , %d \n", 1, 2,3,4,5,6,7,8,9,10 );

4004ea: 48 83 ec 08 sub $0x8,%rsp

4004ee: 6a 0a pushq $0xa

4004f0: 6a 09 pushq $0x9

4004f2: 6a 08 pushq $0x8

4004f4: 6a 07 pushq $0x7

4004f6: 6a 06 pushq $0x6

4004f8: 41 b9 05 00 00 00 mov $0x5,%r9d

4004fe: 41 b8 04 00 00 00 mov $0x4,%r8d

400504: b9 03 00 00 00 mov $0x3,%ecx

400509: ba 02 00 00 00 mov $0x2,%edx

40050e: be 01 00 00 00 mov $0x1,%esi

400513: bf b0 05 40 00 mov $0x4005b0,%edi

400518: b8 00 00 00 00 mov $0x0,%eax

40051d: e8 ce fe ff ff callq 4003f0 <printf@plt>


============================================================


 
 
 

Recent Posts

See All

Closing Thoughts

For my final blog post I would like to discuss what I have learned and plan to utilize in the future from this course. So although I was...

Comments


bottom of page