How to pass arguments to SPIM CLI?

3761 views assembly
0

How do I pass arguments to a MIPS program using SPIM?

I know that we can do

spim -file myfile.s arg_inp_file.bin

But this loads the argument and starts executing right away.

How can I achieve the same, using the interactive mode, like after I add a few breakpoints etc.?

answered question

1 Answer

0

The man page (https://users.cs.duke.edu/~raw/cps218/Handouts/spim.html) doesn't mention any breakpoint options. It just simulates, and isn't a debugger. Unless the CLI you're using has more options (maybe try spim --help or man spim), it looks like you'll have to use the GUI to get a debugger.

Your first sentence is asking passing args to the program being simulated, rather than to the simulator. That's a completely different thing.

You do that with spin -file foo.s arg1 arg2, like you're already doing.

posted this

Have an answer?

JD

Please login first before posting an answer.