Integer division is implemented in code through the C library helper functions
__aeabi_uidiv(). 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
__aeabi_idiv0(). 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
__aeabi_idiv0(), then the division
functions call this function. The function prototype for
__aeabi_idiv0() returns a value, that value is used as the quotient
returned by the division function.