指定 MARS 输入文件
我正在 MARS 中测试 MIPS 汇编程序,并希望指定一个文件在执行期间作为输入(有点像我可以通过使用以下 UNIX 命令重定向 stdin 来完成的操作):
spim -file [文件名].s < [输入文件]
有没有办法在 MARS 中完成类似的事情?这是一项家庭作业,我仅限于标准 MIPS 系统调用,因此我无法使用 MARS 的扩展文件操作集。
我也愿意接受其他方法(在任何 MIPS 模拟器中)。我只需要一种方法来逐步执行程序并在程序运行时进行调试。上面的 MIPS 解决方案只会运行直到完成或引发异常,此时我无法后退或检查内存内容。
任何建议将不胜感激!
I'm testing a MIPS Assembly program in MARS, and would like to specify a file to take as input during execution (sort of like what I can accomplish by redirecting stdin with the following UNIX command):
spim -file [filename].s < [input_file]
Is there a way to accomplish something like this in MARS? This is a homework assignment and I'm limited to the standard MIPS syscalls, so I can't use MARS' extended file operations set.
I'm also open to other methods of doing this (in any MIPS simulator). I just need a way to step through the program and debug as it's running. The MIPS solution above just runs until it finishes or throws an exception, at which point I can't step back or examine memory contents.
Any advice would be greatly appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有关单步执行和调试 MARS 程序的信息,请参阅此处。
See here for information on stepping through and debugging a MARS program.