0

I have implemented error and exception handling while making software without really understanding why we do it. So, hypothetically, if there was no error handling mechanism, I want to know what would happen on the hardware level.

Ayush C.
  • 19
  • 1
  • 7
  • If there was no error handling mechanism, the processor could generate garbage (the undefined result of a divide by 0), without any action or even notification to the user. This would render the behavior of programs not deterministic. – Alain Merigot Jul 12 '19 at 08:29
  • You seem to be under the impression that software's "error handling framework" detects the division by zero before it reaches the hardware? But in fact, no: the hardware detects the division by zero and generates an "interrupt" for the software's error handling framework to handle. See ["How processor handles case of division by zero"](https://stackoverflow.com/q/23878400/978917) for more information; I've voted to close your question as a duplicate of that one. – ruakh Jul 20 '19 at 07:28

0 Answers0