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:

    No alternative to the
    one-man path.
    Denise Levertov (b. 1923)

    If poetry should address itself to the same needs and aspirations, the same hopes and fears, to which the Bible addresses itself, it might rival it in distribution.
    Wallace Stevens (1879–1955)