Mon(Simulator sim) {
            SPH_watch = new SPWatch();
            SPL_watch = new SPWatch();

            SPProbe probe = new SPProbe();

            // insert watches for SP registers
            MCUProperties props = sim.getMicrocontroller().getProperties();
            simulator = sim;
            simulator.insertWatch(SPH_watch, props.getIOReg("SPH"));
            sim.insertWatch(SPL_watch, props.getIOReg("SPL"));
            sim.getInterpreter().getInterruptTable().insertProbe(new IntProbe());

            // insert probes to catch "implicit" updates to SP for certain instructions
            Program program = sim.getProgram();
            for ( int pc = 0; pc < program.program_end; pc = program.getNextPC(pc)) {
                LegacyInstr i = (LegacyInstr)program.readInstr(pc);
                if ( i != null ) {
                    if ( i instanceof LegacyInstr.CALL ) sim.insertProbe(probe, pc);
                    else if ( i instanceof LegacyInstr.ICALL ) sim.insertProbe(probe, pc);
                    else if ( i instanceof LegacyInstr.RCALL) sim.insertProbe(probe, pc);
                    else if ( i instanceof LegacyInstr.RET ) sim.insertProbe(probe, pc);
                    else if ( i instanceof LegacyInstr.RETI ) sim.insertProbe(probe, pc);
                    else if ( i instanceof LegacyInstr.PUSH ) sim.insertProbe(probe, pc);
                    else if ( i instanceof LegacyInstr.POP ) sim.insertProbe(probe, pc);
                }
            }
        }