Chapter 5
Tables
5.1 Objective
To become familiar with table driven code.
5.2 What you should do
You will have to turn in your LST files for the programs you write for this lab.
Check with the TA for additional instructions. In most of the examples, the name
is left blank as _____________. Make sure you enter your name in its place.
5.3 Tables
What is a table? Technically, table is same as an array except we use the term
table to refer to arrays whose elements are constants. To operate on the table, we
need two pieces of information, where, in memory, the table starts( the starting
address) , and how many elements are in the table ( the size or dimension).
In this lab, we will initially consider the case where each element requires one byte
of memory.
5.4 Setting up a table
To setup a table in memory, we generally use FCB, FDB and FCC. For example, if
we want to setup a table of prime numbers, we would write (using decimal since
it is easier to read):
...
59
Kommentare zu diesen Handbüchern