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

Thread Starter

raziishafique

Joined Oct 21, 2013
2
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
 

Papabravo

Joined Feb 24, 2006
21,225
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.
 

Papabravo

Joined Feb 24, 2006
21,225
Because that is the way the instruction set was defined?

Bob
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.
 

Papabravo

Joined Feb 24, 2006
21,225
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.
 

WBahn

Joined Mar 31, 2012
30,060
it is flag available in flag register of microprocessor and it shows the status of result u can google it.
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.
 

ScottWang

Joined Aug 23, 2012
7,400
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.
If google can help, why he asking for help at here?
 

WBahn

Joined Mar 31, 2012
30,060
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
What? Are you really trying to imply that Google really DOESN'T have ALL the answers?!?! :eek::eek::eek:

Heresy!!!!
 

WBahn

Joined Mar 31, 2012
30,060
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.
 

ScottWang

Joined Aug 23, 2012
7,400
What? Are you really trying to imply that Google really DOESN'T have ALL the answers?!?! :eek::eek::eek:

Heresy!!!!
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.
 

RichardO

Joined May 4, 2013
2,270
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.
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. :)
 

JohnInTX

Joined Jun 26, 2012
4,787
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. :)
From the 8085 Assembly Language Programming Manual:
Auxiliary Carry Flag
The auxiliary carry flag indicates a carry out of bit 3 of the accumulator. You cannot test this flag directly in
your program; it is present to enable the DAA (Decimal Adiust Accumulator) to perform its function.

The auxiliary carry flag and the DAA instruction allow you to treat the value in the accumulator as two 4-bit
binary coded decimal numbers. Thus, the value 0001 1001 is equivalent to 19. (If this value is interpreted as a
binary number, it has the value 25.) Notice, however, that adding one to this value produces a non-decimal
result:
0001 1001
+00000001
0001 1010 = lA
The DAA instruction converts hexadecimal values such as the A in the preceding example back into binary coded
decimal (BCD) format. The DAA instruction requires the auxiliary carry flag since the BCD format makes it
possible for arithmetic operations to generate a carry from the low-order 4-bit digit Into the high-order 4-bit
digit. The DAA performs the following addition to correct the preceding example:
0001 1010
+0000 0110
0001 0000
+0001 0000 (auxiliary carry)
0010 0000 = 20

The auxiliary carry flag is affected by all add, subtract, increment, decrement, compare, and all logical AND,
OR, and excl Jsive OR instructions. (See the descriptions of these Instructions In Chapter 3.) There is some
difference in the handling of the auxiliary carry flag by the logical AND instructions In the 8080 processor and
the 8085 processor. The 8085 logical AND instructions always set the auxiliary flag ON. The 8080 logical AND
instructions set the flag to reflect the logical OR of bit 3 of the values involved in the AND operation.
 

WBahn

Joined Mar 31, 2012
30,060
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. :)
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.
 
Top