Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
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.

List of 32 messages in thread
TopicAuthorDate
Where can I ask newbie questions?            01/01/70 00:00      
   There is no such thing as a newbie question            01/01/70 00:00      
      the question            01/01/70 00:00      
         jump table            01/01/70 00:00      
            WOW, this is what I'm looking for!            01/01/70 00:00      
               *Very* Dangerous game!            01/01/70 00:00      
                  Agree with Dangerous            01/01/70 00:00      
                  PC            01/01/70 00:00      
               A and ACC            01/01/70 00:00      
                  ACC            01/01/70 00:00      
                     Different ways of getting to the same thing            01/01/70 00:00      
                        NO!            01/01/70 00:00      
                           OK, to put it another way...            01/01/70 00:00      
               jump table            01/01/70 00:00      
         the simple and stupid way...            01/01/70 00:00      
   One way to do this            01/01/70 00:00      
      Compare with JMP @A+PC            01/01/70 00:00      
         Yes there is            01/01/70 00:00      
         JMP @A+PC?            01/01/70 00:00      
            Oops            01/01/70 00:00      
   FAQ?            01/01/70 00:00      
      I think...            01/01/70 00:00      
         That's fine            01/01/70 00:00      
         English,            01/01/70 00:00      
   Newbie questions            01/01/70 00:00      
      Steve, I disagree            01/01/70 00:00      
   One question at a time            01/01/70 00:00      
   Agree to one question at time...            01/01/70 00:00      
      manipulating PC            01/01/70 00:00      
         PC            01/01/70 00:00      
   isnt an abuse ask more questions?            01/01/70 00:00      
      You said it yourself - start a new thread!            01/01/70 00:00      

Back to Subject List