Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. (15 pts) For the following C statement, what is the corresponding MIPS assembly code? Assume f, g, h correspond to $so, $sl, and $s2,

image text in transcribed
image text in transcribed
1. (15 pts) For the following C statement, what is the corresponding MIPS assembly code? Assume f, g, h correspond to $so, $sl, and $s2, respectively. f=g+(h-5) 2. (15 pts) For the following pseudo-MIPS assembly instructions, what is the corresponding C code? add f, g, h I add f,i, f 3. (15 pts) For the following C statement, what is the corresponding MIPS code? Assume i andj correspond to $so, and $sl, and the base address of A and B corresponds to $s2 and $s3, respectively. B[8] = A[i-j] 4. (15 pts) Provide the instruction type, assembly language instruction, and binary representation of the instruction described by the following MIPS fields: op = 0, rs = 3, rt=2, rd = 3, shamt = 0, funct = 34 5. (15 pts) What is the decimal value of the following signed 16-bit number: 1. 8000 (hex) 2. 8020 (hex) 6. (25 pts each) Consider the following MUPS loop: LOOP: slt $t2, Szero, $ti beg $t2, $zero, DONE addi $t1,$t1, -1 addi $81, $si, 2 j LOOP DONE: 1. Write comments for each line, at the right side of above table. 2. Assume that the register $t1 is initialized to the value 2. What is the value in register $sl assuming $sl is initially zero? 3. Write the equivalent C code routine (there is no difference from Java). Assume that the registers $sland St1 are integers A and i, respectively

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

Materiality In Financial Reporting An Integrative Perspective

Authors: Francesco Bellandi

1st Edition

178743737X, 9781787437371

More Books

Students also viewed these Accounting questions

Question

How do cultural norms affect our behaviorpg18

Answered: 1 week ago