Question: Consider the following arithmetic operations in C: int X-20%3; int Y=20; int Z=2*(X+Y) which assembly code(0x86) does not evaluate value for Z correctly? a)

Consider the following arithmetic operations in C: int X-20%3; int Y=20; int

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

Step by Step Solution

3.48 Rating (161 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

best answer is a but c is also correct option explanation a mov ebx Y ebx 20 add eax ebx but ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!