On Friday 13 June 2003 07:22, Olin Lathrop scribbled: > Yes, you've managed to reinvent a primitive jump table. This will work= as > long as the table doesn't cross a 256 word boundary because you ignored > any carry from adding to PCL. Which is because it's pseudo-code and explained to be such with this foll= owing=20 statement... > > I haven't tested these, and I know I'll have some housekeeping to do > > with PCLATH, aligning to page boundaries, etc. My point was that I was trying to see if I could use a "standard" table-l= ookup=20 routine for a switch statement implementation, and thought it would be go= od=20 to get opinions from the more experienced on this list. > But those are exactly the issues that need to be worked out with PIC > tables. Anyone can make a jump table that doesn't work, big deal. > > See the HOS_CMD.ASPIC module of my HOS project at > http://www.embedinc.com/pic/hos.htm. This is real tested code of a > command processor thread that uses a jump table to dispatch to specific > command routines based on an opcode byte. As you can see, there's a bi= t > more to it if you'd like it to actually work. It's also documented. G= ee, > what a concept. Can you say "COM-MENTS"? Try it: "COM-MENTS, COM-MENT= S". > Very good, I knew you could. What's your point here Olin? If as you say "anyone can make a jump table= ..."=20 etc, then why do YOU, the mighty brain of all, need comments? And more=20 importantly, do you think your need/request for comments warrants your=20 childish attitude here? There's a saying that (paraphrased) there are tw= o=20 types of great people in this world -- those that become great by doing g= reat=20 things, and those that think they're great by bringing everyone down. Fi= gure=20 out where you fit in, since you're so "great"! You love nitpicking over=20 other's mistakes and way of doing things that are not *exactly* the way y= ou=20 would do it, but does that mean the other points-of-view are not valid? = If=20 you can't understand this pseudo-code, then why bother responding at all?= Do=20 you really think I'll apologize and repost the code with comments just fo= r=20 you? Or do you think I'll take it as a slap on the wrist and go whimperi= ng=20 back to a corner? Perhaps you think everyone else will see you as a=20 perfectionist? What's your intention? Why bother to waste time typing u= p a=20 reply here? I have received other (very helpful) responses from others w= ho=20 seem intelligent enough to understand the pseudo-code, so I feel sorry fo= r=20 you that you cannot understand it. At this point, I'll appeal to any minute sense of maturity you have to ju= st=20 not respond in these circumstances where you do not have anything valuabl= e to=20 add. And if you have criticism, there are better ways to state it, else=20 STFU. Cheers, -Neil. -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.