Question: 7. (10 pt) The table on the right is declared in the data segment of a MIPS program. Ignore the details functions FO and F1,

7. (10 pt) The table on the right is declared in the data segment of a MIPS program. Ignore the details functions FO and F1, except that the return values from both FO or F1 are through S reister the return values are integers between 1 and 4 (inclusive) -ain segment of the details of register nd that la $1, 00 Ss0, 1 data rept: tw $82, ($s1) Jair $v1, $s2 wordFO ai sl $s0, $s0, 2 add $$1, $$1, $s0 $1, (Ss1) b rept 01 FO: a1 word F1 F1: when .b rept, instruction completes its execution for the first time, what values will be SsI and Ss2 as its result? a. Ss1: Ss2:- b. When 'b rept' instruction completes its execution for the second time, what values will be in SsI and Ss2? $s1: Ss2:_ (20 pt) A linked list node is declared as shown below. The function func00 has two arguments which are pointers to nodes, and is complied into MIPS as shown on the right. 8. #SaO has ptr, Sal has head funco: lw St0, (Sa0) w Stl, (Sal) struct nodet int c; struct node sw or Sal, 4(Sa0) Sal, Sa0, $0 next; Sra LI: jr Translate the MIPS codes above right to a pseudo-code in C-like syntax and with 'goto' statements, and write a C code corresponding to the func00 in MIPS above. Pseudo-C with 'goto C code void func0(struct node *ptr, struct node "head) void funco(struct node *ptr, struct node head)f 7. (10 pt) The table on the right is declared in the data segment of a MIPS program. Ignore the details functions FO and F1, except that the return values from both FO or F1 are through S reister the return values are integers between 1 and 4 (inclusive) -ain segment of the details of register nd that la $1, 00 Ss0, 1 data rept: tw $82, ($s1) Jair $v1, $s2 wordFO ai sl $s0, $s0, 2 add $$1, $$1, $s0 $1, (Ss1) b rept 01 FO: a1 word F1 F1: when .b rept, instruction completes its execution for the first time, what values will be SsI and Ss2 as its result? a. Ss1: Ss2:- b. When 'b rept' instruction completes its execution for the second time, what values will be in SsI and Ss2? $s1: Ss2:_ (20 pt) A linked list node is declared as shown below. The function func00 has two arguments which are pointers to nodes, and is complied into MIPS as shown on the right. 8. #SaO has ptr, Sal has head funco: lw St0, (Sa0) w Stl, (Sal) struct nodet int c; struct node sw or Sal, 4(Sa0) Sal, Sa0, $0 next; Sra LI: jr Translate the MIPS codes above right to a pseudo-code in C-like syntax and with 'goto' statements, and write a C code corresponding to the func00 in MIPS above. Pseudo-C with 'goto C code void func0(struct node *ptr, struct node "head) void funco(struct node *ptr, struct node head)f
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
