??? 07/06/05 12:12 Read: times |
#96679 - Switch/Case Optimization Responding to: ???'s previous message |
I seem to remember that early versions of the Keil compiler didn't use jump tables for switch statements, this is probably why advice to avoid switch statements still persists.
This is unfortunate. Switch/case optimizations were added in version 3 which was released around 1990. This means that someone was making recommendations from the version 2 compiler which I doubt most current 8051 developers have ever used. In fact, there are several ways to optimize a switch statement as shown in the following knowldgebase article: http://www.keil.com/support/docs/1316.htm Jon |