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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
03/28/00 05:44
Read: times


 
#1983 - RE: flag comparision
Abdul's solution works fine and is probably completely adequate for virtually everyone. His solution takes 11 cycles to execute. If you want a very slightly faster solution try:

MOV C,PSW.0 ;1 cycle
JC BIT1SET ;2 cycle
MOV C,SCON.3 ;1 cycle
JNC BITS_SAME ;2 cycle
SJMP BITS_DIFFERENT ;2 cycle
BIT1SET:
MOV C,SCON.3 ;1 cycle
JC BITS_SAME ;2 cycle

BITS_DIFFERENT:
;Your code for different bits goes here
BITS_SAME:
;Your code for same bits goes here

The above code will finish, at best, in 6 cycles and, at worst, in 8 cycles. Abdul's code is easier to read, though.

Good luck,
Craig Steiner


List of 5 messages in thread
TopicAuthorDate
flag comparision            01/01/70 00:00      
RE: flag comparision            01/01/70 00:00      
RE: flag comparision            01/01/70 00:00      
RE: flag comparision            01/01/70 00:00      
RE: flag comparision            01/01/70 00:00      

Back to Subject List