Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
I'm using Spim for my mips coding and I need to load a file and use the data contained in it. The file contains a number telling the amount of numbers that needs to be sorted.
The file looks like this:
.word 0x0010 # 16
It is possible for the file to contain more or less numbers.
So I was thinking like this. Open file, read first number. Allocate an memory area capable of storing all these numbers. Read the numbers and put them in the memory.
but I got no clue on how to read from a file and iterate trough it and I'm completely bummed out. I'm trying to figure out how to use syscall 13 and 14 but no luck so far.
0 · ·