``__exit`` in IAR
-----------------

When an application exits prematurely in IAR, the fault condition is displayed
in the **Terminal I/O** window. With IAR, the Terminal I/O window does not open
automatically. To the developer, the application will simply halt at ``__exit``
as shown in :numref:`exit_iar`.

.. _exit_iar:

.. figure:: /debugging/resources/__exit_iar.png
    :align: center

    Disassembly view when an IAR application terminates.

In such an event, you will need to manually open the Terminal I/O window under
**View** |rarr| **Terminal I/O** so you can see the cause for the fault.
Alternatively, you can also use :term:`ROV` to determine the cause for the fault.

.. _exit_iar_terminal_iok:

.. figure:: /debugging/resources/__exit_iar_terminal_io.png
    :align: center

    Sample output of the **Terminal I/O** window when an exception occured.
