Consider the following arithmetic operations in C: int X-20%3; int Y=20; int Z=2*(X+Y) which assembly code(0x86)...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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 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
Expert Answer:
Answer rating: 100% (QA)
best answer is a but c is also correct option explanation a mov ebx Y ebx 20 add eax ebx but ... View the full answer
Related Book For
Fundamentals of Digital Logic and Microcontrollers
ISBN: 978-1118855799
6th edition
Authors: M. Rafiquzzaman
Posted Date:
Students also viewed these programming questions
-
Perform the following arithmetic operations in binary using 6 bits. Assume all numbers are signed decimal. Use twos complement arithmetic. Indicate if there is any overflow. a. 14 +8 b. 07 +(-7)...
-
Carry out the following arithmetic operations: (a) The sum of the measured values 756, 37.2, 0.83, and 2.5; (b) The product 0.003 2 X 356.3; (c) The product 5.620 X .
-
Consider the following C code fragment: if (EAX == 0) EBX = 1; else EBX = 2; Write an equivalent NASM code fragment.
-
Use the graphs of f and g to solve Exercises 8390. Find (fg)(2). y = g(x) HH y .y = f(x) # X
-
Ethane (C2H6) is burned with 30% excess air during a combustion process. Assuming complete combustion and a total pressure of 100 kPa, determine. (a) The air-fuel ratio. (b) The dew point temperature...
-
On February 12, 2005, Nancy Trout and Delores Lake formed Kingfisher Corporation to sell fishing tackle. Pertinent information regarding Kingfisher is summarized as follows: ? Kingfisher?s business...
-
Give an explicit solution for the mean-reverting rnstein-Uhlenbeck SDE \[d X_{t}=\alpha\left(\mu-X_{t} ight) d t+\sigma d B_{t}\] with \(X_{0}=x\).
-
Sandra Lerner and Patricia Holmes were friends. One evening, while applying nail polish to Lerner, Holmes layered a raspberry color over black to produce a new color, which Lerner liked. Later, the...
-
Z QUESTIONS 1. As a junior member of your company's committee to explore new markets, you have received a memo from the chairper- son telling you to be prepared at the next meeting to discuss key...
-
Pats Pizzeria produces three types of deli style pizzas: Thin Crust, Deep Dish, and Stuffed Crust. Pats anticipated sales mix is 4:5:6 Thin:Deep:Stuffed. Current sales are 1,500 bundles per year....
-
In the context of South Africa's Public Financial Management(PFMA), if a chief financial officer(CFO) of a national government department wants to claim money for an emergency situation, what would...
-
Explain the major premise for using a factorial design.
-
Considering threats to internal validity, is a factorial design considered a "strong" design?
-
What are the different types of designs embedded in the Solomon N-group design?
-
Is the single-case approach as "powerful" as a traditional or classical experimental design?
-
Which factor best justifies the five-year forecast horizon for Omikroon selected by Fromm? A. Factor 1 B. Factor 2 C. Factor 3 Gertrude Fromm is a transportation sector analyst at Tucana Investments....
-
Purchase land worth $54,000 to create a community garden.To do this, you take out a 10-year loan, with an APR of 5.22%, compounded monthly, and requiring monthly payments of $505.(Assume the value of...
-
For each equation, (a) Write it in slope-intercept form (b) Give the slope of the line (c) Give the y-intercept (d) Graph the line. 7x - 3y = 3
-
Consider the 2-bit Johnson counter shown in Figure P5.27. Derive the state diagram. Assume the D flip-flops are initialized to A = 0 and B = 0. Clk D Clk Q Q A D Clk Q Q B
-
Simplify each of the following functions for F using a K-map. (a) F(W, X, Y, Z) = m(0, 1, 4, 5, 8, 9) (b) F(A,B,C,D) = m(0, 2, 8, 10, 12, 14) (c) F(A,B,C,D) = m(2, 4, 5, 6, 7, 10, 14) (d) F(W, X,...
-
Draw a logic circuit of the switch debouncer circuit using NAND gates.
-
The current price of gold is \(\$ 412\) per ounce. The storage cost is \(\$ 2\) per ounce per year, payable quarterly in advance. Assuming a constant interest rate of \(9 \%\) compounded quarterly,...
-
Complete the second half of the proof of the "forward price formula with carrying cost". To construct the arbitrage, go long one unit of a forward and short one unit spot. To execute the short, it is...
-
Suppose that a continuous-time compounding framework is used with a fixed interest rate \(r\). Suppose that the carrying charge per unit of time is proportional to the spot price; that is, the charge...
Study smarter with the SolutionInn App