Question
Hi I need to convert the following into C code. The following is the gdb output for ex2: 0x400773 mov $0x0, %eax 0x400778 mov $0x0,
Hi I need to convert the following into C code. The following is the gdb output for ex2:
0x400773 mov $0x0, %eax
0x400778 mov $0x0, %edx
0x40077d jmp 0x40078d
0x40077f cmp $0x61, %cl
0x400782 sete %cl
0x400785 movzbl %cl, %ecx
0x400788 dd %ecx, %eax
0x40078a add $0x1, %edx
0x40078d movslq %edx, %rcx
0x400790 movzbl (%rdi, %rcx, 1), %ecx
0x400794 test %cl, %cl
0x400796 jne 0x40077f
0x400798 repz retq
The code should be converted into the function
void ex2 () {}
where void should be replaced by int or other comparable data type and parameters should be inferred from the assembly
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started