Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question-2: Simulator use 1- Download MARS simulator from our page (it is a file with JAR extension). 2- When you double-click the file, it may
Question-2: Simulator use 1- Download MARS simulator from our page (it is a file with JAR extension). 2- When you double-click the file, it may ask for Java. JDK 1.8 or higher must be installed. 3- A screen like the one below should appear. mida - MARS El Eden Songs Top Rumah nonction fit C mom Roger Cart C Nu Na tas 2 Value OND 000000 DODO ORODDODDA CODOGODDC GOOD ORODDODD GHODOOD DODGODDO - 400 SE 402 ODGOVO CODOOD CODDODDO ata 10 11 13 14 15 1 000000 BOOOOO COD000 DOOD NODE DDDDD CODOGODD 00000 AB 11 40 . Line Come Showtime umbes 1 22 23 24 20 2 20 21 2 000 200000 RODODDO ODDODD ODDODD GOODOOD 1000000 tefte DRODDODDO ODDODDO 00400000 OWODOODDO 0000000 was sages tre Close TR 2. Na AM D/2011 Doo 4- Click New File and add the code below. www # Compute first twelve Fibonacci numbers and put in array, then print .data fibs: .word 0 : 12 # "array" of 12 words to contain fib values size: .word 12 # size of "array" .text la $t0, fibs + load address of array la St5, size # load address of size variable lw $t5, 0($t5) # load array size li St2, 1 # 1 is first and second Fib. number add.d $fo, $f2, $f4 SW $t2, 0($t0) # F[0] = 1 SW $t2, 4($t0) # F[1] = F[0] = 1 addi $t1, $t5, -2 # Counter for loop, will execute (size-2) times loop: lw $t3, 0($t0) # Get value from array F[n] lw $t4, 4($t0) # Get value from array F[n+1] add $t2, $t3, $t4 # $t2 = F[n] + F(n+1] SW $t2, 8 (Sto) # Store F[n+2] = F[n] + F[n+1] in array addi $t0,$t0, 4 # increment address of Fib. number source addi ti, ti, -1 # decrement loop counter bgtz ti, loop # repeat if not finished yet. la $a0, fibs # first argument for print (array) add al, szero, $t5 # second argument for print (size) jal print # call print routine. 11 $v0, 10 # system call for exit syscall # we are out of here. www w = www Question-2: Simulator use 1- Download MARS simulator from our page (it is a file with JAR extension). 2- When you double-click the file, it may ask for Java. JDK 1.8 or higher must be installed. 3- A screen like the one below should appear. mida - MARS El Eden Songs Top Rumah nonction fit C mom Roger Cart C Nu Na tas 2 Value OND 000000 DODO ORODDODDA CODOGODDC GOOD ORODDODD GHODOOD DODGODDO - 400 SE 402 ODGOVO CODOOD CODDODDO ata 10 11 13 14 15 1 000000 BOOOOO COD000 DOOD NODE DDDDD CODOGODD 00000 AB 11 40 . Line Come Showtime umbes 1 22 23 24 20 2 20 21 2 000 200000 RODODDO ODDODD ODDODD GOODOOD 1000000 tefte DRODDODDO ODDODDO 00400000 OWODOODDO 0000000 was sages tre Close TR 2. Na AM D/2011 Doo 4- Click New File and add the code below. www # Compute first twelve Fibonacci numbers and put in array, then print .data fibs: .word 0 : 12 # "array" of 12 words to contain fib values size: .word 12 # size of "array" .text la $t0, fibs + load address of array la St5, size # load address of size variable lw $t5, 0($t5) # load array size li St2, 1 # 1 is first and second Fib. number add.d $fo, $f2, $f4 SW $t2, 0($t0) # F[0] = 1 SW $t2, 4($t0) # F[1] = F[0] = 1 addi $t1, $t5, -2 # Counter for loop, will execute (size-2) times loop: lw $t3, 0($t0) # Get value from array F[n] lw $t4, 4($t0) # Get value from array F[n+1] add $t2, $t3, $t4 # $t2 = F[n] + F(n+1] SW $t2, 8 (Sto) # Store F[n+2] = F[n] + F[n+1] in array addi $t0,$t0, 4 # increment address of Fib. number source addi ti, ti, -1 # decrement loop counter bgtz ti, loop # repeat if not finished yet. la $a0, fibs # first argument for print (array) add al, szero, $t5 # second argument for print (size) jal print # call print routine. 11 $v0, 10 # system call for exit syscall # we are out of here. www w = www
Step 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