Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1.write a MIPS assembly language program that displays the first N Fibonacci numbers? q2. write a MIPS assembly program that calculates the sum of all
1.write a MIPS assembly language program that displays the first N Fibonacci numbers?
q2. write a MIPS assembly program that calculates the sum of all the elements in the following array: int array[10] = {12,21,3,40,15,6,17,8,29,10}
go to L Example: Following is a MIPS assembly language program that calculates the sum of all positive integers less than or equal to N and displays the result on the monitor. Assuming that N is stored in the register $to. I Algorithm Assembly Language $t0 $t0) go to print; loop: sltu $12, Sto, $t1 $0 $a0 + $t1; $12, print $tl ( $tl + 1; addu $a0, $a0,$t1 go to loop; addi $t1, $t1, 1 print: display $al; j loop exit; print: 4.1 Assignment: 1. Write a MIPS assembly language program that displays the first N Fibonacci numbers. Algorithm Assembly Language bgtz $t0{N-1; $tl (1) $a0 1; display $a0; loop: display $a0; $t0 $t0 - 1; if ($t0 =0) stop; $a0 $a0 + $t1; $t1 + $a0 - $t1, go to loop, stop: 2. Write a complete MIPS program to display all the ODD positive integers less than 1000. X2: hasta, m The solution of above example using pointer: data M: .word 0:36 .text la li $t1, 9 $t0,0 $14, 7 addiu $t2, $t2, 12 L2: beq $t0,$t1, X2 sw $14, 0($t2) addiu $to, $to, 1 addiu $t2, $t2, 16j L2 X2: 5.4 Assignment 1. Write a MIPS assembly language to transpose a square integer matrix. 2. Write a MIPS assembly program that calculates the sum of all the elements in the following array: int array[10]={12,21,3,40,15,6,17,8,29,10}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