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
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