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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
04/21/03 12:01
Read: times


 
#43843 - RE: Switch Case, abhishek
Responding to: ???'s previous message
machine language of device only supports "if.... then..."

There is no if... then... in machine language as such, but if you mean in machine language there is only CJNE, that's not the only way to jump conditionally. There is more than one way to jump according to a value.
The first way is

jmp @a+dptr (see example in the "bible")

another way is

push low(address) ;both of these may be
push high(address) ;variable
ret

This way is useful if you don't want to trash dptr.

To deal with spurious values, a LUT can sometimes be used to translate values which are far apart into values which are consequent.

I try to only use cjne if I have only one or a few conditions to test for. If I see more than four CJNE's to test and jump in a row, it always makes me want to cry.

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