From the course: Learning Assembly Language

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Jump tables

Jump tables - Python Tutorial

From the course: Learning Assembly Language

Start my 1-month free trial

Jump tables

- [Instructor] One of the really important constructs in operating systems code is the jump table. This is a table which holds addresses for functions in the code body, and then access to the function is through its table index. I've prepared a jump table-based simple calculator using some of the code we've already developed, so let's take a look at it. At the start of the program, we have the standard data declarations for our handles and the variables used by the console functions. Following this, we have a couple of string buffers and then the messages used in the program. Note the use of the dollar symbol at line 23 to automatically calculate the length of the menu display. Following this we have three doublewords named num1, num2, and num3, which we'll use for our calculations. At line 30 we declare the jump table, set up as a quadword array of addresses. Note that we don't have to know the address of each of the…

Contents