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