TurboMON is a Z80 monitor and toolkit for the SAM Coupé. It provides a controlled execution environment for SAM programs, supporting single-stepping, tracing, breakpoints, as well as a selection of utility functions.
To allow the execution of code in ROM and RAM, and in any memory configuration, we must maintain full control at all times. The Z80's lack of debug registers leaves little choice but to interpret the target Z80 code to execute it. While this reduces execution speed to around 2% of normal SAM speed, it is fast enough to allow most programs to be used almost normally, instead of single-stepping everything.
As the name suggests, the monitor is optimised for speed, running over 100 times faster than an existing SAM monitor program. A number of common instruction blocks are recognised, allowing faster execution without a separate decode stage for each. Common delay and sound loops are also short-circuited to improve overall speed, when not single-stepping.