There is a simple solution to your problem: don't use _getkey. Use a routine like _getky that doesn't allow the calc to be turned off. > Is there any way of preventing someone turning the calculator off in the > _getkey routine, or even better, making the calculator free my program's > memory before it turns off?