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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
04/15/03 06:45
Read: times


 
#43419 - RE: Switch Case and If Else If
Responding to: ???'s previous message
Not really an 8052 question but the IF, ELSE IF statements will have multiple expressions evaluated in sequences to determine which path of exection to follow. In the SWITCH CASE statement, one expression is evaluated and one of many mutually exclusive paths of exection is followed.

The IF, ELSE IF statements are more general constructs but in many case the SWITCH CASE statement will compile to more efficient code and be easier to read. In particular, if the CASE values are fairly regular in order, the compiler might create a jump table which is indexed directly on the evaluated expression. In the worst case, it may evaluate to a bunch of branch instruction like with IN, ELSE IF. Also you can use integers in CASE statments.


List of 8 messages in thread
TopicAuthorDate
Switch Case and If Else If            01/01/70 00:00      
   RE: Switch Case and If Else If            01/01/70 00:00      
      RE: Switch Case and If Else If            01/01/70 00:00      
         RE: Switch Case and If Else If            01/01/70 00:00      
   RE: Switch Case and If Else If            01/01/70 00:00      
      RE: Switch Case and If Else If            01/01/70 00:00      
         RE: Switch Case, abhishek            01/01/70 00:00      
            RE: Switch Case, abhishek            01/01/70 00:00      

Back to Subject List