Branch Table - Alternative Implementation Using Addresses

Alternative Implementation Using Addresses

Another method of implementing a branch table is with an array of pointers from which the required function's address is retrieved. This method is also more recently known under such different names as "dispatch table" or "virtual method table" but essentially performing exactly the same purpose. This pointer function method can result in saving one machine instruction, and avoids the indirect jump (to one of the branch instructions).

The resulting list of pointers to functions is almost identical to direct threaded code, and is conceptually similar to a control table.

The actual method used to implement a branch table is usually based on:

  • the architecture of the processor on which the code is to be executed,
  • whether it is a compiled or interpreted language and
  • whether late binding is involved or not.

Read more about this topic:  Branch Table

Famous quotes containing the words alternative and/or addresses:

    If you have abandoned one faith, do not abandon all faith. There is always an alternative to the faith we lose. Or is it the same faith under another mask?
    Graham Greene (1904–1991)

    The question “From where does the poet get it?” addresses only the what, nobody learns anything about the how when asking that question.
    Johann Wolfgang Von Goethe (1749–1832)