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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
10/20/06 23:47
Read: times


 
#126853 - More reading to be done
Responding to: ???'s previous message

The relational operator LE is for the assembler itself- not for the 8051 instruction!

With the 8051, you have the CJNE instruction. 'compare and jump if not equal'. This instruction also sets the carry and zero flags depending on the result. You can then use the JC,JZ,JNC,JNZ instructions to alter the program flow. Your concept of 00H or FFH as a logical result is a 'c' concept - most micros have status or condition code flags that are altered as the result of the last operation. Read the instruction set description carefully - you'll see a diagram that shows what and how the flags are altered.

A compare is simply a subtraction operation that does save the result apart from the flags. If the values are equal the result is 0, so the Z flag is set. If A>B, then there is no borrow, so the C (carry/borrow) flag is not set, if A<B then the C flag is set.


List of 9 messages in thread
TopicAuthorDate
Relational Operators            01/01/70 00:00      
   Eh???            01/01/70 00:00      
   More reading to be done            01/01/70 00:00      
      Thanks            01/01/70 00:00      
      errata            01/01/70 00:00      
         Oh the shame!            01/01/70 00:00      
            no shame            01/01/70 00:00      
               well threre is no LE in chapter 2            01/01/70 00:00      
            Differs from family to family            01/01/70 00:00      

Back to Subject List