so as i was last said in my previous question:
I have an exercise in my univercity and i would like to have some help! first of all i'm new in mips language! So, my exercise is asking to make a programm in qtSpim which it will read 8 integers from the console then it will save it in an array to the memory and last it will print the sextuple of those integers in reserve order! Can you help me a little bit with the coding?
So, i tried a little bit alone and this is what i did so far:
# $18=c
.data
myArray: .space 32
.align 2
str_s: .asciiz "give me 8 numbers in 8 lines:"
str_nl: .asciiz "\n"
.text
.globl main #label "main" must be global
.globl loop
main:
la $17, myArray
#BUILD THE PROMPT
addi $2, $0, 4 # system call code for print_string
la $4, str_s # pseudo-istruction: address of string
syscall # print the string from str_s
add $18, $0, $0 # c=0
loop:
addi $2, $0, 5 #system call for read_string
syscall
add $16, $2, $0 #copy return int from $2 to $16
sw $16, 0($17) #save int from $16 to the array
addi $18, $18, 1 # c=c+1
bne $18, 8, loop #repeat while (c!=n)
loop:
j main
So as you can se in the second loop i have to print the integers of the array in reverse order...in google all i could found is to print integers but is it different now that i have a string? should i do it with integers from the beggining?
`