full-stack-hello icon indicating copy to clipboard operation
full-stack-hello copied to clipboard

Exception handling mechanism discussion

Open pakls opened this issue 8 years ago • 0 comments

At the moment, DIV and MOD considers divide-by-zero (I'll call it as DBZ from now on) as unimplemented.

We are in need of an exception handling mechanism when DBZ happens.

I can think of a few ways now:

  1. Add a (typical) exception handling callback (like ISR) like general CPUs do.
  2. Add a global flag that can be set when DBZ happens and code can explicitly check the flag after a DIV or MOD operation is performed.

The considerations that I can think of by now. They are tradeoffs during most of the time.

A. Speed B. VM Complexity C. Support of higher level semantics, such as C++ Exception

pakls avatar Jun 08 '17 14:06 pakls