Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Excel As Your Database

Authors: Paul Cornell

1st Edition

1590597516, 978-1590597514

More Books

Students also viewed these Databases questions

Question

2. Develop a persuasive topic and thesis

Answered: 1 week ago

Question

1. Define the goals of persuasive speaking

Answered: 1 week ago