3.4 Command Files

A command file is a file containing mixsim commands, one per line. Comments (lines starting with ‘#’) and empty lines are also allowed. An empty line in a command file does nothing; it does not mean to repeat the last command, as it would from the terminal.

Command files are useful to store sequences of mixsim commands for executing them later. There are two ways to execute a command file: explicit, by using SOURCE command, or implicit, by naming the file ‘.mixsim’ and storing it in the current working directory.

SOURCE filename
SO filename

Execute the command file filename.

The lines in a command file are executed sequentially. They are not printed as they are executed. An error in any command terminates execution of the command file and control is returned to the console. However, any mixsim command that prints a diagnostic message saying what it is doing, continues to do so even when called from a command file.

Commands that would ask for confirmation if used interactively proceed without asking, as if an affirmative answer was obtained.

When started in terminal mode (see section Terminal Mode and Debugger.), mixsim searches for file named ‘.mixsim’ in the current working directory, and, if this file exists, executes it. This file can be used to provide necessary default settings. For example, the following ‘.mixsim’ file assigns ‘easter.dck’ to the card reader device and sets breakpoint at address ‘1000’:

 
asgn 16 easter.dck
br 1000