??? 01/12/08 10:49 Read: times |
#149359 - Agree with Dangerous Responding to: ???'s previous message |
Manipulating PC or stack is one of the most error prone things that You can do with the MCU. Comes right after forgetting to save registers in ISR.
However, sometimes this produces code that is both easy to read and works efficiently. Any application that has to do a case statement with more than 5 branches is (IMHO) a good candidate for this sort of coding. The solution by Russell Bull is the traditional way to do this. The one I presented is a more unorthodox but it looks nice on the source code. No labels or fiddling with dptr... Anyway, just like Andy said, there must be a good reason to put this into Your code. |