Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Can you please convert everything in to ARMSim# Assembly language, and also asnwer the question. Thank you. Instruction Set & Assembly Language (8 points) The
Can you please convert everything in to ARMSim# Assembly language, and also asnwer the question. Thank you.
Instruction Set & Assembly Language (8 points) The following is a sequence of MIPS instructions similar to one described in the section (But not exactly the same! Be careful!) (a) (7 points) Complete the table. Each row of the table should contain the state of the registers immediately after the instruction at the code line is completed Stop after reaching R Leave table entries blank until the first time a register is initialized/used Only make entries in the table when updating one of the four registers tracked (Ssp, Sra, Sa0, SvO) . Assume in the beginning of the run (lne J) the value of register Ssp is X (b) (1 point) What does this procedure do? Answer: This procedure computes the factorial of the value passed in Sa0. In this particular instance, it computes 2-2 1-2 addi, $a0, $zero, 2 R: # some more code J+4 PX-8 addi $sp, $sp, -8 P+4: Sw $ra, 4(Ssp) L+4 P X-16 P+12: slti $t0, $a0, 2 P+16 beq $to, $zero, L T+4X-8 addi $v0, $zero, 1 S+4 S+8X S+12 R. T+4 addi $sp, $sp, 8 T+8: jr $ra addi $a0, $a0, -1 jalP L+4 : lw $a0, (Ssp) S+4: lw $ra, 4($sp) S+8 addi $sp, $sp, 8 S+12: mul $vO, $a0, $v0 S+16: jr Sra Instruction Set & Assembly Language (8 points) The following is a sequence of MIPS instructions similar to one described in the section (But not exactly the same! Be careful!) (a) (7 points) Complete the table. Each row of the table should contain the state of the registers immediately after the instruction at the code line is completed Stop after reaching R Leave table entries blank until the first time a register is initialized/used Only make entries in the table when updating one of the four registers tracked (Ssp, Sra, Sa0, SvO) . Assume in the beginning of the run (lne J) the value of register Ssp is X (b) (1 point) What does this procedure do? Answer: This procedure computes the factorial of the value passed in Sa0. In this particular instance, it computes 2-2 1-2 addi, $a0, $zero, 2 R: # some more code J+4 PX-8 addi $sp, $sp, -8 P+4: Sw $ra, 4(Ssp) L+4 P X-16 P+12: slti $t0, $a0, 2 P+16 beq $to, $zero, L T+4X-8 addi $v0, $zero, 1 S+4 S+8X S+12 R. T+4 addi $sp, $sp, 8 T+8: jr $ra addi $a0, $a0, -1 jalP L+4 : lw $a0, (Ssp) S+4: lw $ra, 4($sp) S+8 addi $sp, $sp, 8 S+12: mul $vO, $a0, $v0 S+16: jr SraStep 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