The wai implementation in the simulator is a kind of hack to implement an exit(N) and stop the simulator. It is intended to be used by gcc validation suite which runs programs and must analyze the result (exit status or output), and also for several examples just to have a way to stop them (of course, in ROM&embedded reality, this has no meaning).

The implementation of exit() is in fact a loop arround a wai. If you use it within the simulator, the simulator just stops. If you use it within a real system, your system continues running and accepts interrupts.

There is missing an option in the simulator to disable that exit and implement the real wai (wait for interrupts).