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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
10/15/08 03:17
Read: times


 
Msg Score: +1
 +1 Good Answer/Helpful
#159068 - 0 or 1 in accumulator
Responding to: ???'s previous message
As an addendum to the previous message...

If you want a 1 or 0 answer in the accumulator, use CJNE and the carry bit as mentioned above. You can then move the carry bit into the lowest bit (bit 0) of the accumulator with:

MOV ACC.0,C

At that point you'll have either 0 or 1 in the accumulator. Most likely, though, having the answer in the carry (C) bit will be enough since you can then use instructions such as JC or JNC to make a branching decision based on the state of the carry bit.

Regards,
Craig Steiner


List of 6 messages in thread
TopicAuthorDate
Relational Opertaors            01/01/70 00:00      
   CJNE            01/01/70 00:00      
      0 or 1 in accumulator            01/01/70 00:00      
   Curious            01/01/70 00:00      
      One way            01/01/70 00:00      
      Book - discussion of Relational Operators            01/01/70 00:00      

Back to Subject List