In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Coriolis wrote: I also see another space saving solution, your data packets first data byte is always $01, also the 3rd data byte is always $00. You can eliminate these from your table as well and adjust your stored packet lengths to 4, 8 and 20. Then specifically code that whenever these two data bytes are to be fetched, the proper (but not stored byte) is generated. Doing this will reduce your total packet data by 144 bytes. Now get this, I just recalculated your packets using both double indirection (eliminating duplicate packets), and removing the two constant bytes, and guess what I calculate the total number of bytes are? 256! Here is the packet data table Ive made: [code] DATA $03,$42,$00,$00 DATA $03,$43,$01,$00 DATA $07,$45,$5A,$5A,$5A,$5A,$5A,$5A DATA $07,$46,$00,$5A,$5A,$5A,$5A,$5A DATA $07,$46,$01,$5A,$5A,$5A,$5A,$5A DATA $07,$47,$00,$5A,$5A,$5A,$5A,$5A DATA $07,$4C,$00,$5A,$5A,$5A,$5A,$5A DATA $07,$4C,$01,$5A,$5A,$5A,$5A,$5A DATA $07,$4D,$FF,$FF,$FF,$FF,$FF,$FF DATA $07,$41,$5A,$5A,$5A,$5A,$5A,$5A DATA $07,$43,$00,$5A,$5A,$5A,$5A,$5A DATA $07,$44,$01,$03,$00,$00,$00,$00 DATA $07,$43,$01,$00,$00,$00,$00,$00 DATA $07,$4D,$00,$01,$FF,$FF,$FF,$FF DATA $07,$42,$00,$00,$00,$00,$00,$00 DATA $07,$4F,$FF,$FF,$03,$00,$00,$00 DATA $07,$40,$00,$02,$00,$00,$00,$00 DATA $07,$40,$01,$02,$00,$00,$00,$00 DATA $07,$40,$02,$02,$00,$00,$00,$00 DATA $07,$40,$03,$02,$00,$00,$00,$00 DATA $07,$40,$04,$02,$00,$00,$00,$00 DATA $07,$40,$05,$02,$00,$00,$00,$00 DATA $07,$40,$06,$02,$00,$00,$00,$00 DATA $07,$40,$07,$02,$00,$00,$00,$00 DATA $07,$40,$08,$02,$00,$00,$00,$00 DATA $07,$40,$09,$02,$00,$00,$00,$00 DATA $07,$40,$0A,$02,$00,$00,$00,$00 DATA $07,$40,$0B,$02,$00,$00,$00,$00 DATA $13,$43,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 DATA $13,$42,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 [/code] This means you dont need to do the divide by 2 trick to accomodate all of the table! The algorithm would look something like this: Determine the packet number needed (Lets call this pnum) Read the pnum'th entry of the offset table (Lets call this offset) Output $01 for the first packet data byte Read data at packet data base address and output Output $00 for the third packet data byte Read data at packet data base address + offset (offset=1 at this point) and output Continue to process the data by incrementing the offset number until packet data is exhausted End of algorithm branch ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=100746#m100779 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2005 (http://www.dotNetBB.com)