$ ./sim [-n] a.exe b.exe c.exe ...The command line arguments are executable file names. Those files are either created by hand, when programming directly in machine code, or by the assembler, when programming in assembly language.
The simulator passes each file to the loader. The loader simply loads bytes into memory, following the load point (@) directives in each exe file. When all files have been loaded, the debugger is invoked. Execution begins at the last entry point (!) directive seen in the input files. The -n switch can be given to avoid invoking the debugger.
The debugger commands are:
s | Execute the next (one) instruction |
---|---|
c | Continue execution. It will not be possible to re-enter the debugger. |
q | Quit execution of the simulator. |
EOF | Quit execution of the simulator (EOF means "end of file." How to indicate that depends on the operating system. In Linux, type ctrl-d.) |
pr | Print the contents of all registers. |
pm | Print the contents main memory. |
ppc | Print the value of the program counter (PC). |
pcc | Print the value of the condition code (CC). |
pM | Print the state of the machine. |