I am using a 16F84, as a host controler to a Perifial IC. The IC sends 8 bit packets 4 to 8 of them in each direction for control. The first packet is all 1's for sync, the second packet is the total qty of packets being sent, the third is the command packet, the 4 through what ever, are the parameters, the last packet is a checksum, a combined total value in hex of packets 2 through the last packet except for the checksum. The 16F84 will always talk first, and the IC will always return with a responce. (Command completed or Error codes).
  My Question: there are about 20 commands and about 15 responces to these commands, the length of the packets will very and the length of the responce packets will very. Pulling from a table to send packets are not a problem but, how do I organize the received data and the table information so as to do look ups on random information to determine what to do do next. I am lost with this type of look up table. I believe I need help with the structure of the code and the methodology.
 
Gordon Varney