Question: Homework #1 Due Feb. 22 (a write MIPs assembly code that will execute the following c statement. Assume that the c following registers are used
Homework #1 Due Feb. 22 (a write MIPs assembly code that will execute the following c statement. Assume that the c following registers are used to represent the variables: a in register sso, b in register ssl, and in register Ss2 a (a b) (c-33) (b) Replace the C code for by a set of equivalent MIPs instructions, using as few instructions as possible. Assume that h is in register S8, and the staring addresses for arrays a and in registers respectively. (c) Replace the C code for by a set of equivalent MIPS instructions, using as few instructions as possible. Assume that f and g are in register Sti and St0 respectively, and the staring addresses for arrays A and Bare stored in registers Sao and Sal, respectively. (a) Follow the instructions below CONSECUTIVELY, and after each instruction write the value of destination register in decimal into the space provided. ori Ss1, Szero, 2 assi- sll $s2, Ss1, 3 andi Ss3, $s2, 19 #$s3 4- (b) Translate the following C statement into the corresponding MIPS code. Assume that the variables f and g are assigned to registers Ss0 and Ssl, the base address of the arrays A and B and are in register Ss6 and Ss7, respectively. 3. Memory (a) How many locations of memory can you address with 16-bit address? (b) How many bits are required to address a 4 Mega location memory, ie, what is the length of the memory address
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
