Plz help me......why AC is set in ANA....

Discussion in 'General Electronics Chat' started by raziishafique, Oct 21, 2013.

  1. raziishafique

    Thread Starter New Member

    Oct 21, 2013
    2
    0
    hiii.....
    i went through many 8085 books but not get the answer ....
    after execution of logical ANDing operation carry flag is clear and AC is SET why??

    please help me..

    thanx
     
  2. WBahn

    Moderator

    Mar 31, 2012
    17,716
    4,788
    Let's start with the meaning of the carry flag and the AC flag? What do each of those mean?
     
  3. raziishafique

    Thread Starter New Member

    Oct 21, 2013
    2
    0
    it is flag available in flag register of microprocessor and it shows the status of result u can google it.
     
  4. Papabravo

    Expert

    Feb 24, 2006
    10,137
    1,786
    We know that we can google these things. What we need from you is your analysis of the problem and a question. You've already supplied the question. In my estimation there may not be a good answer to your question, but it might help if you can offer your analysis.
     
  5. BobTPH

    Active Member

    Jun 5, 2013
    782
    114
    Because that is the way the instruction set was defined?

    Bob
     
  6. Papabravo

    Expert

    Feb 24, 2006
    10,137
    1,786
    Well yes, but I think the original question was deeper. AC and logical AND are not related in any meaningful way. AC is used in BCD arithmetic. There may be some method to this apparently arbitrary and capricious design decision if you want a way to set the AC in preparation for a subsequent operation.
     
  7. ScottWang

    Moderator

    Aug 23, 2012
    4,853
    767
    You should list a sample program that it may more easier to discussing.
     
  8. Papabravo

    Expert

    Feb 24, 2006
    10,137
    1,786
    There may not be one readily available. The context of the question revolves around the how a particular instruction, ANA, sets the condition codes. I'm merely suggesting a possible explanation for why the chip designers made the decision that they did. I have absolutely no insight into why.
     
  9. WBahn

    Moderator

    Mar 31, 2012
    17,716
    4,788
    I searched for "What does raziishafique think that the CY and AC flags in the 8085 instruction set mean."

    I love it. I want help and I ask you to start by explaining YOUR understanding of what those flags mean, and you tell me to go google them. Classic. Tells me the kind of "help" you are looking for.
     
  10. ScottWang

    Moderator

    Aug 23, 2012
    4,853
    767
    If google can help, why he asking for help at here?
     
  11. WBahn

    Moderator

    Mar 31, 2012
    17,716
    4,788
    Oooh, oooh, I know! You can google that and find out! :D :rolleyes:
     
  12. ScottWang

    Moderator

    Aug 23, 2012
    4,853
    767
    I mean that the google is really useful and help a lot, but they can't do everything, maybe next time when the op asking then you can say : google it ... :D
     
  13. WBahn

    Moderator

    Mar 31, 2012
    17,716
    4,788
    What? Are you really trying to imply that Google really DOESN'T have ALL the answers?!?! :eek::eek::eek:

    Heresy!!!!
     
  14. WBahn

    Moderator

    Mar 31, 2012
    17,716
    4,788
    At the OP: I'd like to say that we are laughing with you and not at you. But I can't. We're definitely laughing at you. :p

    But it's not personal (at least not yet). :D

    It's mostly just a harmless distraction while we wait for you to come back and participate in the way we are hoping you will, namely by explaining what YOUR understanding of those two flags are. Then we use that and combine it with what the ANA instruction does and, from there, see if we can help you make sense out of why the ISA (instruction set architecture) designers made the choice they did. We probably won't be able to conclusively say why they did -- the answer to that may reflect the specific legacy behavior of an earlier processor -- but we should at least be able to convince you that the decision was not unreasonable.
     
  15. ScottWang

    Moderator

    Aug 23, 2012
    4,853
    767
    Oh,Yes.
    I was depended on google a lot and count on it, but when I searching some IC datasheets, but I can't get anything at all, of because that isn't anthing wrong from google, that is because the IC was made in China and there is no one to put those datasheets on the internet.

    I read some infos that they said the google only can get the infos less than 1/10 comparing to all the infos on internet.
     
  16. RichardO

    Well-Known Member

    May 4, 2013
    1,231
    382
    Let's see... The 8085 is derived from the 8080 which was based on the 8008 which followed 4040 and, of course, the original 4004. The 4004 had a decimal adjust instruction but there were no special status flags involved. So, the answer lies someplace/sometime after the 4004. :)
     
  17. JohnInTX

    Moderator

    Jun 26, 2012
    2,341
    1,024
    From the 8085 Assembly Language Programming Manual:
     
    absf likes this.
  18. WBahn

    Moderator

    Mar 31, 2012
    17,716
    4,788
    Perhaps true, but the 8085 and the 8080 treat the AC flag differently when doing a logical AND. So it's murkier than it might seem.

    The real bottom line is to consider whether either of these flags convey any meaning for this operation. What does it mean for a bitwise operation to produce a carry? So, my guess, is that because there is no intrinsic meaning, the architectures just do what they do and the documentation just documents what they do. It wasn't worth putting in a single extra transistor to force it to do something specific because whatever it does conveys no useful information.
     
    absf likes this.
  19. BobTPH

    Active Member

    Jun 5, 2013
    782
    114
    Yep, I think that is the answer.

    Bob
     
Loading...