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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/26/08 14:35
Read: times


 
#160320 - Used to?
Responding to: ???'s previous message
DPTR is a 16-bit register named Data Pointer.

DB means Define Byte and the declaration stores a text string as individual bytes in the memory.

So your code assigns the Data Pointer (DPTR) to point at the first byte of the text string.

Then you somewhere have code that will pick up a byte using this data pointer and send it to the serial port. Then increment the data pointer to point at the next byte (character) so the transfer can continue.

The second-to-last value in the declaration (13) is the ASCII value for a new line.

The final value (0) is used somewhere by your program as a marker to end the output loop, when the last byte (character) has been sent.

But my question to you: How can you have done this already? How can you have sent text messages to your PC for years, without understanding the above code? Did you just pick up some code on the net and plugged into your processor? The rule is that you should/must never copy code from the net and use unless you properly understand the code. If you can't understand the code, then you have two options. Stay away from it, or study until you can understand it. Only if you understand the code will you be able to decide if the code is good enough to use or if it stinks.

List of 9 messages in thread
TopicAuthorDate
Loading DPTR with ascii code            01/01/70 00:00      
   Used to?            01/01/70 00:00      
      Indirect addressing mode on text            01/01/70 00:00      
         How an assembler works            01/01/70 00:00      
      that is context sensitive!            01/01/70 00:00      
   It depends ... read the datasheet ... then guess            01/01/70 00:00      
   Right back to basics - really foundational stuff            01/01/70 00:00      
   The one thing it most certainly does not do...            01/01/70 00:00      
      Thanks!!            01/01/70 00:00      

Back to Subject List