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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/14/09 16:12
Read: times


 
#162415 - Combine CJNE with JC/JNC instruction...
Responding to: ???'s previous message
... as explained at the top of page 23 of the instruction set:

http://www.nxp.com/acrobat_d...UIDE_1.pdf

Remember, when the 8052 executes the CJNE instruction, the carry flag is affected in the same way, as if the micro would perform the substraction "<dest-byte> - <src-byte>" and the carry flag would indicate whether a "borrow" was needed to do this. So, if <dest-byte> >= <src-byte>, the carry clag is "0", and vice versa.

Another way is to use the SUBB instruction followed by the JC/JNC instruction. By this you can easily perform multi byte comparisons, for instance. Don't forget to use the CLR C instruction before executing the first SUBB instruction, as explained at the top of page 52 of same instruction set.

Kai

List of 10 messages in thread
TopicAuthorDate
mathimatical question using 8052            01/01/70 00:00      
   CJNE?            01/01/70 00:00      
      problem in "" < "" and "" > ""            01/01/70 00:00      
         Reading is fundamental            01/01/70 00:00      
            *Careful* and *Thorough* reading is key            01/01/70 00:00      
      "bible" link(s)            01/01/70 00:00      
   Combine CJNE with JC/JNC instruction...            01/01/70 00:00      
      Thanks Kai the PDF was so helpfull            01/01/70 00:00      
         You can use..            01/01/70 00:00      
   maybe use a compiler            01/01/70 00:00      

Back to Subject List