Recursive
2013-01-23 21:57:06
I have to implement the following in MIPS assembly language:
Here is what I have so far:
My problem is, how do I use the input from the user to declare the size of the array?
E: If possible, I would also like to output the values to the user so where do I store the values that are in the range I am looking for and How?
#Write,and test using spim, and assembly language program
that inputs a positive integer 'N' from the user, followed by 'N' integers.
Your program should output how many of the 'N' integers have
a value greater than or equal to 80 but less than 100.
Here is what I have so far:
#Author: Banana Colada
#MIPS Code
.data #Let processor know we will be submitting data to our program
Ask_Input:
.asciiz "\Please enter the size of the array\n"
#This will get a number from the user and store int unsed memory with Ask_Input
Tell_Input:
.asciiz "\Numbers greater than or equal to 80 but less than 100: "
#This will print all numbers in our array that is greater than 80
NumArray:
.space Ask_Input//This doesn't look right
.text #enables text input / output. Start of code
main: #main function. Program starts here
la $a0, Ask_Input
#load address Ask_Input from memory and store it into arguement register 0
li $v0, 4 #Load the value 4 into register $v0
syscall #reads register $v0 for op code, sees 4 and prints the string located in $a0
li $s0, NumArray #Load the address of start of array into address $s0
loop:My problem is, how do I use the input from the user to declare the size of the array?
E: If possible, I would also like to output the values to the user so where do I store the values that are in the range I am looking for and How?