Reading files with MIPS assembly

前端 未结 3 1803
醉梦人生
醉梦人生 2021-01-05 15:24

I\'m trying to write a program that reads in characters from a .dat file that correspond to different colors to be displayed in the LED simulator; x = off, R = red, etc. My

相关标签:
3条回答
  • 2021-01-05 15:55

    The only issue is your buffer is simply an empty string, which is only reserving one byte (null byte). You should instead use buffer: .space 1024 or however many bytes you need. Everything else seems fine.

    If you are having trouble opening the file, make sure the extension is exactly correct. But my test just worked a .dat file and a few random text files.

    0 讨论(0)
  • 2021-01-05 16:09

    I had the same problem. Specially if you are using Linux, try "./maze1.dat" instead.

    0 讨论(0)
  • 2021-01-05 16:10

    Make sure the you are running MARS from the same directory the file is located. Simply move the MARS .jar to the directory containing "maze1.dat" and run it from there.

    0 讨论(0)
提交回复
热议问题