39.9k views
4 votes
1. Assume that registers $s0 and $s1 hold the values 0×80000000 and 0×00000000, respectively. What is the value of $ to for the following assembly code i. add $t0,$s0,$s1 ii. sub $to,$ s0,$ s1 2. Provide the type, assembly language instruction, and binary representation of instruction described by the following mips fields. i. Op=0,rs=3,rt=2,rd=3, shamt =0, funct =34 ii. Op=0×23,rs=1,rt=2,cost=0×4 1. Assume $t0 holds the value 0x00101000. What is the value of $t2 after the following instructions? SIt \$t2, \$0, \$to Bne \$t2, \$0, Else J Done ELSE: addi $t2,$t2,2 DONE: 2. Consider the following MIPS loop LOOP: slt \$t2, $0,$t1 beq $t2,$0, DONE subi \$t 1,$t1,1 addi $s2,$s2,2 j LOOP DONE: i. Assume the register $t1 is initialized to the value 10 and $s2 is initially zero. What is the value in register $2. ii. Write the equivalent C code routine. Assume $s2,$+1 and $+2 are integers B, i, and temp respectively 3. i. Translate the following c code to mips assembly code. Use a minimum number of instructions. Assume that the values a,b,I and j are in registers $50,$s1,$ to, and $t1, respectively. Also assume that register $s2 holds the base address of the array D. for (i=0;i

User Sam Bevins
by
8.8k points

1 Answer

4 votes
The answer is b because th
User Bridget
by
8.1k points