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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/14/08 10:19
Read: times


 
#149423 - OK, to put it another way...
Responding to: ???'s previous message
Jan Waclawek said:
Sorry, Andy, but this is misleading - and exactly in the way people are confused by A vs. ACC.

Maybe it is.

Originally, I said:
'A' is used when the Accumulator is implicit in the instruction;

'ACC' is the address of the Accumulator when it's used like any other SFR.

http://www.8052.com/forum/read.phtml?id=149356


So, 'ACC' is a symbolic name for the SFR address 0xE0 - which is the address of the Accumulator.

'ACC' may be used as an operand to any instruction where an SFR address is permitted (unless specifically excluded).

'A' is not a symbol at all - rather, it should be considered as part of the instruction itself; it is implicit to the instruction.

eg,
ANL A, Rn chould be thought of as an instruction "ANLA" that takes a single argument - "Rn"
as opposed to:
ANL direct,#data which is an instruction "ANL" that takes two argunents - "direct" and "#data"

So "A" is actually part of the instruction - it cannot be used on its own to specify the Accumulator.

However, there is only one accumulator - therefore, whether an instruction accesses it implicitly (because it's an 'A' instruction), or explicitly (by using the "ACC" name, or even the 0xE0 address as a "magic number"), they are all accessing the same thing!



Note that some assemblers may use different notations, but the underlying instructions remain the same...

List of 32 messages in thread
TopicAuthorDate
Where can I ask newbie questions?            01/01/70 00:00      
   There is no such thing as a newbie question            01/01/70 00:00      
      the question            01/01/70 00:00      
         jump table            01/01/70 00:00      
            WOW, this is what I'm looking for!            01/01/70 00:00      
               *Very* Dangerous game!            01/01/70 00:00      
                  Agree with Dangerous            01/01/70 00:00      
                  PC            01/01/70 00:00      
               A and ACC            01/01/70 00:00      
                  ACC            01/01/70 00:00      
                     Different ways of getting to the same thing            01/01/70 00:00      
                        NO!            01/01/70 00:00      
                           OK, to put it another way...            01/01/70 00:00      
               jump table            01/01/70 00:00      
         the simple and stupid way...            01/01/70 00:00      
   One way to do this            01/01/70 00:00      
      Compare with JMP @A+PC            01/01/70 00:00      
         Yes there is            01/01/70 00:00      
         JMP @A+PC?            01/01/70 00:00      
            Oops            01/01/70 00:00      
   FAQ?            01/01/70 00:00      
      I think...            01/01/70 00:00      
         That's fine            01/01/70 00:00      
         English,            01/01/70 00:00      
   Newbie questions            01/01/70 00:00      
      Steve, I disagree            01/01/70 00:00      
   One question at a time            01/01/70 00:00      
   Agree to one question at time...            01/01/70 00:00      
      manipulating PC            01/01/70 00:00      
         PC            01/01/70 00:00      
   isnt an abuse ask more questions?            01/01/70 00:00      
      You said it yourself - start a new thread!            01/01/70 00:00      

Back to Subject List