We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I have the impression that the routine that process a switch statement is (justifiably?) complicated and slow. I have a case with a lot of case statements. To "help the compiler" the cases are 0, 2, 4... to allow the use of JMP @a+dptr. I can see a way of going to a51 for the switch and then back to c for the code, but that would be almost unreadable. Has anyone found a fast and readable way to do something like this? Erik
I have the impression that the routine that process a switch statement is (justifiably?) complicated and slow. There are three different ways the compiler generates switch/case blocks. The method used depends on the number and structure of the cases. The compiler only uses a library routine when it cannot determine the structure of the case values. Refer to http://www.keil.com/support/docs/1316.htm for more detail on how to get the compiler to generate a jump table. Jon