First page Back Continue Last page Overview Graphics
- TempTran: dc.b 27,29,33,34,41,44,49
- dc.b 54,59,65,70,75,80,86
- TempVal: equ $5 ;where table offset is stored
- ldab TempVal
- ldx #TempTran
- ldaa 0,x
- What is the purpose of the “abx” instruction? _______
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.