Question: Write a program using the MIPS assembly language ( code must work with cpulator ) that prints out Hello World m times in
Write a program using the MIPS assembly language (code must work with cpulator) that prints out "Hello World"
m times in
m different lines using a loop and then prints out the sum of first
n integers starting at
1 . So, if
n = 5 , it must print out
1 + 2 + + 5 = 15 to the terminal. Assume that
m , n are two words defined under the .data segment of your code, as shown below.
code sample:
.global _start .text _start: # your code will go in here .data m: .word 3 # I will change this value during grading n: .word 5 # I will change this value during grading myString: .asciiz "Hello UNF "
To print an integer, we need to use a system call with 1 present in the register $v0. Also, the integer to be printed must be present in $a0. See below for an example.
li $v0, 1 add $a0, $t1, $zero # this will print the content of $t1 syscall
Here is the expected output for
.
Hello World
Hello World
Hello World
15
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
