Laboratories Creating on the MIC-1 Simulator

The simulator assignment consists of writing a basic simulator that allows for single stepping at each of three levels: Mic-1 subcycle, Mic-1 cycle, and Mac-1 instruction cycle. The simulator program essentially consists of a loop which, aside from handling standard input, calls the four procedures to handle the Mic-1 subcycles. For example, subcycle one consists of taking the element from the control store array indexed by the MPC and decoding it. The decoding involves shifting and masking so that each bit field of the MIR can be stored in the appropriate field of an MIR structure. The simulator shows each field on the display by calling a routine such as ani_set_mir_A_value(value,reg).

The first few assignment are preliminary. They write simple C code which will eventually handle user input. This part of the assignment was given before they students had learned about the Mic-1.

The basic simulator assignment is divided into milestones. One of the first milestones consists of writing a main program which just calls the initialize_animator routine and is executed with its standard output redirected to the animator.

These few lines of code allow the students to see how easy it is to bring up the graphical interface. The second milestone consists of setting up and initializing the data structures used for storing the state of the Mic-1 machine and sending the initial values of the sixteen registers to the animator. At this point students have written very little code, but they can see how the animation will progress. They can try out several of the routines for controlling the graphical display and get a feel for what will be involved in the simulation. The milestones progress in simple steps until the entire simulator is complete. Students can typically produce a working simulator in less than four weeks.