File tree Expand file tree Collapse file tree 5 files changed +5
-12
lines changed Expand file tree Collapse file tree 5 files changed +5
-12
lines changed Original file line number Diff line number Diff line change 88
99[ What is stack frame] ( https://stackoverflow.com/questions/3699283/what-is-stack-frame-in-assembly )
1010
11- [ C headers in Asm ] ( http ://thomasloven .com/blog/2012/06/C-Headers-In-Asm/ )
11+ [ Linux clobbered registers ] ( https ://stackoverflow .com/questions/69515893/when-does-linux-x86-64-syscall-clobber-r8-r9-and-r10 )
1212
1313```
1414/usr/include/asm-generic/fcntl.h
Original file line number Diff line number Diff line change 33define hook-quit
44 set confirm off
55end
6- break main
6+ break print_int
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ run: build
66 ./print_int
77
88check : build
9- ./print_int | md5sum | grep -q ^0d0f199 && printf " \033[1;32m[OK]\033[0m\n"
9+ ./print_int | md5sum | grep -q ^3cca2fa && printf " \033[1;32m[OK]\033[0m\n"
1010
1111clean :
1212 rm -f print_int
Original file line number Diff line number Diff line change 1616 mov $6 , %r11
1717 mov $7 , %rdi
1818 mov $8 , %rdx
19- mov $255 , %rsi
20-
21- push %rsi
22- log %rsi
19+ mov $9 , %rsi
2320
2421 log %rax
2522 log %rbx
4340 log %rdx
4441 log %rsi
4542
46- pop %rsi
47- log %rsi
48-
4943exit:
5044 movq $EXIT, %rax
5145 movq $0 , %rdi
Original file line number Diff line number Diff line change @@ -104,10 +104,9 @@ write_string:
104104print_int:
105105 enter
106106
107- mov 16 (%rbp ), %rsi # param: number to print
108-
109107 sub $48 , %rsp
110108 push_all
109+ mov 16 (%rbp ), %rsi # param: number to print
111110 push %rax
112111
113112 mov $0 , %rcx
You can’t perform that action at this time.
0 commit comments