Skip to content

Exception handling mechanism discussion #40

Description

@pakls

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions