> Well, we all know how to do a computed table lookup in the > 16-series by adding directly to the PCL and executing a RETLW. Actually, I think there is much confusion about this. Personally I think this is a bad method of doing a table lookup unless you know exactly what you are doing and you absolutely need every cycle and code word. > As when generating 7-seg-display codes from 0-9 binary values. > > But, if we already have the 7-seg-display-codes and want > the correspondent 0-9 binary value ? > > The two ways I see are (1) to build a 2**7 bits long table with a > lot of unused space and (2) use a series of sub/skip instructions. > > Anyone having a a better solution ? "Better" depends on external criteria that you have not specified. Another means is to scan the forward table for the matching code. This can be especially useful if the forward table is already in the code for other reasons. ***************************************************************** Embed Inc, embedded system specialists in Littleton Massachusetts (978) 742-9014, http://www.embedinc.com -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads