John
John

Reputation:

Mips syscall + eof = can't read the entire file?

I'm writing some mips code that reads in ~4kb per iteration of a loop. The problem is that the mp3 file that I'm reading from contains multiple instances of 1A, so syscall 14 stops and won't read anymore without reaching the actual end of the file. Is there any way around this? Also, does anyone have a complete list of the flags that can be added to syscall 13?

Thanks

Upvotes: 2

Views: 2249

Answers (2)

paxdiablo
paxdiablo

Reputation: 881663

If you're using the MARS simulator, I don't think this is possible (unless someone's extended the syscall interface in your particular install). From the docs here:

MARS implements two modes: 0 for read and 1 for write, and ignores flags.

If you're using a simulator other than MARS, you need to tell us which one. Not all of them implement the same syscalls.

Upvotes: 1

zvrba
zvrba

Reputation: 24556

Try opening the file in binary mode.

Upvotes: 0

Related Questions