jbirkler. One idea is to skip the regs in avr_monitor_data_t and only use a dedicated stack that can hold all registers too. The monitor entry and exit block should be a little simpler: -Push to get some temp working regs -Set SP to dedicated area -Push everything to dedicated area -Host knows in what order the monitor pushes things on the dedicated stack and can restore registers .