Because the debug port uses instructions for most operations, the debug code
will clobber registers used by the running program. Save and restore these
to avoid corrupting application data.
If the ROM file is known, use that to return data instead of fetching it
from the target to improve performance.