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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/02/03 22:56
Read: times


 
#57699 - Comparing Registers
My problem is fairly simple, but I need some help implementing it. I have 3 switches connected to P2 that put my device into 3 different modes. I have a main routine that initially checks the switches, sets initial conditions to some registers, and calls the appropriate sub-routine.

While I'm within that sub-routine I'd like to be able to compare the current status of the switches to a value that I can set for each mode, and as long as they are the same it will keep executing the sub-routine. I don't want to go back to the beginning each time, since the initial conditions will be written and overwrite the conditions in the sub-routine.

My problem is that I'm not sure how to compare the status of P2 to a register. For example, if "MODE 1" of my main check routine sets a value of 250 to register 5, how can I compare P2 to that value and jump back to the main check routine only when they do not equal each other? Can it be done without using the accumulator?

Thanks!

List of 7 messages in thread
TopicAuthorDate
Comparing Registers            01/01/70 00:00      
   RE: Comparing Registers            01/01/70 00:00      
      RE: Comparing Registers            01/01/70 00:00      
         RE: Comparing Registers            01/01/70 00:00      
            help            01/01/70 00:00      
               RE: help            01/01/70 00:00      
   RE: Comparing Registers            01/01/70 00:00      

Back to Subject List