
204 CHAPTER 4 Bus-Based Computer Systems
for this code that generates button depressions to exercise the state machine. We
will also need to simulate the advancement of the system clock. Trying to directly
execute the interrupt handler to control the clock is probably a bad idea—not only
would that require some type of emulation of interrupts, but it would require us to
count interrupts second by second. A better testing strategy is to add testing code
that updates the clock, perhaps once per four iterations of the foreground while
loop.
The timer will probably be a stock component, so we would then focus on
implementing logic to interface to the buttons, ...