; Chapter 12 6812 assembly language programs ; Jonathan W. Valvano, 2/26/07 ; This software accompanies the book, ; Embedded Microcomputer Systems: Real Time Interfacing, Second Edition ; published by Thomson Engineering, 2006 xref ADCtable ; monotonic list of ADC values xref Ttable ; list of corresponding temperature values absentry LookUp ;**********Lookup******************* ;Inputs: RegD is 0 to 65534 Xdata point, xL ; RegD input must be greater than or equal to first Xdata point ; RegD input must be less than last Xdata point ;Output: RegD is 0 to 65535 Ydata point, decimal fixed-point 0.1C ;Registers destroyed: X,Y,B,CCR LookUp: ldx #ADCtable ; first find x1<=xLy1,y2 rts ; D=Y1+B*(Y2-Y1) ;Program 12.1. Assembly language program to convert 8-bit ADC into fixed-point temperature.