Computer Science, asked by shubhambhandari130, 11 months ago

Consider the following arithmetic operations in C: int X-20; int Y-20; int Z-2*(X+Y) which assembly code(0x86) does not evaluate value for Z correctly? mov eax.X b) mov ebx. Y add eax ebx mov el.4 mov ebx.Y a) add eax.ebx mov cl.2 imul cl mov Z eax imul cl shr eax. 1 mov Z.eax d) mov eax.X mov ebx.Y add eax.ebx shl eax, I mov Z,eax mov eax X c) mov ebx,Y shl eax.2 shl eax.2 add eax.ebx

Answers

Answered by navkomal
3

here is your answer

hope it helps

Attachments:
Answered by tanvi524
13

Answer:

refer the following attachment

Here Question is the option which doesn't evaluate Z correctly then the answer is A

But, if you see which option doesn't evaluate Z then the Answer is C

c) Operation

It calculates the value . But, never stores the value in Z.

a) Operation

It evaluates the value of Z in-correctly.As, it never considers the value of X and without any check it adds the value of ebx i.e Y to eax .

hope it helps uh!!

Ty...Mark as BRAINLIST

Attachments:
Similar questions