Modifying Existing Machines

While you are in the process of editing an existing machine, you may find it frustrating in that you will not be allowed to change some items because of the uses to which they are currently being put. For example, you are not allowed to delete a register if one of its bits is being used as a condition bit. As another example, you cannot reduce the width of a register if that register is the source of a transfer microinstruction that transfers all the register’s bits.

To get around these problems, start by adding new components (registers, register arrays, condition bits, and RAMs) to replace the existing components that you want to change. That is, first create new registers and other components. After this is done, modify the microinstructions to use these new components instead of the old ones. After all this has been done you can delete the old components.

Once this task has been completed, you can change the names of the new components or instructions to the names used by the old components if you wish. This will create no problems because CPU Sim uses the names of hardware items and microinstructions only for display purposes.

Note: If you want to create a machine that is a modification of an existing machine, create a copy of the existing machine by choosing "Save machine as…" from the File menu and typing in a new name for the file. Then open and modify the copy that is stored in the new file.

CPU Sim does not allow you to create a new machine by copying and pasting components from an existing machine.

One final note: A common mistake is made when editing microinstructions. A microinstruction might be used in several machine instructions and the fetch sequence. If you modify the microinstruction, the modification will take effect wherever the microinstruction appears. If you want to modify the microinstruction only for some uses, then you need to create a new microinstruction for those uses instead. The easiest way is to duplicate the existing microinstruction in the Microinstructions Dialog and then edit the duplicate.