I'm having trouble with a project that is supposed to read a voltage thanks to ADC1 (this part is fine,I got it) and compare this value with a lookup table to find what to display on my 3 seven segment display. I have to use assembly and I know that to define a lookup table I have to use .db.
For example: If the voltage is 5V the displays have to show 1,2,3.
My understanding is that the lookup table should be something more like:
But how can I go on the lookup table finding the closest value to what the ADC1 got and save the next 3 cells on 3 register?
Thanks for help