Question: Q1) Write a MIPS program that read a file numbers.text which contain 20 numbers and print them in the reverse order? this is my code

Q1)

Write a MIPS program that read a file numbers.text which contain 20 numbers and print them in the reverse order?

this is my code

i need help to reverse the order

.data filename: .asciiz "numbers.txt" buff: .space 90

.text

li $v0, 13 # system call for open file la $a0, filename # input file name li $a1, 0 # flag for reading li $a2, 0 # mode is ignored syscall # open a file move $s0, $v0 # save the file descriptor

li $v0, 14 # system call for reading from file move $a0, $s0 # file descriptor la $a1, buff # address of buffer from which to read li $a2, 90 # hardcoded buffer length syscall # read from file

li $v0, 4 # system Call for PRINT STRING la $a0, buff # buffer contains the values syscall # print int

li $v0,16 move $a0,$s1 syscall

li $v0,10 syscall

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!