You can trap integer division-by-zero errors with the C library
__aeabi_idiv0() so that division
by zero returns some standard result, for example zero.
Integer division is implemented in code through the C library
Both functions check for division by zero.
When integer division by zero is detected, a branch to
made. To trap the division by zero, therefore, you only have to
place a breakpoint on
The library provides two implementations of
The default one does nothing, so if division by zero is detected,
the division function returns zero. However, if you use signal handling,
an alternative implementation is selected that calls
If you provide your own version of
then the division functions call this function. The function prototype
__aeabi_idiv0() returns a value, that
value is used as the quotient returned by the division function.