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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/17/06 11:45
Read: times


 
#110219 - MOVC A , @A+DPTR
I will like if someone can help me understand in very simple terms, the purpose for adding A to DPTR, to comprise the address in the following code.

ORG 100H
MOV DPTR,#200H
B1: CLR A
MOVC A,@A+DPTR
JZ EXIT
MOV P1,A
INC DPTR
SJMP B1
EXIT

ORG 200H
DATA: DB "The Sky Is Gray",0
END

My understand how the code works: DPRT is pointing to program code space 200h in ROM. The Accumulator is cleared, and added to the data pointer register, which make DPTR still pointing to 200h. Now, the first character T, is loaded into A. The program checks to see if 0 is loaded into A, if it is, the program stops; if it's not, it continue looping. T is now sent to P1, the DPTR is incrementd to point to 201H and the program starts again to get the next character to send to P1.

Is it that the 8051 assembler needs to see @A to understand that the value held in DPTR is a memory address?. I say this because adding zero to DPTR still keep it at it's current value.

Will @DPTR be a valid instruction for the 8051?. Hence why not,
MOVC A , @DPTR. Back to my original question, why add A which is zero to DPTR.

Thanks

Jeff









List of 14 messages in thread
TopicAuthorDate
MOVC A , @A+DPTR            01/01/70 00:00      
   Thats the way it works            01/01/70 00:00      
   its because its.....            01/01/70 00:00      
      MOVC A , @A+DPTR            01/01/70 00:00      
         Re:            01/01/70 00:00      
            Re            01/01/70 00:00      
               Re:            01/01/70 00:00      
   A does not have to be 0            01/01/70 00:00      
      It can be convenient ...            01/01/70 00:00      
   velocity            01/01/70 00:00      
      I'm not so sure...            01/01/70 00:00      
      Be carefull            01/01/70 00:00      
         Re:            01/01/70 00:00      
   How I use that MOVC            01/01/70 00:00      

Back to Subject List