Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Help with assembly questions start: PUSH EBP MOV EBP, ESP MOV ECX, [EBPtarg_0] MOV ESI, [EBP+arg-4 ] MOV[EBP+var1], 0 UMP loc 2 loc 1 MOV

Help with assembly questions

image text in transcribed

start: PUSH EBP MOV EBP, ESP MOV ECX, [EBPtarg_0] MOV ESI, [EBP+arg-4 ] MOV[EBP+var1], 0 UMP loc 2 loc 1 MOV EAX, [EBP+ar 1] ADDEAX, ECX MOV EDX, byte ptr [EAX] XOREDX, ESI MOV [EAX], DL ADD [EBP+var_1], 0x1 loc 2: MOV EAX, [EBP+var 1] CMP byte ptr [ECX EAX], 0 JNZloc 1 MOV ESP, EBP POP EBP RETN 2.1)In a few sentences, explain what this function does 2.2)Write a function in C that is equivalent to the assembly above int func2(char arg_0, int arg_4) // Your code goes here 2.3) Let arg_0 be a pointer to the null-terminated string xa1 xd7 xd7 xae xff xe5 xfcle4 xa0xc5\xdblxe1" and let arg_4 be the integer 0x96 What is the value of the string pointed to by arg 0 when the function completes? What value does the function return? start: PUSH EBP MOV EBP, ESP MOV ECX, [EBPtarg_0] MOV ESI, [EBP+arg-4 ] MOV[EBP+var1], 0 UMP loc 2 loc 1 MOV EAX, [EBP+ar 1] ADDEAX, ECX MOV EDX, byte ptr [EAX] XOREDX, ESI MOV [EAX], DL ADD [EBP+var_1], 0x1 loc 2: MOV EAX, [EBP+var 1] CMP byte ptr [ECX EAX], 0 JNZloc 1 MOV ESP, EBP POP EBP RETN 2.1)In a few sentences, explain what this function does 2.2)Write a function in C that is equivalent to the assembly above int func2(char arg_0, int arg_4) // Your code goes here 2.3) Let arg_0 be a pointer to the null-terminated string xa1 xd7 xd7 xae xff xe5 xfcle4 xa0xc5\xdblxe1" and let arg_4 be the integer 0x96 What is the value of the string pointed to by arg 0 when the function completes? What value does the function return

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Sams Teach Yourself Beginning Databases In 24 Hours

Authors: Ryan Stephens, Ron Plew

1st Edition

067232492X, 978-0672324925

More Books

Students also viewed these Databases questions

Question

need help with the boxes that are left blank Data table Reference

Answered: 1 week ago

Question

Explain the factors that determine the degree of decentralisation

Answered: 1 week ago

Question

What Is acidity?

Answered: 1 week ago

Question

Explain the principles of delegation

Answered: 1 week ago

Question

State the importance of motivation

Answered: 1 week ago

Question

Discuss the various steps involved in the process of planning

Answered: 1 week ago