The simplest way is to pass the MCUSR value in a register. I recently added code to the OptiBoot bootloader to do this and it has been done this way in the ZBasic bootloader for years. In both cases, register R2 is used but you can choose any register that isn't modified by the startup code prior to your having a chance to store the value. You can find the source code for OptiBoot online; my change was incorporated into v4.6.Don KinzerZBasic Microcontrollershttp://www.zbasic.net