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

Back to Subject List

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


 
#151729 - CJNE Alternatives
Responding to: ???'s previous message
Christopher:

There are alternate methods to achieve jumps on equal and non-equal conditions. I will show two examples here. Keep in mind that these are not always as compact or efficient as the CJNE instruction but may be useful within certain algorithms where a part of the calculations being performed are similar to the code flow I show below:

Jump On Equal Scheme:
In this example I'll show a case of taking a jump when register R4 is equal to 4.
     MOV  A, R4
     CLR  C
     SUBB A, #4
     JZ   HANDLE_EQ
HANDLE_NOT_EQ:
     ...
     ...

HANDLE_EQ:
     ...
     ...
Jump On Not Equal Scheme:
In this example I'll show a case of taking a jump when register R6 is not equal to register R7
     MOV  A, R6
     CLR  C
     SUBB A, R7
     JZ   HANDLE_NOT_EQ
HANDLE_EQ:
     ...
     ...

HANDLE_NOT_EQ:
     ...
     ...


Michael Karas


List of 8 messages in thread
TopicAuthorDate
CJNE Question            01/01/70 00:00      
   CJNE method            01/01/70 00:00      
      CJNE method            01/01/70 00:00      
         Try this            01/01/70 00:00      
   Program counter            01/01/70 00:00      
   CJNE Alternatives            01/01/70 00:00      
      XOR            01/01/70 00:00      
   example            01/01/70 00:00      

Back to Subject List