Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Consider the following fragment of C code: if (A > B) C(A+B) elset C-(A+B) Consider the following constraints to answer this question. Assume that A,
Consider the following fragment of C code: if (A > B) C(A+B) elset C-(A+B) Consider the following constraints to answer this question. Assume that A, B, and C are 64-bit integers. Use instructions for 64t irseg use DADD (for 64-bip instcad of ADD (or 32-6i0) All data values are kept in memory (at addresses 2000, 2008, and 2016 for A, B, and C, respec- tively). Assume that 4, 8, and 10 are stored in the memory addresses 2000, 2008, and 2016 respectively You must use BNE or BEQ instruction for the branching. (Hint: See SLT (Set-on-Less-Than) instruction. MIPS reference: http://www.mrc.uidaho.edu/mrc/people/jff/digital/MIPSir.html) In the next page, write your answers for the following questions: (a) Write the code in MIPS assembly (b) How many instructions are executed dynamically? (c) How many memory-data references will be executed? (d) What is the code size in bytes? (Count only the bytes for instructions.)
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