Question: .data n: .word 13 .text main: add $t0, $0, $zero addi $t1, $zero, 1 la $t3, n lw $t3, 0($t3) fib: beq $t3, $0, finish

.data
n: .word 13
.text
main: add $t0, $0, $zero
addi $t1, $zero, 1
la $t3, n
lw $t3, 0($t3)
fib: beq $t3, $0, finish
add $t2,$t1,$t0
move $t0, $t1
move $t1, $t2
subi $t3, $t3, 1
j fib
finish: addi $a0, $t0, 0
li $v0, 1 # you will be asked about what the purpose of this line for syscall
syscall
li $v0, 10
syscall
Q1. What do the .data, .word, .text directives mean (i.e., what do you put in each section)? Q2. How do you set a breakpoint in MARS? Set breakpoint on line 15, give the command in your answer. Q3. After your program stops because of a breakpoint, how do you continue to execute your code? How do you step through your code? Q4. How can you find out the contents of a register? How do you modify the value of a register? Q5. At what address is n stored in memory? Calculate the 13th fib number by modifying this memory location. Q6. line 18 and 20 use syscal1 instruction. What is it and how do you use it? Q1. What do the .data, .word, .text directives mean (i.e., what do you put in each section)? Q2. How do you set a breakpoint in MARS? Set breakpoint on line 15, give the command in your answer. Q3. After your program stops because of a breakpoint, how do you continue to execute your code? How do you step through your code? Q4. How can you find out the contents of a register? How do you modify the value of a register? Q5. At what address is n stored in memory? Calculate the 13th fib number by modifying this memory location. Q6. line 18 and 20 use syscal1 instruction. What is it and how do you use it
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
