First page Back Continue Last page Overview Graphics

Table Lookup


The above program performs a table lookup. It goes into the table pointed to by X, the distance specified by B. In this program, the values following TempTran could be temperature values in fahrenheit that correspond to values read from an A/D converter. For example, a 0 read from the A/D converter would be 27 degrees and a 3 read from the A/D converter corresponds to 34 degrees. Using this look-up technique is especially useful when the relationship between the input and output is not linear.

The ldaa 0,x instruction uses indexed addressing. Accumulator A is loaded with the value contained at the address specified by register x. Indexed addressing is discussed in more detail later in the course.