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)

    Life is comic or pitiful as soon as the high ends of being fade out of sight, and man becomes near-sighted, and can only attend to what addresses the senses.
    Ralph Waldo Emerson (1803–1882)