dlxsim is the simulator that implements the "computer" that DLXOS runs on. This includes both the instruction set as well as the actions of hardware - page faults, interrupts, and physical devices such as a disk and the console. The DLX architecture is described elsewhere; this page describes the simulator itself.
The emulator takes the following options:
| -x execfile | Load execfile into the simulator's memory, and execute it (jump to the start address) when the simulator runs. If this option is specified more than once, only the last file specified actually is run (though the rest are loaded). |
| -l loadfile | Load loadfile into the simulator's memory. This file will not be executed, though code in it may be called from the file specified with -x. |
| -s startaddr | Specify startaddress as the starting address for the simulator to execute at. This option overrides the address specified by a file loaded with -x. The starting address is that provided by the last -s or -x option on the command line. |
| -m memorysize | Set the memory size of the simulated DLX processor to memorysize. The default memory size is 4 MB. |
| -k stackaddr | Set the initial stack address of the simulated DLX processor to stackaddr. The default stack address is the top of memory (normally 4 MB, but the stack address will adjust automatically if the -m option is used). |
| -t instrexectime | Make instrexectime the simulated time (in microseconds) taken to execute a single DLX instruction. This only has an effect on operations that involve simulated time, such as timer interrupts and the length of time that disk I/Os require. It's not necessary to make this number match the actual time it takes to simulate one DLX instruction. Default time is 1 microsecond per instruction. |
| -a arg1 arg2 ... | Pass the remaining arguments on the command line to the program being simulated by the DLX simulator. The arguments aren't parsed in any way - they're passed the same way that UNIX passes arguments to user programs. |
| -I | Turn on instruction tracing. Print a list of the addresses at which instructions are executed. The list is in the form addr:numinstrs, which means that the simulator executed numinstrs consecutive instructions starting at address addr. |
| -M | Turn on memory access tracing. Print the operation type (instruction), address and value moved for each load and store executed by the simulator. |
| -F tracefile | Make tracefile the file to which instruction and memory traces are written. The default is standard output, which may also be specified by "-". |
| -D debugstr | Turn on debugging for the options listed in debugstr. This is only available if the simulator is compiled with debugging code enabled (and the default version isn't). Normally, the simulator should be run without debugging code because the debugging code slows things down even if it's not turned on (all those debugging checks). |
The options to list memory accesses and instruction traces can be useful for debugging or for running programs to generate instruction traces.